Neo4j Causal Cluster Demo
Demo – Neo4j Casual Clustering
- Create a local working directory.
- Download a copy of Neo4j Enterprise Edition from the Neo4j download site. Unpack Neo4j in the working directory.
- Make a copy of the neo4j-enterprise-3.5.14 directory, and name it core-01. We will need to keep the original directory to use when setting up the Read Replicas later
- The core-01 directory will contain the first Core instance
Configure the first Core instance
. All configuration that we will do takes place in the Neo4j configuration file, conf/neo4j.conf.
. The first settings we will change represent the minimum configuration for a Core instance:
. Locate and uncomment the setting
dbms.mode=CORE.
. Locate and uncomment the setting causal_clustering.minimum_core_cluster_size_at_formation=3.
. Locate and uncomment the setting causal_clustering.minimum_core_cluster_size_at_runtime=3.
. Locate and uncomment the setting causal_clustering.initial_discovery_members=localhost:5000,localhost:5001,localhost:5002.
. Locate and uncomment the setting causal_clustering.discovery_listen_address=:5000.
. Locate and uncomment the setting causal_clustering.transaction_listen_address=:6000.
. Locate and uncomment the setting causal_clustering.raft_listen_address=:7000.
. Locate and uncomment the setting dbms.connector.bolt.listen_address=:7687.
. Locate and uncomment the setting dbms.connector.http.listen_address=:7474.
. Locate the dbms.connector.https.listen_address setting and change the value to :6474.
. Locate the dbms.backup.address setting and change the value to :6362.
dbms.backup.listen_address=0.0.0.0:6362
Configure the second Core instance
. Make a copy of the core-01 directory and rename it core-02.
. Open the neo4j.conf file in the new core-02 directory.
. Locate the causal_clustering.discovery_listen_address setting and change the value to :5001.
. Locate the causal_clustering.transaction_listen_address setting and change the value to :6001.
. Locate the causal_clustering.raft_listen_address setting and change the value to :7001.
. Locate the dbms.connector.bolt.listen_address setting and change the value to :7688.
. Locate the dbms.connector.http.listen_address setting and change the value to :7475.
. Locate the dbms.connector.https.listen_address setting and change the value to :6475.
. Locate the dbms.backup.address setting and change the value to :6363.
dbms.backup.listen_address=0.0.0.0:6363
Configure the third Core instance
. Make a copy of the core-02 directory and rename it core-03.
. Open the neo4j.conf file in the new core-03 directory.
. Locate the causal_clustering.discovery_listen_address setting and change the value to :5002.
. Locate the causal_clustering.transaction_listen_address setting and change the value to :6002.
. Locate the causal_clustering.raft_listen_address setting and change the value to :7002.
. Locate the dbms.connector.bolt.listen_address setting and change the value to :7689.
. Locate the dbms.connector.http.listen_address setting and change the value to :7476.
. Locate the dbms.connector.https.listen_address setting and change the value to :6476.
. Locate the dbms.backup.address setting and change the value to :6364.
dbms.backup.listen_address=0.0.0.0:6364
Start the Neo4j Servers
Neo4j console
Core 1 Instance Starting Screen Shot
Core 2 Instance Starting Screen Shot
Core 3 Instance Starting Screen Shot
Checking Sysinfo Screen Shot
Cluster Overview Screen Shot
command is call dbms.cluster.overview()
Connecting to Core 2 instance Screen Shot
Connecting to Core 3 instance Screen Shot
Writing Data to Leader instance Screen Shot
Reading Data from Leader instance Screen Shot
Reading Data from Follower instance Screen Shot
Writing Data to Follower instance Screen Shot
Configure Three Replicas
Configuring Replica 1
. In your working directory, make a copy of the neo4j-enterprise-3.5.14 directory and name it replica-01.
. Open the neo4j.conf file in the new replica-01 directory. The first settings we will change represent the minimum configuration for a Read Replica:
. Locate and uncomment the dbms.mode setting and change the value to READ_REPLICA.
. Locate and uncomment the setting causal_clustering.initial_discovery_members=localhost:5000,localhost:5001,localhost:5002.
Since we are setting up the Causal Cluster to run on a single machine, we must do some additional configuration. Please note that the following steps would not be necessary if the instances are running on different servers:
. Locate and uncomment the causal_clustering.transaction_listen_address setting and change the value to :6003.
. Locate and uncomment the dbms.connector.bolt.listen_address setting and change the value to :7690.
. Locate and uncomment the dbms.connector.http.listen_address setting and change the value to :7477.
. Locate and uncomment the dbms.connector.https.listen_address setting and change the value to :6477.
. Locate and uncomment the dbms.backup.address setting and change the value to :6365.
Configuring Replica 2
. Make a copy of the replica-01 directory and rename it replica-02.
. Open the neo4j.conf file in the new replica-02 directory.
. Locate the causal_clustering.transaction_listen_address setting and change the value to :6004.
. Locate the dbms.connector.bolt.listen_address setting and change the value to :7691.
. Locate the dbms.connector.http.listen_address setting and change the value to :7478.
. Locate the dbms.connector.https.listen_address setting and change the value to :6478.
. Locate the dbms.backup.address setting and change the value to :6366.
Configuring Replica 3
. Make a copy of the replica-02 directory and rename it replica-03.
. Open the neo4j.conf file in the new replica-03 directory.
. Locate the causal_clustering.transaction_listen_address setting and change the value to :6005.
. Locate the dbms.connector.bolt.listen_address setting and change the value to :7692.
. Locate the dbms.connector.http.listen_address setting and change the value to :7479.
. Locate the dbms.connector.https.listen_address setting and change the value to :6479.
. Locate the dbms.backup.address setting and change the value to :6367.
Starting the replicas
replica-01\neo4j-enterprise-3.5.14\bin> neo4j console
replica-02\neo4j-enterprise-3.5.14\bin> neo4j console
replica-03\neo4j-enterprise-3.5.14\bin> neo4j console