I have 3 instances.
Servers db configs are as follows,
192.168.9.1:
org.neo4j.server.database.location=/home/myData1/graph.db
192.168.9.2:
org.neo4j.server.database.location=/home/myData2/graph.db
192.168.9.3:
org.neo4j.server.database.location=/home/myData3/graph.db
Each server is running in different machines(different disks).
Now which db path shld i give for,embedded ha db ??
wen i tried giving,
GraphDatabaseService service = new
HighlyAvailableGraphDatabaseFactory().newHighlyAvailableDatabaseBuilder("/home/myData1/graph.db").loadPropertiesFromFile("neo4j.properties").newGraphDatabase();
neo4j.properties has following config.
ha.server_id=1
ha.initial_hosts=192.168.9.1:5001,192.168.9.2:5002,192.168.9.3:5003
1. I started the servers
2. I run my code as above.
It is showing me the following exception,
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error starting
org.neo4j.kernel.ha.HighlyAvailableGraphDatabase, /home/myData/graph.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.Neo4jTest.<clinit>(Neo4jTest.java:15)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component
'org.neo4j.kernel.StoreLockerLifecycleAdapter@29fc9a67' 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/myData/graph.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@6cf143b4 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
Thing is servers are having lock on the db. And wen i try to access that db
through my embedded code it is showing the above exception. If this is the
problem, then how can i use HA embedded code to access the db ??
My server shld be running in the background. Through embedded code I have
to modfy the db. How can i do that?? I hope I am clear now.
Thanks
On Thu, Jan 23, 2014 at 3:38 PM, Michael Hunger <
[email protected]> wrote:
> 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)<http://blog.neo4j.org/2013/12/neo4j-20-ga-graphs-for-everyone.html>
>>> Do something useful - Teach your kids 1 hour code!<http://code.org/learn>
>>>
>>>
>>> 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.
>
--
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.