Make sure you have a different config for each server And give loadproperties the full path too
Note that they must not share a db directory on disk Sent from mobile device Am 23.01.2014 um 09:30 schrieb Kalidhakani J <[email protected]>: > In my servers I have given the path as data/graph.db > my properties file(neo4jServer.properties) has the following values, > > ha.server_id=1 > ha.initial_hosts=192.168.9.1:5001,192.168.9.2:5002,192.168.9.3:5003 > > I started my servers. Then for creating HIghlyAvailableGraphDatabase, I used > the following code, > > GraphDatabaseService graphDb = new > HighlyAvailableGraphDatabaseFactory().newHighlyAvailableDatabaseBuilder("<SERVER_PATH>/data/graph.db").loadPropertiesFromFile("neo4jServer.properties").newGraphDatabase(); > > > When i try to run the code it is showing me the above exception I mentioned. > > > My requirement is I have to modify the DB that is running in the server > through embedded highly available graph database. > > Help me. > > > > On Thu, Jan 23, 2014 at 1:14 PM, Michael Hunger > <[email protected]> wrote: >> You have to provide the same ha config >> as in server as map to the HA-DB >> >> Sent from mobile device >> >> Am 23.01.2014 um 05:36 schrieb Kalidhakani J <[email protected]>: >> >>> Actually my servers are running. I am trying to use the server's db. How >>> can I do that in embedded highly available graph database ?? When i try to >>> create a embedded highly available graph database giving the path name as >>> server's db path, it is showing me this exception. How can i implement it >>> ??? Wat am i missing here? Help me. >>> >>> >>> On Mon, Jan 20, 2014 at 7:00 PM, Peter Neubauer >>> <[email protected]> wrote: >>>> Can you please check that no other neo4j java process is currently running >>>> on that machine, as it seems two database instances are trying to access >>>> the files? >>>> >>>> /peter >>>> >>>> >>>> G: neubauer.peter >>>> S: peter.neubauer >>>> P: +46 704 106975 >>>> L: http://www.linkedin.com/in/neubauer >>>> T: @peterneubauer >>>> >>>> Neo4j 2.0.0 - (graphs)-[:FOR]->(everyone) >>>> Do something useful - Teach your kids 1 hour code! >>>> >>>> >>>> On Fri, Jan 17, 2014 at 1:14 PM, Kalidhakani J <[email protected]> >>>> wrote: >>>>> HI all, >>>>> >>>>> I created a cluster with three nodes. In every server I gave my database >>>>> path as data/myGraph.db >>>>> >>>>> For creating HIghlyAvailableGraphDatabase, I used the following code, >>>>> >>>>> GraphDatabaseService graphDb = >>>>> databaseFactory.newHighlyAvailableDatabaseBuilder("<SERVER_PATH>/data/myGraph.db") >>>>> .loadPropertiesFromFile("neo4jProperties.properties") >>>>> .newGraphDatabase(); >>>>> >>>>> where my properties file had the configurations as follows, >>>>> >>>>> ha.server_id=1 >>>>> ha.initial_hosts=192.168.9.1:5001,192.168.9.2:5002,192.168.9.3:5003 >>>>> >>>>> I tried creating a node as follows, >>>>> >>>>> Transaction tx = graphDb.beginTx(); >>>>> Node node1 =graphDb.createNode(); >>>>> node1.setProperty("name", "kk"); >>>>> node1.setProperty("college", "ceg"); >>>>> graphDb.index().forNodes( "nodes" ).add( node1, "name", "kk" ); >>>>> System.out.println("Node1 name :"+node1.getProperty("name")); >>>>> tx.success(); >>>>> tx.close(); >>>>> >>>>> But when i run the code I get the following exception, >>>>> >>>>> >>>>> Exception in thread "main" java.lang.RuntimeException: Error starting >>>>> org.neo4j.kernel.ha.HighlyAvailableGraphDatabase, >>>>> /home/admin/neo4j-enterprise-2.0.0/data/kkGraph.db >>>>> at >>>>> org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:333) >>>>> at >>>>> org.neo4j.kernel.ha.HighlyAvailableGraphDatabase.<init>(HighlyAvailableGraphDatabase.java:139) >>>>> at >>>>> org.neo4j.graphdb.factory.HighlyAvailableGraphDatabaseFactory$1.newDatabase(HighlyAvailableGraphDatabaseFactory.java:47) >>>>> at >>>>> org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:198) >>>>> at >>>>> in.co.nmsworks.neo4j.examples.HighlyAvailableDbTest.main(HighlyAvailableDbTest.java:30) >>>>> Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component >>>>> 'org.neo4j.kernel.StoreLockerLifecycleAdapter@7fa9629b' was successfully >>>>> initialized, but failed to start. Please see attached cause exception. >>>>> at >>>>> org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504) >>>>> at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) >>>>> at >>>>> org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:310) >>>>> ... 4 more >>>>> Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on >>>>> store lock file: >>>>> /home/admin/neo4j-enterprise-2.0.0/data/kkGraph.db/store_lock. Please >>>>> ensure no other process is using this database, and that the directory is >>>>> writable (required even for read-only access) >>>>> at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:87) >>>>> at >>>>> org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) >>>>> at >>>>> org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498) >>>>> ... 6 more >>>>> Caused by: java.io.IOException: Unable to lock >>>>> sun.nio.ch.FileChannelImpl@64d11693 because another process already holds >>>>> the lock. >>>>> at >>>>> org.neo4j.kernel.impl.nioneo.store.FileLock.getOsSpecificFileLock(FileLock.java:87) >>>>> at >>>>> org.neo4j.kernel.DefaultFileSystemAbstraction.tryLock(DefaultFileSystemAbstraction.java:89) >>>>> at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74) >>>>> ... 8 more >>>>> >>>>> Help me. >>>>> Thanks in advance. >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google Groups >>>>> "Neo4j" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send an >>>>> email to [email protected]. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "Neo4j" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to [email protected]. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Neo4j" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> For more options, visit https://groups.google.com/groups/opt_out. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
