How to connect neo4j with bolt protocol in gremlin-server? - neo4j

I want to run gremlin-server and neo4j together.
So I make to run neo4j docker image in my machine, and try to connect it with BOLT protocol.
Could anyone help to configure .yaml/.property file in gremlin-server for this?
Used version | gremlin-server 3.4.0 & neo4j 3.2.3

The configuration options for the Graph instance property file can be found here. I'm not sure what the minimum requirements are for this provider, but from a TinkerPop perspective you need to at least specify the Graph instance with gremlin.graph and then include whatever other configurations you need to connect:
gremlin.graph=com.steelbridgelabs.oss.neo4j.structure.Neo4jGraphFactory
neo4j.hostname=...
neo4j.port=...
Then in the Gremlin Server yaml file you just reference the path to the above property file.
graphs: {
graph: conf/bolt.properties}

Related

How to connect to neo4j on remote server using cytoscape neo4j plugin

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

Create Neo4j database dump with JQAssistant

I want to create a dump of the database that JQAssistant creates with a scan. So far i have tried to do this with the integrated server and by connecting jqassistant to a running database.
The problem with the integrated database is that i can't access a shell and therefore i don't know how i could create the dump.
Connecting to the running database also didn't work. I assume the problem here is the encryption, my server is running local and trying to connect to it with
jqassistant.sh scan -f my-project.jar -storeUri bolt://localhost:7687 -storeUsername neo4j -storePassword secret
which is the example from the jqa tutorial throws the error:
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
so i assume i can't connect without ssl encryption.
I am using Neo4j server 3.5.15 and JQAssistant Commandline Tool version 1.9 which uses an integrated Neo4j 3.5.14 server.
If you can give me an new idea how to create a data dump out of the scan or how to fix one of the two given problems i would appreciate that a lot!
Thanks in advance!
I couldn't figure out a way to export the database with the commandline tool, but with the maven plugin. If you setup a maven project and include jqassistant as a plugin it offers you the option "export-database" which creates a Cypher script.

Attaching a Vagrant-hosted Gremlin-Server as a Data Source in PhpStorm

I am running the Gremlin-Server from this Tinkerpop Docker Image within a Vagrant box. I am trying to link this server as a data source so that I can utilize the "Graph Database Console" plugin in PhpStorm. I am attempting to do this through the driver wizard workflow.
However, in the class dropdown it won't give me any configuration options other than java.sql.Driver. It does give me the option of connecting custom driver files, but I am not sure which file I would need to attach from the Gremlin-Server docker image.
What steps would it take to connect a Gremlin-Server as a data-source in PhpStorm?
As it turns out, the TinkerPop3 stack does not offer a JDBC Driver, as it is not neccessarily a database in-and-of itself. There is a SQL port of Gremlin which is purportedly working on a JDBC driver for Gremlin-Server, but there is no option to currently reference a local hosted Gremlin-Server.
However in this instance there is a plugin for PhpStorm called Graph Database Support which allows you to then configure a Local Graph Database by pointing to your local environment and port. In my case it was a Vagrant IP address and a forwarded Docker port which meets that need.

Have both Gremlin-Server AND NEO4J Server running at the same time

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.

How to secure Neo4J replication?

I need to secure the replication data stream between two Neo4J nodes (eg. using SSL or TLS). Both are running in embedded mode in two JBoss instances.
Is it possible and how can I do that ?
Thanks
AFAIK Neo4j replication is not encrypted by itself. The most easy way would be connecting the cluster members using a VPN (e.g. using openvpn) and configure Neo4j to use the virtual network interface provided by the VPN.
An alternative might be stunnel.
Update:
there is a nice blog post on using openvpn for encrypting Neo4j cluster replication by John Russell. Please note that this uses Neo4j <= 1.8, in Neo4j 1.9.x there is no Zookeeper any more.

Resources