博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
最新版Greenplum Command Center 安装部署
阅读量:6340 次
发布时间:2019-06-22

本文共 8938 字,大约阅读时间需要 29 分钟。

集群系统初始化信息:

系统初始化参考:

集群安装配置参考:

本文对敏感信息进行了替换!!!!

Greenplum Command Center 安装部署

Greenplum Command Center介绍

Greenplum Command Center用于监控系统性能指标、分析系统健康、管理执行管理任务(如start 、stop、恢复Greenplum等)。它由data collection agent和Command Center等组件组成:

Agent:安装在master及其他segment节点上,用于收集数据,包括查询、系统指标等。Master节点的agent轮询收集segment的agent数据,然后发送给Command Center Database。

Command Center Database:存放agent收集的数据和指标,然后运算后通过web界面展现。它存放在Greenplum Database的gpperfmon库里。

Greenplum Command Center Console:提供图形终端用于查看系统指标和性能。

Greenplum Command Center Web Service:Greenplum Command Center Console通过web service框架来访问Command Center 数据库。使用的是Lighttpd服务器。

主机列表 (master节点):

cat >/workspace/gpdb/gp-all.txt <<-EOFgpnode611.kjh.com   gpnode612.kjh.com gpnode613.kjh.com   gpnode614.kjh.comgpnode615.kjh.comgpnode616.kjh.com   EOF

segment 节点

cat >/workspace/gpdb/gp-sg.txt<<-EOFgpnode611.kjh.com   gpnode612.kjh.com gpnode613.kjh.com   gpnode614.kjh.comEOF

安装gpcc

cd /workspace/gpdb/wget dl.#kjh#.com/greenplum-cc-web-4.3.1-LINUX-x86_64.zipunzip greenplum-cc-web-4.3.1-LINUX-x86_64.zip chown gpadmin:gpadmin -R *su - gpadmin

创建Command Center数据库(gpperfmon)

运行gpperfmon_install工具,提供Greenplum Database master的端口,设置gpmon用户密码。

gpperfmon_install --enable --port 5432 --password gpadmin=>]:-createdb gpperfmon >& /dev/null=>]:-PGPORT=5432 psql -f /usr/local/greenplum-db/./lib/gpperfmon/gpperfmon.sql gpperfmon >& /dev/null=>]:-PGPORT=5432 psql template1 -c "DROP ROLE IF EXISTS gpmon"  >& /dev/null=>]:-PGPORT=5432 psql template1 -c "CREATE ROLE gpmon WITH SUPERUSER CREATEDB LOGIN ENCRYPTED PASSWORD 'gpadmin'"  >& /dev/null=>]:-echo "local    gpperfmon         gpmon         md5" >> /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf=>]:-echo "host     all         gpmon         127.0.0.1/28    md5" >> /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf=>]:-echo "host     all         gpmon         ::1/128    md5" >> /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf=>]:-touch /home/gpadmin/.pgpass >& /dev/null=>]:-mv -f /home/gpadmin/.pgpass /home/gpadmin/.pgpass.1536042224 >& /dev/null=>]:-echo "*:5432:gpperfmon:gpmon:gpadmin" >> /home/gpadmin/.pgpass=>]:-cat /home/gpadmin/.pgpass.1536042224 >> /home/gpadmin/.pgpass=>]:-chmod 0600 /home/gpadmin/.pgpass >& /dev/null=>]:-PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on >& /dev/null=>]:-PGPORT=5432 gpconfig -c gpperfmon_port -v 8888 >& /dev/null=>]:-PGPORT=5432 gpconfig -c gp_external_enable_exec -v on --masteronly >& /dev/null=>]:-PGPORT=5432 gpconfig -c gpperfmon_log_alert_level -v warning >& /dev/null=>]:-gpperfmon will be enabled after a full restart of GPDBbled after a full restart of GPDB

重启Greenplum DB,重启后data collection agent才会启动

