概述

greenplum的一个web界面的监控系统。可以监控数据库的一些状态,节点信息

下载

下载greenplum cc的方法有限,我的途径是通过
https://network.pivotal.io/products/pivotal-gpdb
这个网站,可以下载对应版本的grennplum cc。ps:需要相应的账号

安装前准备

安装gpperfmon数据库,以及为gpmon用户创建密码

  1. gpperfmon_install --enable --password 123456 --port 5432

这个命令是在greenplum安装完成的时候就已经有的,如果是编译安装,编译的时候一定要加—enable-gpperfmon这个参数,才能保证有这个命令。
功能大致是:
创建greenplum监控用数据库(gpperfmon)
创建greenplum监控用数据库角色(gpmon)
配置greenplum数据库接受来自perfmon监控的链接文件(pg_hba.conf和.pgpass)
设置postgresql.conf文件,增加启用监控的参数。(这些参数默认会添加在文件的末尾)
设置pg_hba.conf文件,增加如下信息:

  1. local gpperfmon gpmon md5
  2. host all gpmon 127.0.0.1/28 md5

重启数据库

  1. gpstop -r

检查是否成功

  1. [gpadmin@mdw ~]$ ps -ef | grep gpmmon
  2. gpadmin 24206 24197 0 16:03 ? 00:00:01 /usr/local/gpdb-5.6/bin/gpmmon -D /gpdata/gp-5.6/master/gpseg-1/gpperfmon/conf/gpperfmon.conf -p 5432
  3. gpadmin 30123 20766 0 17:40 pts/0 00:00:00 grep gpmmon
  4. [gpadmin@mdw ~]$
  5. [gpadmin@mdw ~]$ psql -d 'gpperfmon' -c 'select * from system_now;'
  6. ctime | hostname | mem_total | mem_used | mem_actual_used | mem_actual_free | swap_total | swap_used | swap_page_in | swap_page_out | cpu_us
  7. er | cpu_sys | cpu_idle | load0 | load1 | load2 | quantum | disk_ro_rate | disk_wo_rate | disk_rb_rate | disk_wb_rate | net_rp_rate | net_wp_rate | net_rb_ra
  8. te | net_wb_rate
  9. ---------------------+----------+------------+-----------+-----------------+-----------------+------------+-----------+--------------+---------------+-------
  10. ---+---------+----------+-------+-------+-------+---------+--------------+--------------+--------------+--------------+-------------+-------------+----------
  11. ---+-------------
  12. 2018-10-16 17:40:30 | mdw | 1968324608 | 831598592 | 120971264 | 1847353344 | 1073737728 | 20869120 | 0 | 0 | 0.
  13. 07 | 0.07 | 99.87 | 0 | 0 | 0 | 15 | 0 | 2 | 0 | 8001 | 8 | 7 | 17
  14. 88 | 1823

确定无误后,就可以安装了

启动安装gpcc

生成安装目录

