MongoDB Ops Manager(MMS)是用於監控和備份MongoDB的基礎設施服務。其中監控的服務是免費的,備份的服務是須要收費的。本文以最新的4.0.1爲例,介紹如何安裝配置MongoDB Ops Manager服務。web
[root@hdp04 ~]# yum -y install mongodb-org.x86_64 mongodb-org-mongos.x86_64 mongodb-org-shell.x86_64 mongodb-org-tools.x86_64 mongodb-org-server.x86_64
建立MongoDB的配置文件以下:mongodb
[root@hdp04 ~]# vi /etc/mongod.conf systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log storage: dbPath: /var/lib/mongo journal: enabled: true processManagement: fork: true # fork and run in background pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfo net: port: 27017 bindIp: 0.0.0.0
啓動MongoDB服務:shell
[root@hdp04 ~]# systemctl start mongod [root@hdp04 ~]# systemctl status mongod ● mongod.service - MongoDB Database Server Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2018-08-21 11:43:23 CST; 2h 38min ago Docs: https://docs.mongodb.org/manual Main PID: 29211 (mongod) CGroup: /system.slice/mongod.service └─29211 /usr/bin/mongod -f /etc/mongod.conf Aug 21 11:43:21 hdp04 systemd[1]: Starting MongoDB Database Server... Aug 21 11:43:22 hdp04 mongod[29208]: 2018-08-21T11:43:22.052+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' Aug 21 11:43:22 hdp04 mongod[29208]: about to fork child process, waiting until server is ready for connections. Aug 21 11:43:22 hdp04 mongod[29208]: forked process: 29211 Aug 21 11:43:23 hdp04 mongod[29208]: child process started successfully, parent exiting Aug 21 11:43:23 hdp04 systemd[1]: Started MongoDB Database Server.
[root@hdp04 ~]# yum -y install mongodb-mms.x86_64 [root@hdp04 ~]# vi /opt/mongodb/mms/conf/conf-mms.properties #根據實際狀況修改mongodb的地址 mongo.mongoUri=mongodb://127.0.0.1:27017/?maxPoolSize=150 mongo.ssl=false
安裝配置完成後,啓動服務,默認的端口是8080:app
[root@hdp04 conf]# /etc/init.d/mongodb-mms start Generating new Ops Manager private key... Starting pre-flight checks Successfully finished pre-flight checks Migrate Ops Manager data Running migrations...[ OK ] Start Ops Manager server Instance 0 starting......................[ OK ] Starting pre-flight checks Successfully finished pre-flight checks Start Backup Daemon...[ OK ] [root@hdp04 conf]# netstat -antpl|grep 8080 tcp6 0 0 :::8080 :::* LISTEN 10494/mms-app
3.1 打開Ops管理界面
經過服務ops的8080端口,便可打開web管理界面,以下圖所示:
3.2 註冊管理員帳號
3.3 設置Web Server和Email
設置Web Server和Email,其餘的默認便可,以下圖所示:
3.4 設置用戶認證方式
這裏使用默認的application database,以下圖:
3.5 備份快照設置
使用默認的設置便可,以下圖:
curl
依次點擊Agents->Download & Settings, 會出現全部的代理信息,如圖所示:
根據實際需求選擇代理類型,這裏使用Automation代理。環境的操做系統是Oracle Linux 7,因此點擊Centos 7對應的rpm鏈接,彈出安裝操做步驟:
安裝提示,依次在各個節點安裝配置,以hdp06爲例,以下:tcp
[root@hdp06 ~]# curl -OL http://192.168.120.99:8080/download/agent/automation/mongodb-mms-automation-agent-manager-5.4.9.5483-1.x86_64.rhel7.rpm [root@hdp06 ~]# yum -y localinstall mongodb-mms-automation-agent-manager-5.4.9.5483-1.x86_64.rhel7.rpm [root@hdp06 ~]# vi /etc/mongodb-mms/automation-agent.config mmsBaseUrl=http://192.168.120.99:8080 mmsGroupId=5b7b8bf6dd601873cb8ea94d mmsApiKey=5b7b94f0dd601873cb8eb08e7890df416e37a186bcd77e40235210b6
須要說明的是配置文件中的mmsGroupId和mmsApiKey兩個選項。mmsGroupId使用彈出的代理安裝手冊的值,而mmsApiKey須要點擊代理安裝手冊中的√Key Generated方可生成。編輯完配置文件後啓動代理服務:ide
[root@hdp06 ~]# systemctl start mongodb-mms-automation-agent.service [root@hdp06 ~]# systemctl status mongodb-mms-automation-agent.service
待全部的代理安裝配置完成後,會在web管理界面看到,以下圖所示:
url
點擊下圖紅色箭頭所指的連接:
在下圖中輸入任意一節點的主機名以及端口號,點擊continue,以下圖:
按照圖中提示,一步一步往下操做便可導入。最終的結果以下所示:
操作系統