Changes

From SME Server
Jump to navigationJump to search
515 bytes added ,  10:48, 22 September 2020
Line 81: Line 81:     
{{Warning box| Complete work in progress - here be Dragons!}}
 
{{Warning box| Complete work in progress - here be Dragons!}}
Use the above method to add the repo
+
 
 +
===Install===
 +
Use the above method to add the repo and then:
    
  yum --enablerepo=mongodb install mongodb-org
 
  yum --enablerepo=mongodb install mongodb-org
Line 96: Line 98:     
  systemctl {start|stop|restart} mongodb
 
  systemctl {start|stop|restart} mongodb
 +
 +
===Vaporise or reinitialise the database===
 +
 +
{{Warning box| This will totally and utterly vaporise your data. Got a backup?? You have been warned}}
 +
 +
Remove the directory contents:
 +
 +
rm -rf /var/lib/mongo/*
 +
 +
Or remove the entire directory and recreate it with the correct ownership:
 +
 +
rm -rf /var/lib/mongo
 +
mkdir -p /var/lib/mongo
 +
chown -R mongod:mongod /var/lib/mongo
 +
 +
If you have a replicaset set in /etc/mongod.conf make sure you initiate it:
 +
 +
mongo --eval "printjson(rs.initiate())"
    
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]
 
[[Category:Administration]]
 
[[Category:Administration]]

Navigation menu