安裝greenplum-cc-web工具出現-error on command: PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on

安裝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,數據採集代理啓動成功

這裏記錄一下,備忘

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章