1 基本准备
- 在GreenplumMaster节点操作:
-
- 1) 使用gpadmin用户登录
- linux116:~# su - gpadmin
-
- 2) 执行 gpperfmon_install 命令
- gpadmin@linux116:~> gpperfmon_install--enable --password 1qaz2wsx --port 5432
- 命令执行后,会创建gpmon角色,以及设置了密码,这个用户可以登录到数据库里面,也可用于登录页面。
-
3) 重启greenplum 数据库
gpadmin@linux116:~> gpstop -r
4) 查看gpmon进程,是否已经启用
gpadmin@linux116:~> ps -ef | grep gpmmon |grep -v grep
gpadmin 27036 27027 0 16:18 ? 00:00:00/usr/local/greenplum-db/bin/gpmmon -D /data/master/gpseg-1/gpperfmon/conf/gpperfmon.conf-p 5432
5) 查看数据收集进程是否正常(需要等大约30s左右才可以查看到)
gpadmin@linux116:~> psql gpperfmon -c 'SELECT* FROM system_now;'
ctime | hostname | mem_total | mem_used | mem_actual_used | mem_actual_free |swap_total | swap_used | swap_page_in |swap_page_out | cpu_user | 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_rate |net_wb_rate
---------------------+----------+-------------+-------------+-----------------+-----------------+-------------+-----------+--------------+---------------+----------+---------+----
------+-------+-------+-------+---------+--------------+--------------+--------------+--------------+-------------+-------------+-------------+-------------
2014-05-19 16:21:30 | linux113| 25202618368 | 21777362944 | 7865163776 | 17337454592| 2154979328 | 23846912 | 0 | 0 | 1.68 | 1.89 |
96.18 | 0.07 | 0.08 | 0.09 | 15 | 0 | 13 | 0 | 135518 | 13 | 15 | 1776 | 2110
2014-05-19 16:21:30 | linux116| 25202618368 | 17788657664 | 2744700928 | 22457917440| 2154979328 | 22982656 | 0 | 0 | 0.71 | 0.22 |
98.56 | 0.1 | 0.16 | 0.06 | 15 | 0 | 7 | 0 | 84269 | 51 | 54 | 11435 | 32212
2014-05-19 16:21:30 | NOAS252 | 50609725440 | 40639737856 | 9263038464 | 41346686976 | 25777983488 | 0 | 0 | 0 | 1.61 | 1.84 |
96.32 | 0.39 | 0.42 | 0.36 | 15 | 0 | 46 | 0 | 454920 | 80 | 75 | 204981 | 183732
(3 rows)
下面配置GreenplumStandby Master节点:
在primarymaster上面执行:
1) 将primary master上面的$MASTER_DATA_DIRECTORY/pg_hba.conf拷贝到standby master的$MASTER_DATA_DIRECTORY/pg_hba.conf
gpadmin@linux116:~> scp $MASTER_DATA_DIRECTORY/pg_hba.confgpadmin@linux113:$MASTER_DATA_DIRECTORY/pg_hba.conf
2) 将primary master上面的~/.pgpass拷贝到standby master的~/.pgpass,并且文件权限修改为0600
gpadmin@linux116:~> scp ~/.pgpass gpadmin@linux113:~/.pgpass
gpadmin@linux116:~> ssh gpadmin@linux113 -C "chmod 0600~/.pgpass"
2 下载安装
- 1、下载地址:
-
- 官网下载:https://network.pivotal.io/products/pivotal-gpdb#/releases/1533/file_groups/26
-
- 云盘下载:http://pan.baidu.com/s/1hqZU72W
-
- 2、解压安装:
-
- 这里我以greenplum-cc-web-2.0.0为例:
- $ unzip greenplum-cc-web-2.0.0-build-32-RHEL5-x86_64.zip
- $ ./greenplum-cc-web-2.0.0-build-32-RHEL5-x86_64.bin
- 注:因为默认安装路径是/usr/local,避免权限问题,可以先用root安装,再修改成gpadmin访问权限。
-
- 安装过程中可根据提示作出自己的选择和修改,首先得接受pivotal的协议。
3、使环境变量生效,执行source:
$ source /usr/local/greenplum-cc-web/gpcc_path.sh
4 添加 GPPERFMONHOME 环境变量到gpadmin的~/.bashrc:
GPPERFMONHOME=/usr/local/greenplum-cc-web-2.0.0-build-32
source $GPPERFMONHOME/gpcc_path.sh
5.生效:
source ./bashrc
6.执行 gpccinstall 命令安装 Command Center 到所有的主机上:
[root@RZ-PROD-DB-G7-02 dbbak]# gpccinstall -f all_hosts
3 开始安装
- 以下是我的设置,可以根据自己的实际情况设置:
- [gpadmin@mdw ~]$ gpcmdr --setup
-
- An instance name is used by the Greenplum Command Center as
- a way to uniquely identify a Greenplum Database that has the monitoring
- components installed and configured. This name is also used to control
- specific instances of the Greenplum Command Center web UI. Instance names
- can contain letters, digits and underscores and are not case sensitive.
-
- Please enter a new instance name:
- > gpmon
- The web component of the Greenplum Command Center can connect to a
- monitor database on a remote Greenplum Database.
-
-
- Is the master host for the Greenplum Database remote? Yy|Nn (default=N):
- > n
- The display name is shown in the web interface and does not need to be
- a hostname.
-
-
- What would you like to use for the display name for this instance:
- > linux1024
- What port does the Greenplum Database use? (default=5432):
- >
- Creating instance schema in GPDB. Please wait ...
- The display name is shown in the web interface and does not need to be
- a hostname.
-
-
-
- Would you like to install workload manager? Yy|Nn (default=N):
- > n
- Skipping installation of workload manager.
- The Greenplum Command Center runs a small web server for the UI and web API.
- This web server by default runs on port 28080, but you may specify any available port.
-
- What port would you like the web server to use for this instance? (default=28080):
- >
- Users logging in to the Command Center must provide database user
- credentials. In order to protect user names and passwords, it is recommended
- that SSL be enabled.
-
-
- Do you want to enable SSL for the Web API Yy|Nn (default=N):
- >
-
- Do you want to enable ipV6 for the Web API Yy|Nn (default=N):
- >
-
- Do you want to enable Cross Site Request Forgery Protection for the Web API Yy|Nn (default=N):
- >
-
- Do you want to copy the instance to a standby master host Yy|Nn (default=Y):
- > n
-
- Done writing lighttpd configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/lighttpd.conf
- Done writing web UI configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/gpperfmonui.conf
- Done writing web UI clustrs configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/clusters.conf
-
- Greenplum Command Center UI configuration is now complete. If
- at a later date you want to change certain parameters, you can
- either re-run 'gpcmdr --setup' or edit the configuration file
- located at /usr/local/greenplum-cc-web/./instances/gpmon/conf/gpperfmonui.conf.
-
- The web UI for this instance is available at http://mdw:28080/
-
- You can now start the web UI for this instance by running: gpcmdr --start gpmon 安装完后启动!
- No instances
- 期间你可能会遇到报错:FATAL: no pg_hba.conf entry for host "::1"
- 解决办法:
- 在pg_hba.conf中添加:
- host all all ::1/128 trust
- 解决办法:
-
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29096438/viewspace-2144641/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29096438/viewspace-2144641/