六、GP安装笔记-GPCC安装

一、安装监控管理工具

对应安装文档:https://gpcc.docs.pivotal.io/420/topics/install.html

  • 执行Greenplum DB数据库的gpperfmon_install工具,完成GP监控软件安装的前期准备工作,gpperfmon_install工具的功能大致是:

    • 创建greenplum监控用数据库(gpperfmon)
    • 创建greenplum监控用数据库角色(gpmon)
    • 配置greenplum数据库接受来自perfmon监控的链接文件(pg_hba.conf和.pgpass)
    • 设置postgresql.conf文件,增加启用监控的参数(这些参数默认会添加在文件的末尾)
  • 执行如下命令进行安装gpperfmon:

gpperfmon_install --enable --password gpmon --port 5432

注:可以看到命令执行后,会创建gpmon角色,以及设置了密码,这个用户可以登录到数据库里面,也可用于登录页面。如果在执行命令失败,可以查看/data/greenplum/master/gpseg-1/pg_log对应目录下相关的执行日志来查看具体失败原因。

  • 执行成功以后,需要重启greenplum集群
gpstop -M fast
gpstart -a
  • 查看gpmon进程是否启用。该进程在gp集群的master节点运行,从master节点收集相关的查询信息。同时,默认每间隔15s会收集gpsmon进程相关信息,并保存相关的监控数据和日志成csv文件,gp通过外部表的形式引用该配置文件,方便查询。
    gpsmon进程则会在每个segment的服务器节点上运行,它通过收集系统相关相关数据,gpsmon进程会间隔15s通过upd端口从该进程获取监控数据,汇总到master节点,生成csv格式的日志文件。
ps -ef | grep gpmmon| grep -v grep
ps -ef | grep gpsmon| grep -v grep

查看到如下内容:gpadmin 20712 20702 0 16:30 ? 00:00:00 /opt/greenplum/greenplum-db-5.8.0/bin/gpmmon -D /data/greenplum/master/gpseg-1/gpperfmon/conf/gpperfmon.conf -p 5432
表示gpmmon进程已经启动成功了

  • stand by master节点安装
    当主备切换的时候为了保证gpmmon生效,需要同步白名单和密码文件到standby节点服务器。从节点安装只需要同步pg_hba.conf和.pgpass两个配置文件到对应的目录结构下即可。
    拷贝pg_hba.conf白名单配置文件:
gpscp -h kylin-203-130 $MASTER_DATA_DIRECTORY/pg_hba.conf =:$MASTER_DATA_DIRECTORY/pg_hba.conf

拷贝.pgpass文件到stand by master节点,该文件管理postgresql的密码文件,这样用户登入可以不用在白名单中设置trust模式,登入时也不用指定密码进行登入。因此也许同步.pgpass配置文件到standby节点。

gpscp -h kylin-203-130 ~/.pgpass =:~/.pgpass
gpssh -h kylin-203-130 -e -v "chmod 0600 ~/.pgpass"

安装成功以后gpperfmon日志存储的目录为,如果修改日志文件的相关目录可以修改gpperfmon.conf配置文件的log_location配置项进行修改:

$MASTER_DATA_DIRECTORY/gpperfmon/logs/gpmmon.log

而在segment节点,相关日志文件为gpsmon.log

二、安装Greenplum Command Center Console

从官方网址中下载安装包,下载地址:https://network.pivotal.io/products/pivotal-gpdb#/releases/93896/file_groups/966
将下载下来的GPCC包上传到master节点上,进行解压安装,执行gpccinstall-4.2.0安装命令,会将greenplum-cc-web安装到集群的所有服务器中。安装成功GPCC会产生一个webserver进程,可以通过浏览器进行管理和访问gpcc集群,同时每台服务器还会有一个ccagent进程,该进程用于收集每台服务器实时监控指标,落地到gp数据库中:

unzip greenplum-cc-web-4.2.0-LINUX-x86_64.zip
cd greenplum-cc-web-4.2.0-LINUX-x86_64/
 ./gpccinstall-4.2.0

具体安装步骤如下,除了设定安装路径到/opt/greenplum/,默认会生成greenplum-cc-web-4.2.0文件夹,其他均可采用默认设置。

Do you agree to the Pivotal Greenplum Command Center End User License Agreement? Yy/Nn (Default=Y)
y
Where would you like to install Greenplum Command Center? (Default=/usr/local)
/opt/greenplum
Path not exist, create it? Yy/Nn (Default=Y)
y
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)
Would you like to enable kerberos? Yy/Nn (Default=N)
Would you like enable SSL? Yy/Nn (Default=N)

在所有的服务器中创建软链接,执行如下命令:

gpssh -f /opt/greenplum/hostlist
 => cd /opt/greenplum
[kylin-203-117]
[kylin-203-140]
[kylin-203-122]
[kylin-203-130]
=> ln -s greenplum-cc-web-4.2.0 greenplum-cc-web
[kylin-203-117]
[kylin-203-140]
[kylin-203-122]
[kylin-203-130]
=> exit

添加环境变量,在~/.bash_profile添加如下内容:

source /opt/greenplum/greenplum-cc-web/gpcc_path.sh
source ~/.bash_profile

同步环境变量到集群的所有服务器上,other_hosts即为上面编辑的除了master节点外的服务器主机名列表

gpscp -f /opt/greenplum/other_hosts ~/.bash_profile =:~/.bash_profile

设置访问白名单,编辑pg_hba.conf配置文件,配置内容如下,前三项在安装gpcc的时候会默认生成,最后一项需要手动添加:

# gpperfmon
local gpperfmon gpmon md5
host all gpmon 127.0.0.1/28 md5
host all gpmon ::1/128 md5
host all gpmon 10.100.203.140/32 md5

如果不添加最后一行,在执行gpcc start命令的时候会出现如下异常:
2018/12/24 14:56:53 pq: no pg_hba.conf entry for host “10.100.203.140”, user “gpmon”, database “gpperfmon”, SSL off

将白名单文件同步到standby节点

gpscp -h kylin-203-130 /data/greenplum/master/gpseg-1/pg_hba.conf =:/data/greenplum/master/gpseg-1/

重启gp集群:

gpstop -M fast
gpstart -a

启动GPCC

gpcc start

Starting the gpcc agents and webserver…
2018/12/24 14:58:06 Agent successfully started on 4/4 hosts
2018/12/24 14:58:06 View Greenplum Command Center at http://kylin-203-140:28080

通过访问http://kylin-203-140:28080页面即可登入GPCC,查看相关的监控数据了,默认的登入用户名:gpmon,密码:gpmon

三、相关管理指令说明

启动gpcc

gpcc start

关闭gpcc

gpcc stop

查看gpcc状态

gpcc status

查看gpcc相关配置,配置文件存储在/opt/greenplum/greenplum-cc-web/conf/app.conf目录下,修改相关配置需要同步到集群中的所有服务器中:

gpcc --settings
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值