我下载的是可执行二进制文件。所以直接赋权运行即可。
在这之后,会需要指定一些默认安装目录等信息。不作赘述,按照步骤就可以

  1. [root@mdw gpdata]# ./greenplum-cc-web-3.3.1-LINUX-x86_64.bin
  2. ********************************************************************************
  3. You must read and accept the Pivotal Greenplum Database end user license
  4. agreement before installing
  5. ********************************************************************************
  6. *** IMPORTANT INFORMATION - PLEASE READ CAREFULLY ***
  7. PIVOTAL GREENPLUM DATABASE END USER LICENSE AGREEMENT
  8. IMPORTANT - READ CAREFULLY: This Software contains computer programs and
  9. other proprietary material and information, the use of which is subject to
  10. and expressly conditioned upon acceptance of this End User License
  11. Agreement ("EULA").
  12. This EULA is a legally binding document between you (meaning the person or
  13. the entity that obtained the Software under the terms and conditions of
  14. this EULA, is agreeing to be bound by the terms and conditions of this
  15. EULA, and is referred to below as "You" or "Customer") and Pivotal (meaning
  16. (i) Pivotal Software, Inc., if Customer is located in the United States;
  17. and (ii) the local Pivotal sales subsidiary, if Customer is located in a
  18. country outside the United States in which Pivotal has a local sales
  19. subsidiary; and (iii) GoPivotal International Limited, if Customer is
  20. located in a country outside the United States in which Pivotal does not
  21. ..............

赋予权限

可以看一下生成的一些文件

  1. [root@mdw gpdata]# ls /usr/local/greenplum-cc-web-3.3.1
  2. /usr/local/greenplum-cc-web-3.3.1:
  3. bin etc gpcc_path.sh gp-wlm-1.8.3-x86_64.bin instances lib open_source_licenses_GPCC.txt www

这些文件,需要赋予一些权限,就是gpadmin用户的权限
修改文件的属组

  1. # chown -R gpadmin:gpadmin /usr/local//greenplum-cc-web-3.3.1

加载环境配置文件

  1. #source /usr/local/greenplum-cc-web-3.3.1/gpcc_path.sh

最好是要写在环境变量的环境中的
也需将配置安装目录的bin目录定义到环境变量里,方便后面的安装

分发安装包到所有的子节点

  1. gpccinstall -f all_segs

这里这个命令的all_segs 是写了所有segement节点信息的文件。
如果该命令没有执行成功
也可以用scp直接将安装包拷贝到子目录,但是需要注意权限要赋予。

初始化gpcc

  1. [gpadmin@mdw ~]$ gpcmdr --setup
  2. The instance name identifies the GPDB cluster this Greenplum Command Center web UI monitors and controls.
  3. Instance names can contain letters, digits, and underscores and are not case sensitive.
  4. Please enter the instance name
  5. test
  6. The display name is shown as the "server" in the web interface and does not need to be
  7. a hostname.Display names can contain letters, digits, and underscores and ARE case sensitive.
  8. Please enter the display name for this instance:(Press ENTER to use instance name)
  9. test
  10. A GPCC instance can be set to manage and monitor a remote Greenplum Database.
  11. Is the master host for the Greenplum Database remote? Yy/Nn (default=N)
  12. n
  13. What port does the Greenplum Database use? (default=5432)
  14. Enable kerberos login for this instance? Yy/Nn (default=N)
  15. n
  16. Creating instance schema in GPDB. Please wait ...
  17. The Greenplum Command Center runs a small web server for the UI and web API.
  18. This web server by default runs on port 28080, but you may specify any available port.
  19. What port would you like the new web server to use for this instance? (default=28080)
  20. Users logging in to the Command Center must provide database user
  21. credentials. In order to protect user names and passwords, it is recommended
  22. that SSL be enabled.
  23. Enable SSL for the Web API Yy/Nn (default=N)
  24. Copy the instance to a standby master host Yy/Nn (default=Y)
  25. n
  26. Done writing webserver configuration to /usr/local/greenplum-cc-web/instances/test/webserver/conf/app.conf
  27. Creating instance at /usr/local/greenplum-cc-web/instances/test
  28. Greenplum Command Center UI configuration is now complete.
  29. To change parameters of this instance, edit the configuration file
  30. at /usr/local/greenplum-cc-web/instances/test/webserver/conf/app.conf
  31. To configure multi-cluster view, edit the configuration file at /usr/local/greenplum-cc-web/instances/test/conf/clusters.conf
  32. The web UI for this instance is located at http://mdw:28080
  33. You can now start the web UI for this instance by running: gpcmdr --start test

初始化成功之后就可以启动服务了

  1. [gpadmin@mdw ~]$ gpcmdr --start test
  2. Starting instance test ...
  3. Greenplum Command Center UI for instance 'test' - [RUNNING on PORT: 28080, pid 20836]
  4. [gpadmin@mdw ~]$

登录到web界面

在网站中输入IP地址+端口号
如192.168.2.61:28080

直接就可以到达登录界面

这里就可以登录了。账户是个gpmon密码是在创建这个用户时的设置的密码,这里是123456

输入点击,就可以了

登录进来后可以看到界面

致此:
greenplum-cc-web安装完成

本站文章,未经作者同意,请勿转载,如需转载,请邮件customer@csudata.com.
2 评论  
userImg
lxcos · 2L · 2018-10-19 19:47:25

评论加一

userImg
lxcos · 1L · 2018-10-19 18:02:56

加个微信请教一下

添加一条新评论