Kafka Neo4j Connect - using bolt+routing protocol - neo4j

I'm trying to change the protocol from bolt to bolt+routing in the Kafka Neo4j Connector configuration. However I'm facing the error
"trace":"java.lang.IllegalArgumentException: Invalid address format bolt+routing\n\tat org.neo4j.driver.internal.Scheme.validateScheme(Scheme.java:46)\n\tat org.neo4j.driver.internal.SecuritySettings.createSecurityPlan(SecuritySettings.java:64)\n\tat org.neo4j.driver.GraphDatabase.driver(GraphDatabase.java:138)\n\tat streams.kafka.connect.sink.Neo4jService.<init>(Neo4jService.kt:83)\n\tat streams.kafka.connect.sink.Neo4jSinkTask.start(Neo4jSinkTask.kt:29)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:308)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:199)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:185)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:235)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.-bash-4.3$ ps aux | grep java^C hread.run(Thread.java:748)\n"}
After reviewing somethings and I get confused on Neo4j Drivers. Currently there are 2 neo4j driver: Neo4j JDBC Driver and Neo4j Java Driver. I only see Neo4j JDBC Driver supports bolt+routing, but the Neo4j Java Driver doesn't. I see Sink Connector is using Neo4j Java Driver, wondering how we can use bolt+routing in Sink Connector.
TIA

Related

Trying to connect to Neo4j Desktop using py2neo and receiving ``ServiceUnavailable: Cannot connect to any known routers`" when I run a query

I renamed the existing example database from Movies RDBM to Movies and changed the password to pwd.
from py2neo import Graph
db=Graph("neo4j://neo4j:pwd#localhost:7687", name="Movies" )
No errors for the above
db.run("MATCH (n:Movie) RETURN n").to_table()
The above fails with
ServiceUnavailable: Cannot connect to any known routers
what am I doing wrong ?
I was using WSL and Jupyter Notebooks but Neo4j was running in Windows so 127.0.0.1 was pointing to the WSL loopback and there was nothing there to receive the API calls

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

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}

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 use Cassandra ODBC driver in delphi?

I want to connect to a Cassandra Database from my Delphi application. I found that there is a DataStax OBDC driver. But I didn't found any examples explaining how to connect Cassandra Database from Delphi using ODBC driver.
How to connect Cassandra database from delphi using this ODBC driver?

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