mongodb

安装初始化

yum install numactl -y
/usr/bin/percona-server-mongodb-enable-auth.sh

Replica sets

rs.status() 
rs.initiate() 
rs.add("10.0.1.32:27017") 
rs.addArb("10.0.1.33:27017") 
rs.conf() 
rs.slaveOk()

权限管理

# 创建用户
db.createUser({user:"repl",pwd:"mogno#repl",roles:["root"]})
# 创建keyfile
openssl rand -base64 741 > /etc/mongodb-keyfile 
chmod 600 /etc/mongodb-keyfile 
--keyFile /etc/mongodb-keyfile

Comments