I am trying to merge two separate efforts. I have an application that currently uses anormcypher to talk to a remote neo4j database, and I am now developing an application that uses TinkerPop Blueprints.
In Blueprints I can create a new embedded Neo4jGraph but I don't know how to connect it to my remote neo4j (community edition, not HA) server. I'm looking for the documentation that tells me how to configure that connection (host::port).
Related
I installed cytoscape 3.8.2 and Cytoscape Neo4j Plugin (http://apps.cytoscape.org/apps/cytoscapeneo4jplugin). I've generated a small neo4j graph, which is situated on a remote server.
When trying to connect to neo4j using the plugin I get following error: "Cannot connect to neo4j"
What am I doing wrong? Is it not possible to connect to neo4j when the instance is situated on a remote server?
It certainly should work, but since Neo4J uses it's own port, which isn't opened by default on most hosts, you may need to tweak your server firewall.
-- scooter
I am setting up window service for my neo4j database. I am able to start that from service and I can do a http post cypher query using localhost. However, I can't connect to the neo4j db remotely.
If I start the neo4j db via neo4j Desktop, I can perform http post both locally and remotely.
When I compared the neo4j logs generated using service start vs neo4j desktop start, they are quite different but no error on the service one.
Any idea?
By default, Neo4j server is not accessible remotely.
You need to change $NEO4J_HOME/conf/neo4j.conf.
Find this line:
#dbms.connector.http.address=localhost:7474
And Replace it with:
dbms.connector.http.address=0.0.0.0:7474
Setting connector address to 0.0.0.0 makes it accessible remotely.
I have developed a web application using Asp.net, where I am using Neo4j client to connect to my Neo4j database.
static GraphClient client = new GraphClient(new Uri(url), username, password);
client.Connect();
However this requires me to open the Neo4J desktop app and run the database before I can run my web app.
I wonder if it is possible to run the webapp without opening the Neo4J instance physically. i.e., The webapp should communicate with Neo4J in the background like we normally do with SQL databases.
The neo4j Desktop is only really for use during development.
To have a neo4j server that runs all the time, you should download an appropriate non-Desktop release from this page, and install it on a machine or environment that is always available. Chapter 2 of the Operations Manual has installation instructions.
Current it seems we cannot run both Neo4J Server and Gremlin Server at the same time. Is there any way to have run both?
NEO4J is running and I try to start to Gremlin Server then I get the following error
java.lang.RuntimeException: GraphFactory could not instantiate this
Graph implementation [class
org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph].......................(truncated)
Gremlin Server is running and I try to start NEO4J Server then I get the following error
Caused by: org.neo4j.kernel.StoreLockException: Store and its lock
file has been locked by another process:
/home/galaxia/Documents/neo4j-gremlin/data/databases/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)
Versions
Neo4J 3.3.1
Gremlin 3.3.1
I realize it has been a while, but I finally figured this out and thought others should know. As Stephen Mallette said, you can use the Bolt implementation. To configure this for Gremlin Server, use the included gremlin-server-neo4j.yaml file and make the following change:
graphs: {
graph: conf/neo4j-bolt.properties}
Then create the neo4j-bolt.properties file with this content:
gremlin.graph=com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph
#neo4j.graph.name=graph.db
neo4j.identifier=dummy
neo4j.url=bolt://localhost:7687
neo4j.username=neo4j
neo4j.password=<password>
neo4j.readonly=false
neo4j.vertexIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider
neo4j.edgeIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider
Remember to replace the password, and any other property with the correct values.
You cannot run them together that way (i.e. embedded mode), but it should be possible to run them together, if you either:
Configure the Neo4j graph in Gremlin Server to use HA mode as described here
Configure the Neo4j graph in Gremlin Server to use the Bolt implementation found here
Enable the Bolt protocol in the Neo4j properties file provided to Gremlin Server.
As an example of the third option, given the default Gremlin Server packaged configuration files for Neo4j, you can edit conf/neo4j-empty.properties to include:
gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/tmp/neo4j
gremlin.neo4j.conf.dbms.connector.0.type=BOLT
gremlin.neo4j.conf.dbms.connector.0.enabled=true
gremlin.neo4j.conf.dbms.connector.0.address=localhost:7687
and then start Gremlin Server with bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml at which point you can use standard TinkerPop drivers as well as standard Bolt connectivity against the same graph instance.
I am new at NoSQL graphs databases. I am learning Neo4J with Java througth https://spring.io/guides/gs/accessing-data-neo4j/.
How can I see my nodes that I created by Java at the http address http://localhost:7474/browser/ ?
That guide uses an embedded Neo4j instance, which is accessible within the Java application. Specifically, this code:
#Bean
GraphDatabaseService graphDatabaseService() {
return new GraphDatabaseFactory().newEmbeddedDatabase("accessingdataneo4j.db");
}
is creating an embedded Neo4j instance in the current working directory with the name accessingdataneo4j.db. To use the Neo4j Browser you'll need to run Neo4j Server. Follow the instructions here to download and install Neo4j.
If you are using the Mac or Windows desktop application you can select the location for the embedded database your created previously - just point the "Database Location" to the location of accessingdataneo4j.db that you created and start the server. Then you can access the Neo4j Browser at http://localhost:7474
If you are not using the desktop application you can set the location of the database directory in conf/neo4j-server.properties:
org.neo4j.server.database.location=/path/to/accessingdataneo4j.db