Centos6系统安装gpperfmon-cc-web监控

前端之家收集整理的这篇文章主要介绍了Centos6系统安装gpperfmon-cc-web监控前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

部分转载自:MangoCool


!!!商业版的Greenplum才能配合安装gpperfmon-cc-web,这次成功了!

!!!推荐用gpadmin用户安装,遇到没有文件权限的问题,授予该用户相应权限。避免root安装,再逐文件授予权限给gpadmin。

启用收集系统代理:

1、首先用gpadmin用户登录

$ su - gpadmin

2、在master主机上执行source:

?
$ source /usr/local/greenplum-db/greenplum_path.sh
3、使用gpperfmon_install命令,安装后会建立gpperfmon数据库,默认用户gpmon:
$ gpperfmon_install --enable --password gpmon --port 5432

4、重启数据库

$ gpstop -r
5、使用ps命令检查数据收集进程是否运行:
$ ps -ef | grep gpmmon
6、执行命令检查数据收集进程是否写入命令中心数据库
$ psql gpperfmon -c 'SELECT * FROM system_now;'


配置standby master主机:

1、复制$MASTER_DATA_DIRECTORY/pg_hba.conf 文件从你的master主机到standby主机:

$ gpscp -h smdw /home/gpamdin/masterdata/gpseg-1/pg_hba.conf =:$MASTER_DATA_DIRECTORY/
2、 复制 ~/.pgpass 文件从你的master主机到standby主机:

$ gpscp -h smdw ~/.pgpass =:~/
注:.pgpass 权限必须要设置成600。

正式安装Greenplum Command Center Console:

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访问权限;或者修改/usr/local路径gpadmin用户的访问权限,再直接用gpadmin用户安装(推荐)

安装过程中可根据提示作出自己的选择和修改,首先得接受pivotal的协议。

我的安装过程如下:

3、使环境变量生效,执行source:
vi ~/.bashrc
source /home/greenplum-4.3/greenplum_path .sh
source /home/greenplum-4.3-cc/gpcc_path .sh
source ~/.bashrc

4、用gpadmin用户,执行gpccinstall 命令安装Command Center到所有的主机上:

$ gpccinstall -f all_hosts

5、将 .bashrc文件复制到其他主机上(包括standby),并使其生效:

?
@H_576_301@
$ gpscp -f /opt/greenplum/conf/standy_and_seglist ~/.bashrc =:~/
$ gpssh -f /opt/greenplum/conf/hostlist 'source ~/.bashrc'

设置Command Center环境(可略过):

1、添加GPPERFMONHOME 环境变量到~/.bashrc:

GPPERFMONHOME=/usr/local/greenplum-cc-web-2.0.0-build-32
source $GPPERFMONHOME/gpcc_path.sh

2、保存和source.bashrc:

$ source ~/.bashrc

设置Command Center控制台实例:

1、添加访问权限

pg_hba.conf中添加

host all all ::1/128 trust
否则, 可能会遇到报错:FATAL: no pg_hba.conf entry for host "::1"

2、创建 Command Center 实例:

以下是我的设置,可以根据自己的实际情况设置:

[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 athttp://mdw:28080/
You can now start the web UI for this instance by running: gpcmdr --start gpmon
No instances

设置成功,这是提示信息告诉你可以通过地址http://mdw.28080访问了。服务名:linux1024,用户gpmon,密码我没有,登录时随便填。


期间,可能报错:ERROR: relation "gp_toolkit.__gp_log_master_ext" does not exist,数据库gppfermon中gp_toolkit schema中无内容,可能是template0,1中的gp_toolkit内容丢失;没办法,手动补:
psql -f $GPHOME/share/postgresql/gp_toolkit.sql gpperfmon

登录成功:

猜你在找的CentOS相关文章