前提条件:

  1. 环境: centos 7.3
  2. 安装开源版本gpdb-5.6.0

★编译

  1. ># su - demo
  2. >$ cd /home/demo/gpdb-5.6.0/gpAux/gpperfmon
  3. >$ make
  4. >$ make install

★安装gpperfmon到greenplum中

  1. >$ gpperfmon_install --enable --password gpmon --port 5432

底层操作(无需人工操作)

  1. gpperfmon数据目录: $MASTER_DATA_DIRECTORY/gpperfmon
  2. >$ vi /home/demo/.pgpass
  3. *:5432:gpperfmon:gpmon:gpmon
  4. >$ vi $MASTER_DATA_DIRECTORY/postgresql.conf
  5. gp_enable_gpperfmon=on
  6. gpperfmon_port=8888
  7. gp_external_enable_exec=on
  8. gpperfmon_log_alert_level='warning'
  9. >$ vi $MASTER_DATA_DIRECTORY/pg_hba.conf
  10. local gpperfmon gpmon md5
  11. host all gpmon 127.0.0.1/28 md5
  12. host all gpmon ::1/128 md5

★重启greenplum

  1. >$ gpstop -a
  2. >$ gpstart -a

★查看进程是否正常启动

  1. >$ ps -ef | grep gpmmon
  2. 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
  3. demo 108654 108019 0 11:30 pts/0 00:00:00 grep --color=auto gpmmon
  4. >$ ps -ef | grep gpsmon
  5. 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
  6. gpadmin 28576 22292 0 10:04 pts/2 00:00:00 grep --color=auto gpsmon

★运行下面的命令来验证数据收集程序正在写入到命令中心数据库。如果所有的段数据收集代理正在运行,您应该看到每行一个segment host

  1. >$ psql gpperfmon -c 'SELECT * FROM system_now;'

报错1:

  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.
  2. Note that its locks and other resources will not be released until then.",,,,,0,,"perfmon.c",116,"Stack trace:
  3. 1 0x98c3b6 postgres errstart (elog.c:521)
  4. 2 0x98e22b postgres elog_finish (elog.c:1462)
  5. 3 0x7ff35c postgres <symbol not found> (perfmon.c:115)
  6. 4 0x7ff3ae postgres perfmon_start (perfmon.c:65)
  7. 5 0x7f3738 postgres <symbol not found> (postmaster.c:2544)
  8. 6 0x7f4f72 postgres PostmasterMain (postmaster.c:1525)
  9. 7 0x493287 postgres main (main.c:206)
  10. 8 0x7f599206eb35 libc.so.6 __libc_start_main + 0xf5
  11. 9 0x4933a4 postgres <symbol not found> + 0x4933a4
  12. "

解决方案:

  1. ># find / -name libevent-2.1.so.6
  2. /usr/local/lib/libevent-2.1.so.6
  3. ># su - demo
  4. >$ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/lib' >>~/.bashrc
  5. >$ source ~/.bashrc

报错2:

  1. >$ tail -f $MASTER_DATA_DIRECTORY/gpperfmon/logs
  2. 2018-07-03 11:43:52|:-WARNING: [gpmmon.c:471] connect system call failed
  3. error 22 (Invalid argument)
  4. 2018-07-03 11:43:52|:-WARNING: [gpmmon.c:698] cannot connect to centos73 (fe80::20c:29ff:fe26:cbe0:8888)
  5. 2018-07-03 11:44:00|:-LOG: Connection to centos73 lost. Restarting gpsmon.

解决方案:

  1. >$ vi /etc/hosts
  2. 125.10.1.168 centos73
  3. 127.0.0.1 centos73
  4. >$ vi ~/.bashrc
  5. export PGHOST=centos73
  6. >$ source ~/.bashrc
  7. >$ gpstop -a
  8. >$ gpstart -a

参考:

  1. https://github.com/greenplum-db/gpdb
本站文章,未经作者同意,请勿转载,如需转载,请邮件customer@csudata.com.
0 评论  
添加一条新评论