【GP】greenplum監控軟體Greenplum-cc-web的安裝

小亮520cl發表於2017-09-07

1 基本準備

  1. 在GreenplumMaster節點操作:
  2.    
  3.    1) 使用gpadmin使用者登入
  4.     linux116:~# su - gpadmin
  5.    
  6.    2) 執行 gpperfmon_install 命令
  7.    gpadmin@linux116:~> gpperfmon_install--enable --password 1qaz2wsx --port 5432
  8. 命令執行後,會建立gpmon角色,以及設定了密碼,這個使用者可以登入到資料庫裡面,也可用於登入頁面。
  9.      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. 1、下載地址:

  2. 官網下載:https://network.pivotal.io/products/pivotal-gpdb#/releases/1533/file_groups/26

  3. 雲盤下載:http://pan.baidu.com/s/1hqZU72W

  4. 2、解壓安裝:

  5. 這裡我以greenplum-cc-web-2.0.0為例:
  6. $ unzip greenplum-cc-web-2.0.0-build-32-RHEL5-x86_64.zip
  7. $ ./greenplum-cc-web-2.0.0-build-32-RHEL5-x86_64.bin
  8. 注:因為預設安裝路徑是/usr/local,避免許可權問題,可以先用root安裝,再修改成gpadmin訪問許可權

  9. 安裝過程中可根據提示作出自己的選擇和修改,首先得接受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 開始安裝

  1. 以下是我的設定,可以根據自己的實際情況設定:
  2. [gpadmin@mdw ~]$ gpcmdr --setup
  3.  
  4. An instance name is used by the Greenplum Command Center as
  5. a way to uniquely identify a Greenplum Database that has the monitoring
  6. components installed and configured. This name is also used to control
  7. specific instances of the Greenplum Command Center web UI. Instance names
  8. can contain letters, digits and underscores and are not case sensitive.
  9.  
  10. Please enter a new instance name:
  11. > gpmon
  12. The web component of the Greenplum Command Center can connect to a
  13. monitor database on a remote Greenplum Database.
  14.  
  15.  
  16. Is the master host for the Greenplum Database remote? Yy|Nn (default=N):
  17. > n
  18. The display name is shown in the web interface and does not need to be
  19. a hostname.
  20.  
  21.  
  22. What would you like to use for the display name for this instance:
  23. > linux1024
  24. What port does the Greenplum Database use? (default=5432):
  25. >
  26. Creating instance schema in GPDB. Please wait ...
  27. The display name is shown in the web interface and does not need to be
  28. a hostname.
  29.  
  30.  
  31.  
  32. Would you like to install workload manager? Yy|Nn (default=N):
  33. > n
  34. Skipping installation of workload manager.
  35. The Greenplum Command Center runs a small web server for the UI and web API.
  36. This web server by default runs on port 28080, but you may specify any available port.
  37.  
  38. What port would you like the web server to use for this instance? (default=28080):
  39. >
  40. Users logging in to the Command Center must provide database user
  41. credentials. In order to protect user names and passwords, it is recommended
  42. that SSL be enabled.
  43.  
  44.  
  45. Do you want to enable SSL for the Web API Yy|Nn (default=N):
  46. >
  47.  
  48. Do you want to enable ipV6 for the Web API Yy|Nn (default=N):
  49. >
  50.  
  51. Do you want to enable Cross Site Request Forgery Protection for the Web API Yy|Nn (default=N):
  52. >
  53.  
  54. Do you want to copy the instance to a standby master host Yy|Nn (default=Y):
  55. > n
  56.  
  57. Done writing lighttpd configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/lighttpd.conf
  58. Done writing web UI configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/gpperfmonui.conf
  59. Done writing web UI clustrs configuration to /usr/local/greenplum-cc-web/./instances/gpmon/conf/clusters.conf
  60.  
  61. Greenplum Command Center UI configuration is now complete. If
  62. at a later date you want to change certain parameters, you can
  63. either re-run 'gpcmdr --setup' or edit the configuration file
  64. located at /usr/local/greenplum-cc-web/./instances/gpmon/conf/gpperfmonui.conf.
  65.  
  66. The web UI for this instance is available at http://mdw:28080/
  67.  
  68. You can now start the web UI for this instance by running: gpcmdr --start gpmon   安裝完後啟動!
  69. No instances  

  1. 期間你可能會遇到報錯:FATAL: no pg_hba.conf entry for host "::1"
    1. 解決辦法:
    2. 在pg_hba.conf中新增:    
    3. host all all ::1/128 trust




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29096438/viewspace-2144641/,如需轉載,請註明出處,否則將追究法律責任。

相關文章