How to monitor if a follower is in sync with the leader - or know how much it is lagging behindJun 28, 2024Knowledge
Article DetailsDetailsHelp Details To monitor if a follower is in sync with its leader or know how much it lags behind, it is possible to check the Last Transaction Id from the leader and follower. Last Transaction Id can be assessed in one of the following ways: From the Neo4j Web Interface Via the Neo4j Metrics Checking Last Transaction Id from the Neo4j Web Interface From the Neo4j Browser: type :sysinfo from the "Transactions" frame, identify the parameter "Last Tx Id" Checking Last Transaction Id via the Neo4j Metrics Assuming you have already enabled the Neo4j Metrics and are exporting them to CSV, Graphite, or Ganglia, please identify the parameter <prefix>.transaction.last_committed_tx_id. Note: <prefix>.transaction.last_committed_tx_id is part of the Database Transaction Metrics, so metrics.neo4j.cluster.enabled must be enabled in your neo4j.conf file: metrics.neo4j.cluster.enabled=true For more information on Neo4j Metrics, please refer to http://neo4j.com/docs/stable/metrics-extension.html Determining how much a follower is lagging behind its leader To determine how much a follower is lagging behind its leader, please compare the Last Transaction Id (assessed in any of the methods described above) from leader and follower: (Last Transaction Id)_leader - (Last Transaction Id)_follower The higher the above difference, the more the follower is lagging behind. Important Note: Neo4j Clustering is an eventually consistent model that relies on proactive leader-to-follower and follower-to-leader pulls. Therefore, some amount of follower lag is normal and expected. Make sure to take this into consideration when monitoring and determining whether there is an issue or not.Further reading here . Relevant for Neo4j Versions: 4.4, 5.x. Relevant keywords server, cluster, leader, follower, writes. InformationTitleHow to monitor if a follower is in sync with the leader - or know how much it is lagging behindArticle Created Date3/15/2024, 10:56 PMURL Name217715587-How-to-monitor-if-a-follower-is-in-sync-with-the-leader-or-know-how-much-it-is-lagging-behindLast Modified Date6/28/2024, 3:16 PM