When running a Neo4J database server standalone (on Ubuntu 14.04), configuration options are set for the global installation in etc/neo4j/neo4j.conf
or possibly $NEO4J_HOME/conf/neo4j.conf
.
However, when instantiating a Neo4j database from Java or Scala using Apache's Neo4jGraph
class (org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
), there is no global installation, and the constructor does not (as far as I can tell) look for any configuration files.
In particular, when running the test suite for my application, I end up with many simultaneous instances of Neo4jGraph
, which ends up throwing a java.net.BindException: Address already in use
because all of these instances are trying to communicate over a small range of ports for online backup, which I don't actually need. These channels are set with config options dbms.backup.address
(default value: 127.0.0.1:6362-6372
) and dbms.backup.enabled
(default value: true
).
My problem would be solved by setting dbms.backup.enabled
to false
, or expanding the port range.
Things that have not worked:
Creating
/etc/neo4j/neo4j.conf
containing the linedbms.backup.enabled=false
.Creating the same file in my project's
src/main/resources
directory.Creating the same file in
src/main/resources/neo4j
.Manually setting the configuration property inside the Scala code:
val db = new Neo4jGraph(dataDirectory)
db.configuration.addProperty("dbms.backup.enabled",false)
- or
db.configuration.addProperty("neo4j.conf.dbms.backup.enabled",false)
- or
db.configuration.addProperty("gremlin.neo4j.conf.dbms.backup.enabled",false)
How should I go about setting this property?