FileCloud Upgrade for HA on Linux
Requirement
You must have mongodb installed at version 4.2 or higher.
If you have a version of mongodb lower than 4.2, please follow the steps at HA Update when MongoDB Version is Lower Than 4.2.
To perform the update
- Complete the preparation.
Download the mongoDB tool:
If the files MongoTool.php and MongoUtility.php are not present in folder /var/www/html/resources/tools/database on a FileCloud web node, download them from: https://patch.codelathe.com/tonidocloud/live/3rdparty/tools/MongoTool.zip
Set FeatureCompatibilityVersion to 4.2
# run this command on a FileCloud web node: php /var/www/html/resources/tools/database/MongoTool.php --setFeatureCompatibilityVersion 4.2 2023/01/01 08:09:10 featureCompatibilityVersion was set to 4.2.
- Stop all FileCloud services on all nodes except mongodb service.
Update db nodes (or combined db/web nodes)
Check the replica set status, start the update only if the replica set does not show any errors:
# check replica set status, run this command on a FileCloud web node: php /var/www/html/resources/tools/database/MongoTool.php --status 2023/01/17 08:13:08 2023/01/17 08:13:08 >>> replica set ----------------------------------------------------- 2023/01/17 08:13:08 member 0, name: mdb01:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:13:08 member 1, name: mdb02:27017, state: PRIMARY, last heartbeat message: '' 2023/01/17 08:13:08 member 2, name: mdb03:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:13:08 cluster state: ok 2023/01/17 08:13:08 <<< replica set ----------------------------------------------------- 2023/01/17 08:13:08 2023/01/17 08:13:08 2023/01/17 08:13:08 >>> server info ----------------------------------------------------- 2023/01/17 08:13:08 member: mdb01, host: hadb01, version: 4.2.21, time: 15 ms. 2023/01/17 08:13:08 member: mdb02, host: hadb02, version: 4.2.21, time: 27 ms. 2023/01/17 08:13:08 member: mdb03, host: hadb03, version: 4.2.21, time: 14 ms. 2023/01/17 08:13:08 <<< server info ----------------------------------------------------- 2023/01/17 08:13:08
Perform the update one by one on all DB nodes:
- Update the SECONDARY nodes first and the PRIMARY node at the end.
- Stop database service on the node that is to be updated (all other services are already stopped)
- Update the DB node following the instructions at Upgrade FileCloud on Linux.
- Do not start any other services after the update except the database.
- Check the replica set status before continuing with the next node.
- Perform a stepDown when you update a PRIMARY member (making it a SECONDARY member):# example: stepDown member 1 / mdb02, before performing the update: # run this command on a FileCloud web node: php /var/www/html/resources/tools/database/MongoTool.php --rsStepDown 2023/01/17 08:15:12 2023/01/17 08:15:12 >>> replica set ----------------------------------------------------- 2023/01/17 08:15:12 member 0, name: mdb01:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:15:12 member 1, name: mdb02:27017, state: PRIMARY, last heartbeat message: '' 2023/01/17 08:15:12 member 2, name: mdb03:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:15:12 cluster state: ok 2023/01/17 08:15:12 <<< replica set ----------------------------------------------------- 2023/01/17 08:15:12 2023/01/17 08:15:12 initiated stepDown for member mdb02:27017 2023/01/17 08:15:12 waiting 10 seconds for the stepDown to finish ... 2023/01/17 08:15:22 2023/01/17 08:15:22 >>> replica set ----------------------------------------------------- 2023/01/17 08:15:22 member 0, name: mdb01:27017, state: PRIMARY, last heartbeat message: '' 2023/01/17 08:15:22 member 1, name: mdb02:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:15:22 member 2, name: mdb03:27017, state: SECONDARY, last heartbeat message: '' 2023/01/17 08:15:22 cluster state: ok 2023/01/17 08:15:22 <<< replica set ----------------------------------------------------- 2023/01/17 08:15:22 2023/01/17 08:15:22 stepDown for member mdb01:27017 finished.
- Update the web node.
You can skip this step for combined web/db nodes (These have already been updated in the previous step.).
Perform a normal update with the Windows Update tool on all nodes that do not run the database.- Perform the update on web nodes according to these instructions: Upgrade FileCloud on Linux.
- Do not start any services after the update.
- Start all services on all nodes.
To start or stop services
service apache2 start|stop|status service memcached start|stop|status service fcorchestrator start|stop|status service mongod start|stop|status service mongod start|stop|status service cron start|stop|status
.