前提条件:
环境: centos 7.3
安装开源版本gpdb-5.6.0
★编译
># su - demo
>$ cd /home/demo/gpdb-5.6.0/gpAux/gpperfmon
>$ make
>$ make install
★安装gpperfmon到greenplum中
>$ gpperfmon_install --enable --password gpmon --port 5432
底层操作(无需人工操作)
gpperfmon数据目录: $MASTER_DATA_DIRECTORY/gpperfmon
>$ vi /home/demo/.pgpass
*:5432:gpperfmon:gpmon:gpmon
>$ vi $MASTER_DATA_DIRECTORY/postgresql.conf
gp_enable_gpperfmon=on
gpperfmon_port=8888
gp_external_enable_exec=on
gpperfmon_log_alert_level='warning'
>$ vi $MASTER_DATA_DIRECTORY/pg_hba.conf
local gpperfmon gpmon md5
host all gpmon 127.0.0.1/28 md5
host all gpmon ::1/128 md5
★重启greenplum
>$ gpstop -a
>$ gpstart -a
★查看进程是否正常启动
>$ ps -ef | grep gpmmon
demo 107910 107901 0 11:24 ? 00:00:00 /home/demo/gpdb/bin/gpmmon -D /home/demo/data/master/gpseg-1/gpperfmon/conf/gpperfmon.conf -p 5432
demo 108654 108019 0 11:30 pts/0 00:00:00 grep --color=auto gpmmon
>$ ps -ef | grep gpsmon
gpadmin 28466 1 0 10:03 ? 00:00:00 /home/gpadmin/gpdb/bin/gpsmon -m 0 -t 150 -l /home/gpadmin/data/primary/gpseg0/gpperfmon -v 0 8888
gpadmin 28576 22292 0 10:04 pts/2 00:00:00 grep --color=auto gpsmon
★运行下面的命令来验证数据收集程序正在写入到命令中心数据库。如果所有的段数据收集代理正在运行,您应该看到每行一个segment host
>$ psql gpperfmon -c 'SELECT * FROM system_now;'
报错1:
FATAL","XX000","Failed to find gpmmon executable: /home/demo/gpdb/bin/gpmmon (gpmmon packet version 5 (perfmon.c:116)",")","Process 107430 will wait for gp_debug_linger=120 seconds before termination.
Note that its locks and other resources will not be released until then.",,,,,0,,"perfmon.c",116,"Stack trace:
1 0x98c3b6 postgres errstart (elog.c:521)
2 0x98e22b postgres elog_finish (elog.c:1462)
3 0x7ff35c postgres <symbol not found> (perfmon.c:115)
4 0x7ff3ae postgres perfmon_start (perfmon.c:65)
5 0x7f3738 postgres <symbol not found> (postmaster.c:2544)
6 0x7f4f72 postgres PostmasterMain (postmaster.c:1525)
7 0x493287 postgres main (main.c:206)
8 0x7f599206eb35 libc.so.6 __libc_start_main + 0xf5
9 0x4933a4 postgres <symbol not found> + 0x4933a4
"
解决方案:
># find / -name libevent-2.1.so.6
/usr/local/lib/libevent-2.1.so.6
># su - demo
>$ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/lib' >>~/.bashrc
>$ source ~/.bashrc
报错2:
>$ tail -f $MASTER_DATA_DIRECTORY/gpperfmon/logs
2018-07-03 11:43:52|:-WARNING: [gpmmon.c:471] connect system call failed
error 22 (Invalid argument)
2018-07-03 11:43:52|:-WARNING: [gpmmon.c:698] cannot connect to centos73 (fe80::20c:29ff:fe26:cbe0:8888)
2018-07-03 11:44:00|:-LOG: Connection to centos73 lost. Restarting gpsmon.
解决方案:
>$ vi /etc/hosts
125.10.1.168 centos73
127.0.0.1 centos73
>$ vi ~/.bashrc
export PGHOST=centos73
>$ source ~/.bashrc
>$ gpstop -a
>$ gpstart -a
参考:
https://github.com/greenplum-db/gpdb
本站文章,未经作者同意,请勿转载,如需转载,请邮件customer@csudata.com.
0 评论
添加一条新评论