安裝 Greenplum-CC-web 監控工具
文章目錄
概述
greenplum的一個web介面的監控系統。可以監控資料庫的一些狀態,節點資訊
下載
下載greenplum cc的方法有限,我的途徑是通過
這個網站,可以下載對應版本的grennplum cc。ps:需要相應的賬號
安裝前準備
安裝gpperfmon資料庫,以及為gpmon使用者建立密碼
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檔案,增加如下資訊:
local gpperfmon gpmon md5 host all gpmon 127.0.0.1/28 md5
重啟資料庫
gpstop -r
檢查是否成功
[[email protected] ~]$ ps -ef | grep gpmmon
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
gpadmin 30123 20766 0 17:40 pts/0 00:00:00 grep gpmmon
[[email protected] ~]$
[[email protected] ~]$ psql -d '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_us
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
te | net_wb_rate
---------------------+----------+------------+-----------+-----------------+-----------------+------------+-----------+--------------+---------------+-------
---+---------+----------+-------+-------+-------+---------+--------------+--------------+--------------+--------------+-------------+-------------+----------
---+-------------
2018-10-16 17:40:30 | mdw | 1968324608 | 831598592 | 120971264 | 1847353344 | 1073737728 | 20869120 | 0 | 0 | 0.
07 | 0.07 | 99.87 | 0 | 0 | 0 | 15 | 0 | 2 | 0 | 8001 | 8 | 7 | 17
88 | 1823
確定無誤後,就可以安裝了
啟動安裝gpcc
生成安裝目錄
我下載的是可執行二進位制檔案。所以直接賦權執行即可。
在這之後,會需要指定一些預設安裝目錄等資訊。不作贅述,按照步驟就可以
[[email protected] gpdata]# ./greenplum-cc-web-3.3.1-LINUX-x86_64.bin
********************************************************************************
You must read and accept the Pivotal Greenplum Database end user license
agreement before installing
********************************************************************************
*** IMPORTANT INFORMATION - PLEASE READ CAREFULLY ***
PIVOTAL GREENPLUM DATABASE END USER LICENSE AGREEMENT
IMPORTANT - READ CAREFULLY: This Software contains computer programs and
other proprietary material and information, the use of which is subject to
and expressly conditioned upon acceptance of this End User License
Agreement ("EULA").
This EULA is a legally binding document between you (meaning the person or
the entity that obtained the Software under the terms and conditions of
this EULA, is agreeing to be bound by the terms and conditions of this
EULA, and is referred to below as "You" or "Customer") and Pivotal (meaning
(i) Pivotal Software, Inc., if Customer is located in the United States;
and (ii) the local Pivotal sales subsidiary, if Customer is located in a
country outside the United States in which Pivotal has a local sales
subsidiary; and (iii) GoPivotal International Limited, if Customer is
located in a country outside the United States in which Pivotal does not
..............
賦予許可權
可以看一下生成的一些檔案
[[email protected] gpdata]# ls /usr/local/greenplum-cc-web-3.3.1
/usr/local/greenplum-cc-web-3.3.1:
bin etc gpcc_path.sh gp-wlm-1.8.3-x86_64.bin instances lib open_source_licenses_GPCC.txt www
這些檔案,需要賦予一些許可權,就是gpadmin使用者的許可權
修改檔案的屬組
# chown -R gpadmin:gpadmin /usr/local//greenplum-cc-web-3.3.1
載入環境配置檔案
#source /usr/local/greenplum-cc-web-3.3.1/gpcc_path.sh
最好是要寫在環境變數的環境中的
也需將配置安裝目錄的bin目錄定義到環境變數裡,方便後面的安裝
分發安裝包到所有的子節點
gpccinstall -f all_segs
這裡這個命令的all_segs 是寫了所有segement節點資訊的檔案。
如果該命令沒有執行成功
也可以用scp直接將安裝包拷貝到子目錄,但是需要注意許可權要賦予。
初始化gpcc
[[email protected] ~]$ gpcmdr --setup
The instance name identifies the GPDB cluster this Greenplum Command Center web UI monitors and controls.
Instance names can contain letters, digits, and underscores and are not case sensitive.
Please enter the instance name
test
The display name is shown as the "server" in the web interface and does not need to be
a hostname.Display names can contain letters, digits, and underscores and ARE case sensitive.
Please enter the display name for this instance:(Press ENTER to use instance name)
test
A GPCC instance can be set to manage and monitor a remote Greenplum Database.
Is the master host for the Greenplum Database remote? Yy/Nn (default=N)
n
What port does the Greenplum Database use? (default=5432)
Enable kerberos login for this instance? Yy/Nn (default=N)
n
Creating instance schema in GPDB. Please wait ...
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 new 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.
Enable SSL for the Web API Yy/Nn (default=N)
Copy the instance to a standby master host Yy/Nn (default=Y)
n
Done writing webserver configuration to /usr/local/greenplum-cc-web/instances/test/webserver/conf/app.conf
Creating instance at /usr/local/greenplum-cc-web/instances/test
Greenplum Command Center UI configuration is now complete.
To change parameters of this instance, edit the configuration file
at /usr/local/greenplum-cc-web/instances/test/webserver/conf/app.conf
To configure multi-cluster view, edit the configuration file at /usr/local/greenplum-cc-web/instances/test/conf/clusters.conf
The web UI for this instance is located at http://mdw:28080
You can now start the web UI for this instance by running: gpcmdr --start test
初始化成功之後就可以啟動服務了
[[email protected] ~]$ gpcmdr --start test
Starting instance test ...
Greenplum Command Center UI for instance 'test' - [RUNNING on PORT: 28080, pid 20836]
[[email protected] ~]$
登入到web介面
在網站中輸入IP地址+埠號
如192.168.2.61:28080
直接就可以到達登入介面
這裡就可以登入了。賬戶是個gpmon密碼是在建立這個使用者時的設定的密碼,這裡是123456
輸入點選,就可以了
登入進來後可以看到介面
致此:
greenplum-cc-web安裝完成