Changes

From SME Server
Jump to navigationJump to search
1,867 bytes removed ,  14:22, 18 July 2022
Update for Koozali v10
Line 1: Line 1: −
==How to install MongoDB 4.0==
+
==How to install MongoDB==
   −
{{Note box| All info is based on SME Server 9 only but I have just started to test on v10 - see notes below}}
+
{{Note box| Manual configuration required}}
    
===Install Official Repository===
 
===Install Official Repository===
   −
This should work for every version of Koozali SME
+
Use ExtraRepositories from here
   −
You may need to change the mongodb version as required
+
https://wiki.koozali.org/Extrarepositories
   −
db yum_repositories set mongodb repository \
+
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
                BaseURL https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/4.0/\$basearch/ \
+
 
                EnableGroups no \
+
Please check which versions are deprecated - they should not be used.
                GPGCheck yes \
+
 
                Name "MongoDB" \
+
https://www.mongodb.com/support-policy/lifecycles
                GPGKkey https://www.mongodb.org/static/pgp/server-4.0.asc \
+
 
                Visible no \
+
As of July 2022 the oldest supported version is 4.2 until April 2023
                status disabled
+
 
 +
yum install smeserver-extrarepositories-mongodb
    
  signal-event yum-modify
 
  signal-event yum-modify
   −
  yum install mongodb-org --enablerepo=mongodb
+
Install your chosen version:
 +
 
 +
  yum --enablerepo=mongodb4.2 install mongodb-org
    
If refuses to install because of no GPG Key you can change '''GPGCheck''' above from '''Yes''' to '''No''' and try '''yum install...'''  again or
 
If refuses to install because of no GPG Key you can change '''GPGCheck''' above from '''Yes''' to '''No''' and try '''yum install...'''  again or
Line 28: Line 31:  
Or
 
Or
   −
yum install mongodb-org --enablerepo=mongodb --nogpgcheck
+
  yum --enablerepo=mongodb4.2 install mongodb-org --nogpgcheck
   −
===Start Mongo===
+
===Starting Mongo===
    
{{Warning box|Please check additional notes below before trying this section}}
 
{{Warning box|Please check additional notes below before trying this section}}
  −
{{Note box|If you start mongo like this you will run mongo as root.
  −
When mongo later tries to start automatically it may fail because it will be started as the mongod user and won't be able to access the DB files.}}
  −
  −
/etc/init.d/mongod start
  −
  −
Add the symlinks to start automatically:
  −
  −
ln -s /etc/init.d/mongod /etc/rc.d/rc6.d/K03mongodb
  −
ln -s /etc/init.d/mongod /etc/rc.d/rc7.d/S57mongodb
  −
  −
Optional: create symlink to use mongo or mongodb as service name
  −
  −
ln /etc/init.d/mongod /etc/init.d/mongodb
  −
  −
To ensure everything is all right:
  −
  −
signal-event post-upgrade
  −
signal-event reboot
  −
  −
===Additional Notes===
  −
  −
Note - I need to test this again This is my initial observation.
  −
  −
As far as I can see, the link above to mongodb is not necessary.
  −
  −
It may need this to set on and off correctly in other service levels:
  −
  −
chkconfig mongod on
  −
  −
Create a service link in in rc7.d:
  −
  −
ln -s /etc/init.d/mongod /etc/rc.d/rc7.d/S57mongod
  −
  −
To use e-smith-service it will need a key:
  −
  −
config set mongod service status enabled
  −
  −
You should now be able to do:
  −
  −
service mongod start|stop|restart etc
  −
  −
Mongo should come up on boot.
  −
  −
  −
==Koozali SME v10==
      
{{Warning box| Complete work in progress - here be Dragons!}}
 
{{Warning box| Complete work in progress - here be Dragons!}}
  −
===Install===
  −
  −
WIP
  −
  −
db yum_repositories set mongodb42 repository \
  −
              BaseURL [https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/4.2/$basearch/ https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/4.2/\$basearch/] \
  −
              EnableGroups no \
  −
              GPGCheck yes \
  −
              Name "MongoDB" \
  −
              GPGKey https://www.mongodb.org/static/pgp/server-4.2.asc \
  −
              Visible no \
  −
              status disabled
  −
  −
signal-event yum-modify
  −
  −
Use the above method to add the repo and then:
  −
  −
yum --enablerepo=mongodb42 install mongodb-org
      
We need a db config entry for SME to recognise it:
 
We need a db config entry for SME to recognise it:
Line 118: Line 56:  
  WantedBy=sme-server.target
 
  WantedBy=sme-server.target
   −
===Using keys===
+
===Configuration File===
 
  −
config setprop mongod service status enabled
      
Minimal config I use for Rocket.Chat
 
Minimal config I use for Rocket.Chat
Line 164: Line 100:       −
And to restore:
+
{{Warning box| Do not restore between versions!!}}
   −
mongorestore /root/backup/rocketchatmongo-all
+
If you export from a version eg 4.0 then restore to that version. Do not try and restore 4.0 to 4.2 or higher.
   −
Do not restore between versions.
+
Then change your repo, and then upgrade mongo.
   −
If you export from a version eg 4.0 then restore to that version. Do not try and restore 4.0 to 4.2 or higher.
+
To restore:
   −
Then change your repo, and then upgrade mongo.
+
mongorestore /root/backup/rocketchatmongo-all
    
===Backup with system===
 
===Backup with system===

Navigation menu