yAsH
yAsH

Reputation: 3405

Neo4j embedded in High Availability mode using Java

I need to run the Neo4j embedded in High availability mode using Java. I downloaded the enterprise edition of Neo4j and made changes to the neo4j.properties file as mentioned in the neo4j high availability setup tutorial. Now, how do I make use of this modified neo4j.properties file to run neo4j in High availability mode using Java?

Upvotes: 0

Views: 236

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39915

For initializing, use the following snippet:

import org.neo4j.graphdb.factory.HighlyAvailableGraphDatabaseFactory
import org.neo4j.graphdb.factory.GraphDatabaseBuilder

....

GraphDatabaseBuilder builder = new HighlyAvailableGraphDatabaseFactory()
    .newHighlyAvailableDatabaseBuilder("<path>"); 
GraphDatabaseService db = builder.loadPropertiesFromFile("neo4j.properties")
    .newGraphDatabase();

Upvotes: 2

Related Questions