In-place rolling upgrade of a cluster
It is recommended to read the Introduction and Upgrade or patch v5.X before continuing. |
This is an example of how to do a rolling upgrade, by upgrading individual servers one at a time. This approach keeps the cluster available throughout the upgrade. However, it does reduce fault tolerance while each server is offline.
Before you begin
Perform these steps in full on each server, before moving on to the next server. You must ensure that the cluster returns to a stable state before moving on to the next.
Upgrade steps (to be repeated for each server)
-
Check the cluster is healthy.
-
Use the following query to check servers are hosting all their assigned databases. The query should return no results:
SHOW SERVERS YIELD name, hosting, requestedHosting, serverId WHERE requestedHosting <> hosting
-
Use the following query to check all databases are in their expected state. The query should return no results:
SHOW DATABASES YIELD name, address, currentStatus, requestedStatus, statusMessage WHERE currentStatus <> requestedStatus RETURN name, address, currentStatus, requestedStatus, statusMessage
-
-
For in-place rolling upgrades, the steps for an individual server are identical to upgrading a standalone server. The exact steps depend on how you have chosen to deploy Neo4j.
Examples are available for common deployments:
-
Once the server has been restarted, confirm the server is running successfully.
Run the following command and check the server has state
Enabled
and healthAvailable
.SHOW SERVERS WHERE name = [server-id];
-
Confirm that the server has started all the databases that it should.
This command shows any databases that are not in their expected state:
SHOW DATABASES YIELD name, address, currentStatus, requestedStatus, serverID WHERE currentStatus <> requestedStatus AND serverID = [server-id] RETURN name, address, currentStatus, requestedStatus
-
Repeat these steps on the next server, until all servers are upgraded.
Completion
Run the following Cypher against the cluster, using Cypher Shell or another Cypher client.
CALL dbms.upgrade()
Monitor the logs
When Neo4j restarts, it is a good idea to monitor the logs for any errors or warnings caused by the upgrade. The neo4j.log file contains information on the upgrade.
Was this page helpful?