安装greenplum-cc-web工具执行gpperfmon_install命令
[gpadmin@localhost ~]$ gpperfmon_install --enable --password gpmon --port 5432
20180730:18:15:14:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-createdb gpperfmon >& /dev/null
20180730:18:15:15:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-PGPORT=5432 psql -f /usr/local/greenplum-db/./lib/gpperfmon/gpperfmon.sql gpperfmon >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-PGPORT=5432 psql template1 -c "DROP ROLE IF EXISTS gpmon" >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-PGPORT=5432 psql template1 -c "CREATE ROLE gpmon WITH SUPERUSER CREATEDB LOGIN ENCRYPTED PASSWORD 'gpmon'" >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-echo "local gpperfmon gpmon md5" >> /data/gpdata/master/gpseg-1/pg_hba.conf
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-echo "host all gpmon 127.0.0.1/28 md5" >> /data/gpdata/master/gpseg-1/pg_hba.conf
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-echo "host all gpmon ::1/128 md5" >> /data/gpdata/master/gpseg-1/pg_hba.conf
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-touch /home/gpadmin/.pgpass >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-mv -f /home/gpadmin/.pgpass /home/gpadmin/.pgpass.1532945714 >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-echo "*:5432:gpperfmon:gpmon:gpmon" >> /home/gpadmin/.pgpass
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-cat /home/gpadmin/.pgpass.1532945714 >> /home/gpadmin/.pgpass
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-chmod 0600 /home/gpadmin/.pgpass >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[INFO]:-PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on >& /dev/null
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[ERROR]:-error on command: PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on
20180730:18:15:16:029823 gpperfmon_install:localhost:gpadmin-[ERROR]:-gpperfmon not successfully installed
出现错误-error on command: PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on,解决方法:
网上搜不到解决方案,尝试单独直接执行命令gpconfig -c gp_enable_gpperfmon -v on,出现如下错误:
[gpadmin@localhost ~]$ gpconfig -c gp_enable_gpperfmon -v on
20180730:18:16:16:029940 gpconfig:localhost:gpadmin-[ERROR]:-FATAL: database "testdb" does not exist
20180730:18:16:16:029940 gpconfig:localhost:gpadmin-[ERROR]:-Failed to connect to database, exiting without action. This script can only be run when the database is up.
Failed to connect to database, exiting without action. This script can only be run when the database is up.
恍然大悟,总算有点眉头
这是因为环境变量里面设置了export PGDATABASE=testdb,而gpdb中不存在这个库,导致连接不上数据库,从而导致gpconfig -c gp_enable_gpperfmon -v on命令执行错误,解决方案:
1、修改环境变量为:export PGDATABASE=postgres
2、删除gpdb中由于执行gpperfmon_install建立的库
3、重新执行gpperfmon_install --enable --password gpmon --port 5432
成功,重启gpdb,执行ps -ef | grep gpmmon,数据采集代理启动成功
这里记录一下,备忘