在服务器上设置mongodb分片集群开机自启动

服务器上的配置文件

config.conf

#config.conf
configsvr=true
#where to log
logpath=/home/mongodb/bin/mongodbData/config/log/config.log
logappend=true
#where to dbpath
dbpath=/home/mongodb/bin/mongodbData/config/data
#where to pid
pidfilepath=/home/mongodb/bin/mongodbData/run/config.pid
#port
port=11000
#fork and run in background
fork=true

mongos.conf

#mongos.conf
configdb=xx.xx.x0.xx:11000
#where to log
logpath=/home/mongodb/bin/mongodbData/mongos/log/mongos.log
logappend=true
#where to pid
pidfilepath=/home/mongodb/bin/mongodbData/run/mongos.pid
#port
port=13000
#fork and run in background
fork=true

shard1.conf

#shard1.conf
shardsvr=true
#where to log
logpath=/home/mongodb/bin/mongodbData/shard1/log/shard1.log
logappend=true
#where to dbpath
dbpath=/home/mongodb/bin/mongodbData/shard1/data
#where to pid
pidfilepath=/home/mongodb/bin/mongodbData/run/shard1.pid
#port
port=12003
#fork and run in background
fork=true

shard2.conf

#shard2.conf

shardsvr=true
#where to log
logpath=/home/mongodb/bin/mongodbData/shard2/log/shard2.log
logappend=true
#where to dbpath
dbpath=/home/mongodb/bin/mongodbData/shard2/data
#where to pid
pidfilepath=/home/mongodb/bin/mongodbData/run/shard2.pid
#port
port=12001
#fork and run in background
fork=true

shard3.conf

#shard3.conf
shardsvr=true
#where to log

你可能感兴趣的:(管理,mongodb,mongodb,服务器,分片集群,开机自启动,脚本)