firewall-cmd --query-port=27017/tcp
yum install system-config-firewall-tui
firewall-cmd --zone=public --add-port=27017/tcp --permanent
# systemctl unmask firewalld
# systemctl enable firewalld
# systemctl start firewalld
yum install policycoreutils-python
yum install yum-fastestmirror
wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz
tar xvf yum-3.4.3.tar.gz
cd yum-3.4.3
yummain.py install yum
#replication:
replication:
oplogSizeMB: 100
replSetName: "set_datacn"
secondaryIndexPrefetch: "all"
#sharding:
sharding:
clusterRole: "shardsvr"
config = {_id: "set_datacn", members: [
{_id:0, host: "192.168.1.51", priority: 100},
{_id:1, host: "192.168.1.52", priority: 90},
{_id:2, host: "192.168.1.53",priority: 10,
arbiterOnly: true}
]}
rs.initiate(config)
SECONDARY> rs.slaveOk();