Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. CREAZIONE REPLICA SET
  2. *********************
  3.  
  4. mongod --replSet "acireplica" --bind_ip 192.168.2.1
  5.  
  6. mongo --host 192.168.2.1
  7.  
  8.  
  9.  
  10. OPPURE nel file di configurazione
  11. *********************************
  12.  
  13. replication:
  14. replSetName: "acireplica"
  15. net:
  16. bindIp: 192.168.2.1
  17.  
  18. Poi avviare: mongod --config /path/del/file/mongod.conf
  19.  
  20. AVVIO DI UNA REPLICA dal client mongo
  21. *********************
  22.  
  23. rs.initiate();
  24.  
  25. rs.add({host: "192.168.2.2:27017", priority:0, votes: 0})
  26.  
  27. RIMUOVERE NODO DALLA REPLICA
  28. ****************************
  29. rs.remove("192.168.2.4:27017")
  30.  
  31. STATO DELLA REPLICA
  32. *******************
  33. rs.status()
  34.  
  35. ABILIZIONE ALLA LETTURA DI UN SECONDARIO (da eseguire da dentro il client mongo)
  36. ********************************************************************
  37. rs.slaveOk()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement