er目录
[root@mongodb114 ~]# mkdir -p/home/config #放配置文件
[root@mongodb114 ~]# mkdir -p/home/data/logs
分片1
[root@mongodb41 config]# catshard1_2.conf
port=11731
dbpath=/home/data/shard1_2
logpath=/home/data/logs/shard1_2.log
directoryperdb=true
logappend=true
replSet=shard1
#bind_ip=172.16.0.41
shardsvr=true
fork=true
pidfilepath=/home/data/shard1_2.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
分片2
[root@mongodb41 config]# catshard2_2.conf
port=11732
dbpath=/home/data/shard2_2
logpath=/home/data/logs/shard2_2.log
directoryperdb=true
logappend=true
replSet=shard2
#bind_ip=172.16.0.41
shardsvr=true
fork=true
pidfilepath=/home/data/shard2_2.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
分片3
[root@mongodb41 config]# catshard3_2.conf
port=11733
dbpath=/home/data/shard3_2
logpath=/home/data/logs/shard3_2.log
directoryperdb=true
logappend=true
replSet=shard3
#bind_ip=172.16.0.41
shardsvr=true
fork=true
pidfilepath=/home/data/shard3_2.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
config server 配置文件
[root@mongodb41 config]# catconfig.conf
port=30000
dbpath=/home/data/config
logpath=/home/data/logs/config.log
directoryperdb=true
configsvr=true
logappend=true
#bind_ip=172.16.0.41
fork=true
pidfilepath=/home/data/config.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
RouteProces 配置文件
[root@mongodb41 config]# catmongos.conf
port=60000
logpath=/home/data/logs/mongos.log
logappend=true
configdb=172.16.0.40:30000,172.16.0.41:30000,172.16.0.250:30000
#bind_ip=172.16.0.41
fork=true
pidfilepath=/home/data/mongos.pid
chunkSize=5
maxConns=20000
nohttpinterface=true
主机3(172.16.0.250)配置文件
[root@mongodb103 ~]# mkdir -p/home/data/shard1_3
[root@mongodb103 ~]# mkdir -p/home/data/shard2_3
[root@mongodb103 ~]# mkdir -p/home/data/shard3_3
[root@mongodb103 ~]# mkdir -p/home/data/config #config server目录
[root@mongodb103 ~]# mkdir -p/home/config #放配置文件
[root@mongodb103 ~]# mkdir -p/home/data/logs
分片1
[root@mongodb250 config]# catshard1_3.conf
port=11731
dbpath=/home/data/shard1_3
logpath=/home/data/logs/shard1_3.log
directoryperdb=true
logappend=true
replSet=shard1
#bind_ip=172.16.0.250
shardsvr=true
fork=true
pidfilepath=/home/data/shard1_3.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
分片2
[root@mongodb250 config]# catshard2_3.conf
port=11732
dbpath=/home/data/shard2_3
logpath=/home/data/logs/shard2_3.log
directoryperdb=true
logappend=true
replSet=shard2
#bind_ip=172.16.0.250
shardsvr=true
fork=true
pidfilepath=/home/data/shard2_3.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
分片3
[root@mongodb250 config]# catshard3_3.conf
port=11733
dbpath=/home/data/shard3_3
logpath=/home/data/logs/shard3_3.log
directoryperdb=true
logappend=true
replSet=shard3
#bind_ip=172.16.0.250
shardsvr=true
fork=true
pidfilepath=/home/data/shard3_3.pid
maxConns=20000
oplogSize=5000
noprealloc=true
nohttpinterface=true
config server 配置文件
[root@mongodb250 config]# catconfig.conf
port=30000
dbpath=/home/data/config