[postgres@pgserver ~]$ ps -ef |grep postgres
root 1070 1054 0 18:38 tty1 00:00:00 su - postgres
postgres 1071 1070 0 18:38 tty1 00:00:00 -bash
postgres 1252 1 0 19:09 ? 00:00:00 /usr/local/pgsql/bin/postgres
postgres 1254 1252 0 19:09 ? 00:00:00 postgres: checkpointer process
postgres 1255 1252 0 19:09 ? 00:00:00 postgres: writer process
postgres 1256 1252 0 19:09 ? 00:00:00 postgres: wal writer process
postgres 1257 1252 0 19:09 ? 00:00:00 postgres: autovacuum launcher process
postgres 1258 1252 0 19:09 ? 00:00:00 postgres: stats collector process
postgres 1259 1252 0 19:09 ? 00:00:00 postgres: bgworker: logical replication launcher
root 1521 1489 0 21:39 pts/1 00:00:00 su - postgres
postgres 1522 1521 0 21:39 pts/1 00:00:00 -bash
postgres 1561 1252 0 21:49 ? 00:00:00 postgres: u_nasa db_nasa 192.168.80.1(65137) idle
postgres 1562 1252 0 21:49 ? 00:00:00 postgres: u_nasa db_nasa 192.168.80.1(65138) idle
固定值postgres: user db 客户端IP(客户端应用程序使用的端口)动作
postgres 1566 1522 0 21:50 pts/1 00:00:00 ps -ef
postgres 1567 1522 0 21:50 pts/1 00:00:00 grep --color=auto postgres
[postgres@pgserver ~]$
参考:https://www.postgresql.org/docs/current/static/monitoring-ps.html
http://blog.youkuaiyun.com/msdnchina/article/details/78492302

本文介绍了一个使用ps和grep命令监控PostgreSQL进程的方法。通过展示实际的命令输出,详细解释了如何查看正在运行的PostgreSQL进程及其相关信息,如进程ID、用户、客户端IP地址等。
716

被折叠的 条评论
为什么被折叠?



