From: <xu...@cm...> - 2015-01-27 11:34:03
|
hi When I use pgxc_ctl tool to monitor datanode. I found that pgxc_ctl monitor function have some problems as follow: 1.If datanode is recovering, then pgxc_ctl monitor issue wrong state information that datanode is not runing. Obviously, It is wrong. I hope pgxc_ctl tool tell me that datanode is recovering. 2.If datanode is shutting down. pgxc_ctl mointor function has the same problem as above. Now I have a design that it can provide detailed and precise information on the status of the database. In datanode, there is a file in data folder. Name is pg_control, Path is data/global. This file records the current state information about the datanode as follow: Database cluster state: in production Database cluster state: starting up Database cluster state: shut down Database cluster state: shut down in recovery Database cluster state: shutting down Database cluster state: in crash recovery Database cluster state: in archive recovery Now if I know datanode master process is active. Then I can make sure that the stats information in pg_control is right. Pseudocode as follows: 1.See whether datanode master process is active with ssh command(ssh pgxc@192.168.198.101 ps -ef | grep /home/pgxc/data/datanode) 2.If master process is active, then we can get current state information with ssh command(ssh pgxc@192.168.198.101 /home/pgxc/postgres_xc/bin/pg_controldata /home/pgxc/data/dn_master/ | grep "Database cluster state") 3.If master process is not active. then tell user that datanode service is shut down. Please help to review this design, If any problem, please let me know. Thank your for help xu...@cm... |