Mongodb configuration-replica set
Mongodb configures 192.11.11.11 as a master node
192.11.11.12 is the arbitration node
192.11.11.13 is the backup node
1. Download the tar package
Https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.2.tgz
2. Decompression
Rm-rf / neworiental/mongodb
Tar-zxvf / neworiental/tools/mongodb-linux-x86_64-4.0.2.tgz-C / neworiental/
Mv / neworiental/mongodb-linux-x86_64-4.0.2 / neworiental/mongodb
3. Set up a directory folder
Mkdir-p / neworiental/mongodb/data/master
Mkdir-p / neworiental/mongodb/data/slaver
Mkdir-p / neworiental/mongodb/data/arbiter
Mkdir-p / neworiental/mongodb/log
Mkdir-p / neworiental/mongodb/master
Mkdir-p / neworiental/mongodb/slaver
Mkdir-p / neworiental/mongodb/arbiter
Mkdir / neworiental/mongodb/keyFile/
4. Configuration file
Addr=/sbin/ifconfig-a | grep inet | grep-v 127.0.0.1 | grep-v inet6 | awk'{print $2}'| tr-d "addr:"
Cat