OpsManager管理MongoDB
|
mydb1 |
Ops Manager,mongodb,agent |
|
mydb2 |
mongodb,agent |
|
mydb3 |
mongodb,agent |
NUMA Settings
sysctl -w vm.zone_reclaim_mode=0
NTP Settings
yum install -y ntp/etc/init.d/ntpd start
Turn off Atime
vim /etc/fstab/dev/mapper/VolGroup-lv_data /data ext4 defaults,noatime,nodiratime 1 1
ulimt settings
ulimit -a
修改/etc/security/limits.conf
mongod soft nproc 65535
mongod hard nproc 65535
Disable Transparent Huge Pages
通过启动脚本可以在每次启动时关闭THP
vim /etc/init.d/disable-transparent-hugepages
#以下为脚本内容
#!/bin/bash
### BEGIN INIT INFO
# Provides: disable-transparent-hugepages
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: mongod mongodb-mms-automation-agent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Disable Linux transparent huge pages
# Description: Disable Linux transparent huge pages, to improve
# database performance.
### END INIT INFO
case $1 in
start)
if [ -d /sys/kernel/mm/transparent_hugepage ]; then
thp_path=/sys/kernel/mm/transparent_hugepage
elif [ -d /sys/kernel/mm/redhat_transparent_hugepage ]; then
thp_path=/sys/kernel/mm/redhat_transparent_hugepage
else
return 0
fi
echo 'never' > ${thp_path}/enabled
echo 'never' > ${thp_path}/defrag
re='^[0-1]+$'
if [[ $(cat ${thp_path}/khugepaged/defrag) =~ $re ]]
then
# RHEL 7
echo 0 > ${thp_path}/khugepaged/defrag
else
# RHEL 6
echo 'no' > ${thp_path}/khugepaged/defrag
fi
unset re
unset thp_path
;;esac
检查是否生效
cat /sys/kernel/mm/transparent_hugepage/enabledcat /sys/kernel/mm/transparent_hugepage/defrag
#有以下输出表示正确
always madvise [never]
1、Install the Ops Manager Application Database
Ops Manager需要先安装mongodb,创建其数据库副本集后才能部署安装。
官方的yum源比较慢,推荐使用阿里云yum源
# 阿里云repo
cat > /etc/yum.repos.d/mongodb-org-3.4.repo << EOF
[mongodb-org-3.4]
name=MongoDB Repository
#baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
baseurl=https://mirrors.aliyun.com/mongodb/yum/redhat/\$releasever/mongodb-org/3.4/x86_64/
gpgcheck=0
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF
安装mongod
在每台节点上执行以下步骤
yum install -y mongodb-org
修改配置
vim /etc/mongod.conf
#修改为数据分区,需创建该目录,并确保mongod用户可读写
# Where and how to store data.
storage:
dbPath: /data/mongo
journal:
enabled: true
#默认监听本地lo,注释掉
# network interfaces
net:
port: 27017
# bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
启动服务
mkdir -p /data/mongo
chown -R mongod:mongod /data
systemctl start mongod.service
部署Ops Manager副本集
通过修改配置文件的方式创建Ops Manager所需副本集。
注:也可以通过命令行方式指定副本集启动。修改配置文件的方式便于通过init script管理。
在所有节点上修改配置
vim mongod.conf
#添加以下内容
replication:
replSetName: rs_ops_manager
#重启生效
systemctl start mongod.service
在任一节点上执行mongo shell,添加副本集节点,此处使用node1节点
mongo --host localhost --port 27017
#Initiate the replica set
rs.initiate()
#display the replica set configuration object
rs.conf()
#Add the remaining members to the replica set
rs.add("mydb2")
rs.add("mydb3")
#Check the status of the replica set
rs.status()
2、Install Ops Manager
#下载安装wget -c https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-3.4.15.646-1.x86_64.rpm
rpm -ivh mongodb-mms-<version>.x86_64.rpm
Configure the Ops Manager connection to the Ops Manager Application Database
vim /opt/mongodb/mms/conf/conf-mms.properties
#设置mongo.mongoUri
mongo.mongoUri=mongodb://mydb1:27017,mydb2:27017,mydb3:27017/?replicaSet=rs_ops_manager
/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 ]
Open the Ops Manager home page and register the first user.
- http://<host>:8080
- Click the Register link and follow the prompts to register the first user and create the first group. The first user is automatically assigned the Global Owner role.
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,Monitoring,Backup。环境的操作系统是Oracle Linux 7,所以点击Centos 7对应的rpm连接,弹出安装操作步骤:






待所有的代理安装配置完成后,会在web管理界面看到,如下图所示:

5、通过Ops Manager自动化部署repl和shard集群




