暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL基础 postmaster.pid 查看主进程信息

CentOS 7.6.1810
postgresql 14.4

postmaster.pid 查看主进程信息

[postgres@localhost data]$ cat postmaster.pid -n 1 10797 2 /var/lib/pgsql/14/data 3 1657700763 4 5432 5 /var/run/postgresql 6 localhost 7 33563803 294912 8 ready
复制

1 2

  • PID:10797
  • PGDATA:/var/lib/pgsql/14/data
[postgres@localhost data]$ ps -ef | grep 'postgres -D' postgres 10797 1 0 16:26 ? 00:00:00 /usr/pgsql-14/bin/postgres -D /var/lib/pgsql/14/data postgres 16144 10530 0 23:25 pts/0 00:00:00 grep --color=auto postgres -D
复制

3

  • 文件创建时间:1657700763
[postgres@localhost data]$ python Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.localtime(1657700763) time.struct_time(tm_year=2022, tm_mon=7, tm_mday=13, tm_hour=16, tm_min=26, tm_sec=3, tm_wday=2, tm_yday=194, tm_isdst=0)
复制
[postgres@localhost data]$ date Wed Jul 13 23:42:51 CST 2022 [postgres@localhost data]$ ps -ef | grep 'postgres -D' postgres 10797 1 0 16:26 ? 00:00:00 /usr/pgsql-14/bin/postgres -D /var/lib/pgsql/14/data postgres 16425 10530 0 23:42 pts/0 00:00:00 grep --color=auto postgres -D [postgres@localhost data]$ ll | grep postmaster -rw-------. 1 postgres postgres 57 Jul 13 16:26 postmaster.opts -rw-------. 1 postgres postgres 104 Jul 13 16:26 postmaster.pid
复制

4

  • 端口号:5432
[postgres@localhost data]$ netstat -antp | grep post (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 10797/postgres tcp6 0 0 ::1:5432 :::* LISTEN 10797/postgres
复制

5

  • 监听目录:/var/run/postgresql
[postgres@localhost data]$ netstat -a | grep post tcp 0 0 localhost:postgres 0.0.0.0:* LISTEN tcp6 0 0 localhost:postgres [::]:* LISTEN unix 2 [ ACC ] STREAM LISTENING 62788 /var/run/postgresql/.s.PGSQL.5432 [postgres@localhost data]$ cd /var/run/postgresql [postgres@localhost postgresql]$ ll total 0 [postgres@localhost postgresql]$ ls -al total 4 drwxr-xr-x. 2 postgres postgres 80 Jul 13 16:26 . drwxr-xr-x. 41 root root 1280 Jul 13 16:03 .. srwxrwxrwx. 1 postgres postgres 0 Jul 13 23:12 .s.PGSQL.5432 -rw-------. 1 postgres postgres 65 Jul 13 23:12 .s.PGSQL.5432.lock
复制

6

  • 监听地址:localhost
#listen_addresses = 'localhost' # what IP address(es) to listen on; # comma-separated list of addresses; # defaults to 'localhost'; use '*' for all
复制

7

  • key:33563803
  • shmid:294912
[postgres@localhost data]$ ipcs ------ Message Queues -------- key msqid owner perms used-bytes messages ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x0200249b 294912 postgres 600 56 6 0x00000000 98305 gdm 777 16384 1 dest 0x00000000 196610 gdm 777 2129920 1 dest 0x00000000 229379 gdm 777 1376256 2 dest ------ Semaphore Arrays -------- key semid owner perms nsems [postgres@localhost data]$ echo 0x0200249b 0x0200249b [postgres@localhost data]$ echo $((0x0200249b)) 33563803
复制

8

  • 主进程状态:ready
[postgres@localhost data]$ pg_ctl status -D /var/lib/pgsql/14/data pg_ctl: server is running (PID: 10797) /usr/pgsql-14/bin/postgres "-D" "/var/lib/pgsql/14/data"
复制

参考资料

学习资料


欢迎各位同学一起来交流学习心得!

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论

TA的专栏
学习笔记 KingBaseES
收录72篇内容
学习笔记 PostgreSQL
收录39篇内容
认证笔记 KingBase KCP
收录4篇内容
目录
  • postmaster.pid 查看主进程信息
  • 1 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 参考资料
  • 学习资料