Multiple-process access to BerkeleyDB

464 views
Skip to first unread message

Shyam Santhanam

unread,
Feb 18, 2015, 7:10:47 PM2/18/15
to aureliu...@googlegroups.com
Hi,

I'm trying to use BerkeleyDB with Titan where I can have multiple processes accessing the same database instance, specifically just one writer and one reader. The reader would be a Rexter instance, and the writer is embedded in my application. Can someone please explain how I can configure it do that? I am currently running into this error, which as I understand is because the EnvironmentConfig supplied when starting Berkeley DB does not have readOnly == false. Should we be matching EnvironmentConfig.readOnly to Titan's read-only configuration value?

274  [main] WARN  com.tinkerpop.rexster.config.GraphConfigurationContainer  - GraphConfiguration could not be found or otherwise instantiated: [com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration]. Ensure that it is in Rexster's path.
com.tinkerpop.rexster.config.GraphConfigurationException: GraphConfiguration could not be found or otherwise instantiated: [com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration]. Ensure that it is in Rexster's path.
at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:142)
at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(GraphConfigurationContainer.java:54)
at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99)
at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterApplication.java:47)
at com.tinkerpop.rexster.Application.<init>(Application.java:97)
at com.tinkerpop.rexster.Application.main(Application.java:189)
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager
at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
at com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(TitanGraphConfiguration.java:33)
at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:124)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
... 12 more
Caused by: com.thinkaurelius.titan.diskstorage.PermanentBackendException: Error during BerkeleyJE initialization:
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.initialize(BerkeleyJEStoreManager.java:108)
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.<init>(BerkeleyJEStoreManager.java:68)
... 17 more
Caused by: com.sleepycat.je.EnvironmentLockedException: (JE 5.0.73) /tmp/titan The environment cannot be locked for single writer access. ENV_LOCKED: The je.lck file could not be locked. Environment is invalid and must be closed.
at com.sleepycat.je.log.FileManager.<init>(FileManager.java:371)
at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:453)
at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:382)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:178)
at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:246)
at com.sleepycat.je.Environment.<init>(Environment.java:227)
at com.sleepycat.je.Environment.<init>(Environment.java:170)
at com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.initialize(BerkeleyJEStoreManager.java:104)
... 18 more


Thanks,

Shyam

Matthias Broecheler

unread,
Feb 19, 2015, 5:20:49 PM2/19/15
to aureliu...@googlegroups.com
No, I think you will need to extend the current BerkeleyJE adapter to allow this since it requires a different environment setup if I remember correctly. Currently, BerkeleyJE is used mostly for inprocess data stores - hence that default.

HTH,
Matthias

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/2abcec53-ace3-4249-beb8-ba4822df5055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matthias Broecheler
http://www.matthiasb.com
Reply all
Reply to author
Forward
0 new messages