备忘-MongoDB master slave配置

基于yum的安装方式。参见  http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages

 

修改 /etc/mongod.conf

 

Slave 

找到一下内容修改

# in replicated mongo databases, specify here whether this is a slave or master

slave = true

source = 192.168.44.102

master
找到一下内容修改
# or
master = true
source = 192.168.44.101
master检查:
# mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db.printReplicationInfo()
slave检查:
# mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db.printSlaveReplicationInfo()

你可能感兴趣的:(mongodb,shell,url)