FileCloud Update for HA on Windows
Requirement
You must have mongodb installed at version 4.2 to upgrade to MongoDB 4.4
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:
Create the folder C:\xampp\htdocs\resources\tools\database if it does not already exist.If the files MongoTool.php and MongoUtility.php are not present in folder C:\xampp\htdocs\resources\tools\database on a FileCloud web node, download them from: https://patch.codelathe.com/tonidocloud/live/3rdparty/tools/MongoTool.zip
Check the replica set status. Servers in RECOVERING, ROLLBACK or STARTUP2 mode must be fixed to proceed to next step. For help, Contact FileCloud Support.
# check replica set status, run this command on a FileCloud web node: C:\xampp\php\php.exe C:\xampp\htdocs\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
Set FeatureCompatibilityVersion to 4.2
# run this command on a FileCloud web node: C:\xampp\php\php.exe C:\xampp\htdocs\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: C:\xampp\php\php.exe C:\xampp\htdocs\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).
- Start the update using the FileCloud update tool:cloudupdate.exe -noMongoDump
- 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: C:\xampp\php\php.exe C:\xampp\htdocs\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 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.- Stop all services before starting the update tool: Upgrade using Update Tool (Windows Only) - FileCloud Docs
- Do not start any services after the update.
- Start all services on all nodes in the FileCloud Control Panel.