原 在GreenPlum中,如果知道某个数据节点sdw1上的进程号,其CPU使用率特别高,那么如何查询master上对应的进程号呢?
简介
在GreenPlum中,如果知道某个数据节点sdw1上的进程号,其CPU使用率特别高,那么如何查询master上对应的进程号呢??
解答:在同一个会话中的pg_stat_activity.sess_id的值在所有segment中是一样的,所以排查过程就是“top -c -u gpadmin”,其中con11396776后的数字11396776就是在master中查询pg_stat_activity.sess_id的值。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [gpadmin@mdw conf]$ gpssh -f all_hosts "ps -ef|grep 11396776" [ mdw] gpadmin 3295260 3294094 5 16:38 pts/0 00:00:00 python /usr/local/greenplum-db-6.23.1/bin/gpssh -f all_hosts ps -ef|grep 11396776 [ mdw] gpadmin 3522826 1247336 0 Mar26 ? 00:19:30 postgres: 5432, gpadmin lhrdb1 192.18.27.86(53478) con11396776 cmd137914 UPDATE [sdw2] gpadmin 374522 2866323 0 Mar26 ? 00:01:43 postgres: 6000, gpadmin lhrdb1 192.18.25.24(49326) con11396776 seg4 idle [sdw2] gpadmin 374523 2866324 0 Mar26 ? 00:01:40 postgres: 6001, gpadmin lhrdb1 192.18.25.24(38122) con11396776 seg5 idle [sdw2] gpadmin 374524 2888429 0 Mar26 ? 00:01:41 postgres: 6003, gpadmin lhrdb1 192.18.25.24(40371) con11396776 seg7 idle [sdw2] gpadmin 374525 2868548 0 Mar26 ? 00:01:40 postgres: 6002, gpadmin lhrdb1 192.18.25.24(52740) con11396776 seg6 idle [sdw1] gpadmin 1842956 1566129 0 Mar26 ? 00:01:39 postgres: 6000, gpadmin lhrdb1 192.18.25.24(44096) con11396776 seg0 idle [sdw1] gpadmin 1842957 1558925 0 Mar26 ? 00:01:38 postgres: 6001, gpadmin lhrdb1 192.18.25.24(59134) con11396776 seg1 idle [sdw1] gpadmin 1842958 1560374 0 Mar26 ? 00:01:37 postgres: 6002, gpadmin lhrdb1 192.18.25.24(60486) con11396776 seg2 idle [sdw1] gpadmin 1842959 1565545 0 Mar26 ? 00:01:38 postgres: 6003, gpadmin lhrdb1 192.18.25.24(40046) con11396776 seg3 idle [sdw3] gpadmin 192803 3009949 0 Mar26 ? 00:02:13 postgres: 6000, gpadmin lhrdb1 192.18.25.24(56834) con11396776 seg8 idle [sdw3] gpadmin 192804 3007222 0 Mar26 ? 00:02:07 postgres: 6002, gpadmin lhrdb1 192.18.25.24(52438) con11396776 seg10 idle [sdw3] gpadmin 192805 3009619 0 Mar26 ? 00:02:09 postgres: 6001, gpadmin lhrdb1 192.18.25.24(59360) con11396776 seg9 idle [sdw3] gpadmin 192806 3008105 0 Mar26 ? 00:01:54 postgres: 6003, gpadmin lhrdb1 192.18.25.24(38252) con11396776 seg11 idle |