Neo4j causal build clusters
1. Download the Enterprise Edition, the current version is 3,5,9
https://neo4j.com/download-center/#enterprise
2. Configure, three core cluster as an example
Configuration file, conf / neo4j.conf
192.168.0.11, neo4j.conf
dbms.mode=CORE
dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address=192.168.0.11
causal_clustering.minimum_core_cluster_size_at_formation=3
causal_clustering.minimum_core_cluster_size_at_runtime=3
causal_clustering.initial_discovery_members=192.168.0.11:5000,192.168.0.12:5000,192.168.0.13:5000
192.168.0.12, neo4j.conf
dbms.mode=CORE
dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address=192.168.0.12
causal_clustering.minimum_core_cluster_size_at_formation=3
causal_clustering.minimum_core_cluster_size_at_runtime=3
causal_clustering.initial_discovery_members=192.168.0.11:5000,192.168.0.12:5000,192.168.0.13:5000
192.168.0.13, neo4j.conf
dbms.mode=CORE
dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address=192.168.0.13
causal_clustering.minimum_core_cluster_size_at_formation=3
causal_clustering.minimum_core_cluster_size_at_runtime=3
causal_clustering.initial_discovery_members=192.168.0.11:5000,192.168.0.12:5000,192.168.0.13:5000
3. Start respectively
bin directory,. / neo4j start
Access to view the status of the cluster through a browser, http: //192.168.0.11: 7474
neo4j-java-driver cluster causal connection
URI Format: bolt + routing: // custom domain name
private Driver createDriver( String virtualUri, String user, String password, ServerAddress... addresses ) { Config config = Config.builder() .withResolver( address - > new HashSet<>( Arrays.asList( addresses ) ) ) .build(); return(GraphDatabase.driver( virtualUri, AuthTokens.basic( user, password ), config ) ); } private void addPerson( String name ) { String username = "neo4j"; String password = "some password"; try (Driver driver = createDriver( "bolt+routing://graph.neo4j.com", username, password, ServerAddress.of( "192.168.0.11", 7687), ServerAddress.of( "192.168.0.12", 8787 ), ServerAddress.of( "192.168.0.13", 9898 ) ) ) { try (Session session = driver.session( AccessMode.WRITE ) ) { session.run( "CREATE (a:Person {name: $name})", parameters( "name", name ) ); } } }