Changes

Jump to navigation Jump to search
1,429 bytes added ,  17:57, 26 July 2023
no edit summary
Line 2: Line 2:     
{{Note box| Manual configuration required}}
 
{{Note box| Manual configuration required}}
 +
 +
MongoDB 5.0+ requires the AVX CPU instruction set
 +
 +
lscpu |grep avx
    
===Install Official Repository===
 
===Install Official Repository===
Line 9: Line 13:  
https://wiki.koozali.org/Extrarepositories
 
https://wiki.koozali.org/Extrarepositories
   −
Note that all versions are available form 0.9 -> 1.0 -> 3.0/1/2/3/4/5/6/7 -> 4.0/1/2/3/4 -> 5.0
+
Note that versions are available from 4.0/1/2/3/4 -> 5.0 -> 6.0
    
Please check which versions are deprecated - they should not be used.
 
Please check which versions are deprecated - they should not be used.
Line 36: Line 40:     
{{Warning box|Please check additional notes below before trying this section}}
 
{{Warning box|Please check additional notes below before trying this section}}
   
{{Warning box| Complete work in progress - here be Dragons!}}
 
{{Warning box| Complete work in progress - here be Dragons!}}
   Line 83: Line 86:       −
Once started you need to initialises the replicaset:
+
Once started you need to initialise the replicaset. Make sure to exit from the mongo instance and run from the cli:
    
  mongo --eval "printjson(rs.initiate())"
 
  mongo --eval "printjson(rs.initiate())"
 +
 +
You should now have a working mongoDB good enough to use with Rocket.Chat
 +
 +
 +
===Other settings===
 +
 +
nano /etc/security/limits.conf
 +
 +
These settings are automatically added during installation
 +
 +
@mongod      soft        nproc      unlimited
 +
@mongod      hard      nproc        unlimited
 +
@mongod      soft      nofile      64000
 +
@mongod      hard      nofile      64000
 +
 +
Adding a user
 +
 +
https://www.linode.com/docs/guides/install-mongodb-on-centos-7/
 +
 +
use admin
 +
 +
db.createUser(
 +
  {
 +
    user: "admin",
 +
    pwd: "admin123",
 +
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
 +
  }
 +
)
 +
 +
show users
 +
 +
We can then set Mongo to force authentication when connecting.
 +
 +
nano /usr/lib/systemd/system/mongod.service.d/50koozali.conf
 +
 +
Add:
 +
 +
[Service]
 +
Environment="OPTIONS=--auth -f /etc/mongod.conf"
 +
 +
Restart Mongo
 +
 +
systemctl restart mongod
 +
 +
You should now need a password to login.
 +
 +
===Templating mongod.conf===
 +
 +
This is possible but we need to create a new file so we do not overwrite the original - otherwise yum/rpm will complain.
 +
 +
Something like /etc/mongod/mongod.conf
 +
 +
Template fragments in
 +
 +
/etc/e-smith/templates/etc/mongod/mongod.conf
 +
 +
We can then amend the systemd overrride
 +
 +
nano /usr/lib/systemd/system/mongod.service.d/50koozali.conf
 +
 +
Add this:
 +
 +
[Service]
 +
Environment="OPTIONS=-f /etc/mongod/mongod.conf"
    
===Dump and restore===
 
===Dump and restore===

Navigation menu