Get the App
SLTechnology News&Howtos  ›  Servers  › 

Mongodb configuration-replica set

Shulou Source: shulou.com Published: 2022-06-03 01:48:38 09月22日 Update

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

Tags: Node configuration password file arbitration command address data database folder status directory run verify copy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn Huawei NVidia Apple