gpstop -r

确认 Master节点上data collection进程是否运行

ps -ef|grep gpmmongpadmin   33145  33135  0 14:32 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/gpmmon -D /usr/local/gpdata/gpmaster/gpseg-1/gpperfmon/conf/gpperfmon.conf -p 5432

确认 data collection 进程已经把数据写入到了Command Center数据库。

如果所有segment data collection agent在运行,你可以看到segment记录。

psql gpperfmon -c 'SELECT * FROM system_now;'        ctime        |         hostname         |  mem_total  |  mem_used   dle | load0 | load1 | load2 | quantum | disk_ro_rate | disk_wo_rate | disk_r略。。---------------------+--------------------------+-------------+-------------略。。----+-------+-------+-------+---------+--------------+--------------+-------略。。 2018-09-04 14:34:00 | gpnode611.kjh.com | 67129667584 |  5077311488 略。。9.5 |   0.1 |  0.07 |  0.05 |      15 |            0 |            3 |       略。。 2018-09-04 14:34:00 | gpnode612.kjh.com | 67129667584 |  5032013824 略。。.98 |  0.05 |  0.06 |  0.05 |      15 |            0 |            2 |       略。。 2018-09-04 14:34:00 | gpnode613.kjh.com | 67129667584 |  4930248704 略。。.98 |  0.02 |  0.02 |  0.05 |      15 |            0 |            4 |       略。。 2018-09-04 14:34:00 | gpnode614.kjh.com | 33309020160 |  4763942912 略。。.98 |     0 |  0.01 |  0.05 |      15 |            0 |            0 |       略。。 2018-09-04 14:34:00 | gpnode615.kjh.com | 67131998208 | 60665606144 略。。.76 |  0.08 |  0.22 |  0.19 |      15 |            0 |            3 |       略。。 2018-09-04 14:34:00 | gpnode616.kjh.com | 67129692160 | 33751642112 略。。.52 |  0.12 |  0.35 |  0.27 |      15 |            0 |            2 |       略。。(6 rows)

查看gpperfmon数据库中的内容

psql gpperfmonpsql (8.3.23)gpperfmon=# \dt                            List of relations Schema |                Name                 | Type  |  Owner  | Storage --------+-------------------------------------+-------+---------+--------- public | database_history                    | table | gpadmin | heap public | database_history_1_prt_1            | table | gpadmin | heap public | database_history_1_prt_r1415749053  | table | gpadmin | heap public | database_history_1_prt_r454010987   | table | gpadmin | heap.............略。。。。。。。。。。。。 public | socket_history_1_prt_1              | table | gpadmin | heap public | system_history                      | table | gpadmin | heap public | system_history_1_prt_1              | table | gpadmin | heap public | system_history_1_prt_r1729197682    | table | gpadmin | heap public | system_history_1_prt_r526510131     | table | gpadmin | heap(28 rows)

配置standby master

把Master上的$MASTER_DATA_DIRECTORY/pg_hba.conf文件拷贝到standby master上。确保Command Ceneter也能够访问standby master。拷贝Master的 ~/.pgpass文件到standby master上。

注意:.pgpass文件的权限是600。

传输配置文件到standby节点:scp -rp /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf gpadmin@172.20.6.16:/usr/local/gpdata/gpmaster/gpseg-1/scp -rp ~/.pgpass gpadmin@172.20.6.16:~/.pgpass

重新加载配置文件 postgresql.conf 和 pg_hba.conf

gpstop -u

安装Greenplum Command Center Console控制台

创建数据文件夹 (以root在master执行)

source /usr/local/greenplum-db/greenplum_path.shgpssh -f /workspace/gpdb/gp-all.txt=>mkdir -p /usr/local/gpccchown -R gpadmin:gpadmin  /usr/local/gpccexit

初始化安装