Create or Import a MongoDB Deployment
Manage Deployments
Alerts and Monitoring
Back Up and Restore Deployments
https://www.cnblogs.com/wsl222000/p/6742504.html
https://www.iyunv.com/thread-385560-1-1.html
https://blog.51cto.com/candon123/2162461
http://www.mamicode.com/info-detail-2420298.html
OpsManager管理MongoDB的更多相关文章
- docker之安装和管理mongodb
前言 折腾一些使用docker来配置和管理mongodb和mongodb集群. 安装mongodb 从docker网站拉取mongodb镜像 docker search mongo # 选择一个版本 ...
- MongoDB用户,角色管理 --- MongoDB基础用法(三)
用户管理 用户创建 MongoDB采用基于角色的访问控制(RBAC)来确定用户的访问. 授予用户一个或多个角色,确定用户对MongoDB资源的访问权限和用户可以执行哪些操作. 用户应该只有最小权限集才 ...
- 如何管理MongoDB的用户和权限
管理用户的创建及使用 创建用户的函数是db.createUser({...}),创建用户时通常需要为该用户添加权限,如read.readWrite权限. 可添加的权限以及说明: 权限 作用 read ...
- 管理 MongoDB 用户和权限
创建用户 创建用户的函数是:db.createUser(). 创建用户时,需要为该用户添加权限.可添加的权限以及说明: 权限 作用 read 允许用户读取指定数据库. readWrite 允许用户读写 ...
- 使用mongo-express管理mongodb数据库
前面的话 本文将详细介绍一款用nodejs开发的基于Web的mongodb数据库管理工具mongo-express 安装 首先,全局安装 mongo-express 包 npm install -g ...
- 使用RockMongo管理MongoDB
http://blog.csdn.net/mydeman/article/details/7082730
- 【技术课堂】如何管理MongoDB数据库?
- 技术课堂】如何管理MongoDB数据库?
- 使用Robo 3T 软件管理MongoDB数据库如何执行命令行shell
比如使用命令行的方式查看数据库runoobdb中的sites集合(数据表)中的所有数据 1.在连接名的地方鼠标右键选择“open shell” 2.在出现的shell窗口中输入一下命令行,然后按ctr ...
随机推荐
- 注解之 @RestController 和 @RequestMapping
Controller 是 Spring 中最基本的组件,主要处理用户交互,一般每个业务逻辑都会有一个 Controller,供用户请求接口进行数据访问:@RequestMapping 注解用于绑定UR ...
- linux密码忘记的处理步骤
linux忘记密码 centos7忘记密码如何解决?进入到单用户模式下去修改root密码step 1:开机时按住向下箭头,选择第一个,按住e进入gurb界面:step 2:在编辑模式下找ro 修改为 ...
- Undertow
Spring Boot 内嵌容器Undertow参数设置 配置项: # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 # 不要设置过大,如果过大,启动 ...
- vfork与fork的区别
vfork()用法与fork()相似,但是也有区别,具体区别归结为以下3点: 1. fork():子进程拷贝父进程的数据段,代码段.vfork():子进程与父进程共享数据段. 2. fork():父子 ...
- 以太坊联盟链 parity 节点搭建
https://www.cnblogs.com/sumingk/articles/9097996.html 上一篇文章介绍了以太坊私有链 geth节点的搭建,本篇介绍下企业级应用 联盟链搭建,运用pa ...
- CloudFlare 新手入门中文教程
loudFlare成立于2009年,是国外著名的免费CDN网站加速服务公司,CloudFlare 还提供实时安全保护服务和网络优化等,采用的是免费+增值模式,可以免费使用,也有收费服务.国内也有很多免 ...
- ARP Poisoning Attack and Mitigation Techniques ARP欺骗 中间人攻击 Man-In-The-Middle (MITM) attack 嗅探 防范 Can one MAC address have two different IP addresses within the network?
小结: 1. ARP缓存投毒,窃听中毒者之间的通信: 2. ARP Poisoning Attack and Mitigation Techniques - Ciscohttps://www.cisc ...
- layer快速点击会触发多次回调
场景还原 测试同学反馈点击了一次操作,为什么会有两条操作记录? 我:???? 排查思路 查看日志,看一下是不是发了两次请求,果不其然啊: 并发了,同一时间发送了两次请求,出现了脏写. 原因 系统的co ...
- 详解python中@的用法
python中@的用法 @是一个装饰器,针对函数,起调用传参的作用. 有修饰和被修饰的区别,‘@function'作为一个装饰器,用来修饰紧跟着的函数(可以是另一个装饰器,也可以是函数定义). 代码1 ...
- 阿里内部分享:我们是如何?深度定制高性能MySQL的
阿里云资深数据库工程师赵建伟在“云栖大会上海峰会”的分享.核心是阿里云的数据库服务和MySQL分支的深度定制实践分享. 阿里巴巴MySQL在全球都是有名的.不仅是因为其性能,还因为其是全世界少数拥有M ...
