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进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
文章被以下合辑收录
评论
相关阅读
王炸!OGG 23ai 终于支持从PostgreSQL备库抽取数据了
曹海峰
327次阅读
2025-03-09 12:54:06
PostgreSQL 17.3、16.7、15.11、14.16 和 13.19 发布!
通讯员
209次阅读
2025-02-17 14:45:24
Pgpool-II 4.6 beta1 现已发布
通讯员
190次阅读
2025-02-20 10:20:51
玩一玩系列——玩玩pg_duckdb(我的开源之旅)
小满未满、
182次阅读
2025-02-23 13:45:28
PostgreSQL 17.4、16.8、15.12、14.17 和 13.20 版本发布!
通讯员
176次阅读
2025-02-21 10:40:49
Product Hunt 发布2024年度金喵奖榜单:数据库 AI 工具 postgres.new 荣获“最佳开源产品奖”
通讯员
151次阅读
2025-02-19 14:07:02
PostgreSQL计划于 2025 年 2 月 20 日进行周期外发布
通讯员
127次阅读
2025-02-17 12:13:39
玩一玩系列——玩玩pg_mooncake(PostgreSQL的高性能列存新贵)
小满未满、
122次阅读
2025-03-03 17:18:03
套壳论
梧桐
115次阅读
2025-03-09 10:58:17
玩一玩系列——玩玩postgres_fdw
小满未满、
106次阅读
2025-02-17 15:09:38
TA的专栏
目录