cd /workspace/gpdb/greenplum-cc-web-4.3.1-LINUX-x86_64/  ./gpccinstall-4.3.1
初始化过程如下:Do you agree to the Pivotal Greenplum Command Center End User License Agreement? Yy/Nn (Default=Y)yWhere would you like to install Greenplum Command Center? (Default=/usr/local) /usr/local/gpcc     《=====自定义安装路径          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)...........................To manage Command Center, use the gpcc utility.Usage:  gpcc [OPTIONS] Application Options:  -v, --version   Show Greenplum Command Center version      --settings  Print the current configuration settingsHelp Options:  -h, --help      Show this help messageAvailable commands:  help        Print list of commands  krbdisable  Disables kerberos authentication  krbenable   Enables kerberos authentication  start       Starts Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional]  status      Print agent status  with  [-W]  option to force password prompt for GPDB user gpmon [optional]  stop        Stops Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional]

添加环境变量:

设置gpadmin账户的环境并使之生效 gpadmin账户操作(master,standby 节点都配置)

修改.bashrc

cat >>/home/gpadmin/.bashrc<<-EOFGPCC_HOME=/usr/local/gpcc/greenplum-cc-web-4.3.1/PATH=$GPCC_HOME/bin:$PATHexport GPCC_HOMEEOF

修改.bash_profile

cat >>/home/gpadmin/.bash_profile<<-EOFGPCC_HOME=/usr/local/gpcc/greenplum-cc-web-4.3.1/PATH=$GPCC_HOME/bin:$PATHexport GPCC_HOMEEOF
使之生效
source ~/.bashrcsource ~/.bash_profile

增加访问权限

vim /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf 配置文件尾部添加内容如下:host     all         gpmon         0.0.0.0/0    md5传输配置文件到standby节点:scp -rp /usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf gpadmin@172.20.6.16:/usr/local/gpdata/gpmaster/gpseg-1/#重新加载配置文件 postgresql.conf 和 pg_hba.confgpstop -u

启动服务

命令参考 gpcc [OPTIONS] Application Options:  -v, --version   Show Greenplum Command Center version      --settings  Print the current configuration settingsHelp Options:  -h, --help      Show this help messageAvailable commands:  help        Print list of commands  krbdisable  Disables kerberos authentication  krbenable   Enables kerberos authentication  start       Starts Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional]  status      Print agent status  with  [-W]  option to force password prompt for GPDB user gpmon [optional]  stop        Stops Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional]

启动 gpcc-web

gpcc startStarting the gpcc agents and webserver…2018/09/04 15:05:39 Agent successfully started on 6/6 hosts2018/09/04 15:05:39 View Greenplum Command Center at http://gpnode615.kjh.com:28080

登陆用户密码存放位置:

/home/gpadmin/.pgpass

访问

参考资料:

转载于:https://blog.51cto.com/michaelkang/2170631

你可能感兴趣的文章
第七章 大网高级 ASA
查看>>
rsync+inotify触发式远程同步
查看>>
优秀设计师应当知道的几大UI设计原则(一)
查看>>
mongodb高级查询
查看>>
struts2.1 struts.devMode BUG解决方案
查看>>
日本法院裁定三星诉苹果专利侵权案败诉
查看>>
Windows Server 2012R2 桌面体验问题直通车
查看>>
Springboot配置文件读取报错Configuration property name 'projectUrl' is not valid:
查看>>
HTTP状态码
查看>>
今天的学习
查看>>
面试必问之JVM原理
查看>>
mysql主主同步+Keepalived
查看>>
研究音频编解码要看什么书
查看>>
tomcat远程调试配置
查看>>
QuartZ Cron表达式
查看>>
性能测试工具VTune的功能和用法介绍
查看>>
音频视频组件Audio DJ Studio for .NET更新至v10.0.0.0丨附下载
查看>>
Pig的输入输出及foreach,group关系操作
查看>>
TechParty - Code For Public - sz
查看>>
emacs 前端插件推荐[emmet-mode]
查看>>