Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREAZIONE REPLICA SET
- *********************
- mongod --replSet "acireplica" --bind_ip 192.168.2.1
- mongo --host 192.168.2.1
- OPPURE nel file di configurazione
- *********************************
- replication:
- replSetName: "acireplica"
- net:
- bindIp: 192.168.2.1
- Poi avviare: mongod --config /path/del/file/mongod.conf
- AVVIO DI UNA REPLICA dal client mongo
- *********************
- rs.initiate();
- rs.add({host: "192.168.2.2:27017", priority:0, votes: 0})
- RIMUOVERE NODO DALLA REPLICA
- ****************************
- rs.remove("192.168.2.4:27017")
- STATO DELLA REPLICA
- *******************
- rs.status()
- ABILIZIONE ALLA LETTURA DI UN SECONDARIO (da eseguire da dentro il client mongo)
- ********************************************************************
- rs.slaveOk()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement