Greenplum监控工具(Greenplum Command Center,GPCC)是Greenplum原生自动化运维工具,它面向Greenplum数据库管理员和使用者,基于浏览器的可视化图形界面,将集群内部复杂的监控信息直观地展示出来,提供了丰富的监控管理功能,从而降低Greenplum的使用门槛,减少运维作业的人力投入和学习成本。
所以,安装GPCC是必要的。
Greenplum集群版本:Greenplum v5.23.0(GP工程师建议安装此版本,因为稳定)
GPCC版本:greenplum-cc-web-4.8.0-LINUX-x86_64-for5.23.0.zip
官方下载链接:https://network.pivotal.io/products/pivotal-gpdb
找到您的GP版本,选择对应的GPCC版本。
在Greenplum数据库master节点上运行GPCC的安装程序。
趁着软件下载的空隙,可以先在系统里执行此命令。
必须是gpadmin超级用户执行,必须提供连接master的连接端口,并提供将要创建的gpmon超级用户的密码。
$ su - gpadmin
$ gpperfmon_install --enable --password gpmon --port 5432
此命令的功能大致是:
创建greenplum监控用数据库(gpperfmon)
创建greenplum监控用数据库角色(gpmon)
配置greenplum数据库接受来自perfmon监控的链接文件(pg_hba.conf和.pgpass)
设置postgresql.conf文件,增加启用监控的参数。(这些参数默认会添加在文件的末尾)
(若没有报错,直接跳到第2.2点)
报错:因公司使用的不是默认端口5432,即使gpperfmon_install的命令指定了5431端口,但程序执行时还是使用5432端口,一直报错:
$ gpperfmon_install --enable --password gpmon --port 5431
20200110:18:15:14:062733 gpperfmon_install:node01:gpadmin-[INFO]:-createdb gpperfmon >& /dev/null
20200110:18:15:14:062733 gpperfmon_install:node01:gpadmin-[error]:-error on command: createdb gpperfmon
20200110:18:15:14:062733 gpperfmon_install:node01:gpadmin-[error]:-gpperfmon not successfully installed
解决方法有两个:
1)在gpadmin系统用户下的.bash_profile文件末尾加入5431端口。
$ vim ~/.bash_profile
文件末尾加入 export PGPORT=5431
source ~/.bash_profile
2)或者找到gpperfmon_install的位置,修改gpperfmon_install官方脚本。
$ which gpperfmon_install
/usr/local/greenplum-db/bin/gpperfmon_install
$ cd /usr/local/greenplum-db/bin/
$ cp gpperfmon_install gpperfmon_install.bak
$ vi gpperfmon_install
将文件中的第131行,cmd = Command("createdb gpperfmon") 加上5431端口,
cmd = Command("createdb gpperfmon -p 5431")即可解决。
然后重启数据库使设置生效:
$gpstop -M fast
$gpstart -a
再次执行:
$ gpperfmon_install --enable --password gpmon --port 5431
20200111:09:25:12:062733 gpperfmon_install:node01:gpadmin-[INFO]:-createdb gpperfmon -p 5431>& /dev/null
……
$ ps -ef | grep gpmon
$ psql gpperfmon -c 'SELECT* FROM system_now;'
$ unzip greenplum-cc-web-4.8.0-LINUX-x86_64-for5.23.0.zip
请注意,执行gpccinstall命令涉及了root用户和gpadmin用户的权限问题。
因为gpccinstall命令需要在Greenplum集群每个节点都创建一个新文件夹,所以,执行命令一定要对目录有读写权限。命令的默认安装路径是/usr/local下。所以,
$ su root
$ ssh 各节点的hostname chown gpadmin:gpadmin /usr/local
$ chown -R gpadmin:gpadmin /usr/local/greenplum-cc-web-4.8.0-LINUX-x86_64
$ su - gpadmin
$ cd /usr/local/greenplum-cc-web-4.8.0-LINUX-x86_64
$ ./gpccinstall-4.8.0
license······ 一路点击space空格到底
如果,是默认安装在/usr/local目录下,可以一路enter回车,如果想要自定义,则:
Do you agree to the Pivotal Greenplum Command Center End User License Agreement? Yy/Nn (Default=Y)
回车
Where would you like to install Greenplum Command Center? (Default=/usr/local)
/server/greenplum-tools/(输入,自定义安装路径)
What would you like to name this installation of Greenplum Command Center? (Default=gpcc)
回车
What port would you like gpcc webserver to use? (Default=28080)
如果使用默认的web访问端口,就直接回车
Would you like enable SSL? Yy/Nn (Default=N)
回车
Please choose a display language (Default=English)
1. English
2. Chinese
3. Korean
4. Russian
5. Japanese
回车或者输入2
······
$ echo "source /usr/local/greenplum-cc-web-4.8.0/gpcc_path.sh" >> ~/.bash_profile
$ source ~/.bash_profile
$ echo "host all gpmon <GPCC-host-ip>/32 md5" >> /home/gpdata/master/gpseg-1/pg_hba.conf&&su - gpadmin -c "gpstop -u"
$ gpcc start
地址:http://<GPCC-host-ip>:28080 用户名和密码:gpmon/gpmon
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有