前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Greenplum Command Center(GPCC)的安装

Greenplum Command Center(GPCC)的安装

原创
作者头像
penny
修改2020-01-15 18:19:03
4.7K3
修改2020-01-15 18:19:03
举报
文章被收录于专栏:GreenplumGreenplum

Greenplum监控工具(Greenplum Command Center,GPCC)是Greenplum原生自动化运维工具,它面向Greenplum数据库管理员和使用者,基于浏览器的可视化图形界面,将集群内部复杂的监控信息直观地展示出来,提供了丰富的监控管理功能,从而降低Greenplum的使用门槛,减少运维作业的人力投入和学习成本。

所以,安装GPCC是必要的。

1. 版本介绍

Greenplum集群版本:Greenplum v5.23.0(GP工程师建议安装此版本,因为稳定)

GPCC版本:greenplum-cc-web-4.8.0-LINUX-x86_64-for5.23.0.zip

1.1.软件下载

官方下载链接:https://network.pivotal.io/products/pivotal-gpdb

找到您的GP版本,选择对应的GPCC版本。

2. 环境准备

在Greenplum数据库master节点上运行GPCC的安装程序。

2.1.执行gpperfmon_install命令

趁着软件下载的空隙,可以先在系统里执行此命令。

必须是gpadmin超级用户执行,必须提供连接master的连接端口,并提供将要创建的gpmon超级用户的密码。

代码语言:javascript
复制
$ su - gpadmin
$ gpperfmon_install --enable --password gpmon --port 5432

此命令的功能大致是:

代码语言:html
复制
创建greenplum监控用数据库(gpperfmon)
创建greenplum监控用数据库角色(gpmon)
配置greenplum数据库接受来自perfmon监控的链接文件(pg_hba.conf和.pgpass)
设置postgresql.conf文件,增加启用监控的参数。(这些参数默认会添加在文件的末尾)

(若没有报错,直接跳到第2.2点)

报错:因公司使用的不是默认端口5432,即使gpperfmon_install的命令指定了5431端口,但程序执行时还是使用5432端口,一直报错:

代码语言:javascript
复制
$ 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端口。

代码语言:javascript
复制
$ vim ~/.bash_profile
文件末尾加入 export PGPORT=5431
source ~/.bash_profile

2)或者找到gpperfmon_install的位置,修改gpperfmon_install官方脚本。

代码语言:html
复制
$ 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
……

2.2.检查 gpperfmon_install是否执行成功

代码语言:javascript
复制
$ ps -ef | grep gpmon 
$ psql gpperfmon -c 'SELECT* FROM system_now;'

3. 安装GPCC-web

3.1. 将下载的GPCC压缩文件上传到系统,并解压。

代码语言:javascript
复制
$ unzip greenplum-cc-web-4.8.0-LINUX-x86_64-for5.23.0.zip

请注意,执行gpccinstall命令涉及了root用户和gpadmin用户的权限问题。

因为gpccinstall命令需要在Greenplum集群每个节点都创建一个新文件夹,所以,执行命令一定要对目录有读写权限。命令的默认安装路径是/usr/local下。所以,

  • 如果,自己规划的路径,并且路径的各级目录是属于gpadmin,那么全程都可以用gpadmin系统用户执行。
  • 如果,要安装在/usr/local下,需要用root用户将/usr/local的权限改成gpadmin:
代码语言:javascript
复制
$ 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

3.2. 进入到GPCC的解压目录,并执行命令

代码语言:html
复制
$ 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
······

3.3. 添加环境变量

代码语言:javascript
复制
$ echo "source /usr/local/greenplum-cc-web-4.8.0/gpcc_path.sh" >> ~/.bash_profile 
$ source  ~/.bash_profile

3.4. GPCC的v4.8.0版本已经没有gpamdr的命令了,需要执行的是:

代码语言:javascript
复制
$ echo "host all gpmon <GPCC-host-ip>/32 md5" >> /home/gpdata/master/gpseg-1/pg_hba.conf&&su - gpadmin -c "gpstop -u" 
$ gpcc start

3.5 浏览器登录GPCC的web界面

地址:http://<GPCC-host-ip>:28080 用户名和密码:gpmon/gpmon

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. 版本介绍
    • 1.1.软件下载
    • 2. 环境准备
      • 2.1.执行gpperfmon_install命令
        • 2.2.检查 gpperfmon_install是否执行成功
        • 3. 安装GPCC-web
          • 3.1. 将下载的GPCC压缩文件上传到系统,并解压。
            • 3.2. 进入到GPCC的解压目录,并执行命令
              • 3.3. 添加环境变量
                • 3.4. GPCC的v4.8.0版本已经没有gpamdr的命令了,需要执行的是:
                  • 3.5 浏览器登录GPCC的web界面
                  相关产品与服务
                  数据库智能管家 DBbrain
                  数据库智能管家(TencentDB for DBbrain,DBbrain)是腾讯云推出的一款为用户提供数据库性能、安全、管理等功能的数据库自治云服务。DBbrain 利用机器学习、大数据手段、专家经验引擎快速复制资深数据库管理员的成熟经验,将大量传统人工的数据库运维工作智能化,服务于云上和云下企业,有效保障数据库服务的安全、稳定及高效运行。
                  领券
                  问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档