標籤:doc 提示 啟動 mail linux 免費 led slice water
MongoDB Ops Manager(MMS)是用於監控和備份MongoDB的基礎設施服務。其中監控的服務是免費的,備份的服務是需要收費的。本文以最新的4.0.1為例,介紹如何安裝配置MongoDB Ops Manager服務。
1、安裝並配置MongoDB服務
[[email protected] ~]# 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的設定檔如下:
[[email protected] ~]# vi /etc/mongod.confsystemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.logstorage: dbPath: /var/lib/mongo journal: enabled: trueprocessManagement: fork: true # fork and run in background pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfonet: port: 27017 bindIp: 0.0.0.0
啟動MongoDB服務:
[[email protected] ~]# systemctl start mongod[[email protected] ~]# 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.confAug 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: 29211Aug 21 11:43:23 hdp04 mongod[29208]: child process started successfully, parent exitingAug 21 11:43:23 hdp04 systemd[1]: Started MongoDB Database Server.
2、安裝MongoDB Ops Manager
[[email protected] ~]# yum -y install mongodb-mms.x86_64[[email protected] ~]# vi /opt/mongodb/mms/conf/conf-mms.properties#根據實際情況修改mongodb的地址mongo.mongoUri=mongodb://127.0.0.1:27017/?maxPoolSize=150mongo.ssl=false
安裝配置完成後,啟動服務,預設的連接埠是8080:
[[email protected] conf]# /etc/init.d/mongodb-mms startGenerating new Ops Manager private key...Starting pre-flight checksSuccessfully finished pre-flight checksMigrate Ops Manager data Running migrations...[ OK ]Start Ops Manager server Instance 0 starting......................[ OK ]Starting pre-flight checksSuccessfully finished pre-flight checksStart Backup Daemon...[ OK ][[email protected] conf]# netstat -antpl|grep 8080tcp6 0 0 :::8080 :::* LISTEN 10494/mms-app
3、配置MongoDB Ops Manager
3.1 開啟Ops管理介面
通過服務ops的8080連接埠,即可開啟web管理介面,如所示:
3.2 註冊管理員帳號
3.3 設定Web Server和Email
設定Web Server和Email,其他的預設即可,如所示:
3.4 設定使用者認證方式
這裡使用預設的application database,如:
3.5 備份快照設定
使用預設的設定即可,如:
4、配置MongoDB Ops Manager Agent
依次點擊Agents->Download & Settings, 會出現所有的代理資訊,:
根據實際需求選擇代理類型,這裡使用Automation代理。環境的作業系統是Oracle Linux 7,所以點擊Centos 7對應的rpm串連,彈出安裝操作步驟:
安裝提示,依次在各個節點安裝配置,以hdp06為例,如下:
[[email protected] ~]# 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[[email protected] ~]# yum -y localinstall mongodb-mms-automation-agent-manager-5.4.9.5483-1.x86_64.rhel7.rpm [[email protected] ~]# vi /etc/mongodb-mms/automation-agent.configmmsBaseUrl=http://192.168.120.99:8080mmsGroupId=5b7b8bf6dd601873cb8ea94dmmsApiKey=5b7b94f0dd601873cb8eb08e7890df416e37a186bcd77e40235210b6
需要說明的是設定檔中的mmsGroupId和mmsApiKey兩個選項。mmsGroupId使用彈出的代理安裝手冊的值,而mmsApiKey需要點擊代理安裝手冊中的√Key Generated方可產生。編輯完設定檔後啟動代理服務:
[[email protected] ~]# systemctl start mongodb-mms-automation-agent.service[[email protected] ~]# systemctl status mongodb-mms-automation-agent.service
待所有的代理安裝配置完成後,會在web管理介面看到,如所示:
5、監控現有的Sharding Cluster服務
點擊紅色箭頭所指的連結:
在中輸入任意一節點的主機名稱以及連接埠號碼,點擊continue,如:
按照圖中提示,一步一步往下操作即可匯入。最終的結果如下所示:
MongoDB Ops Manager 部署指南