Neo4j import on Docker - docker

I am trying to use the Neo4j-import tool to bulk import csv files into a new neo4j database. I can successfully perform this but for the dockerized neo4j to recognize it, I need to restart the docker. Is there any way to do this without having to restart the container? I have tried using the cypher csv import but that for some reason doesn't support the large dataset ~76k relationships

Related

Copying neo4j graph from local machine to VM

I want to copy my entire neo4j graph(all nodes and relationships) created so far from my local machine(windows) to VM(windows). Is there any way I can achieve the same. Please advise.
You can create a dump of the database and restore the database dump in the VM. Other than that, you can use APOC to export the node and relationship information and import it in your VM. For more information about the APOC procedures to export and import data you can take a look at the documentation: https://neo4j.com/labs/apoc/4.3/export/
The easiest way:
Stop the neo4j service on both local machine and VM.
copy the /data/ folder with all its content to the new location.
Start the neo4j service in the new location.

Import data from CSV file to InfluxDB

I have huge data in a CSV file. I have a use case to import that CSV data to influxDB. I have 2 Linux AWS machines where Influx DB is installed in one machine and Graphite is installed in another machine. I will have my CSV data in the machine where Graphite is installed. Can someone please help me how to import data from CSV to Influx DB. I had gone through various articles for the solution. I could find the solution if both InfluxDB and Graphite is in same machine. But in my case both are in different machines.
I used the HTTP-API in combination with the line protocol, shoul also work for you, maybe with some reformatting
curl -i -XPOST "http://localhost:8086/write?db=mydb" --data-binary #txtfilewithlineprotocol.csv
https://docs.influxdata.com/influxdb/v1.8/tools/api/
https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/

How to run a Neo4j Destop graph database from command line?

I created two graph db's with Neo4J Desktop.
Now I want to run them at the same time, on different ports.
The two databases have been saved by Neo4j Desktop respectively in the folders:
Neo4j\ Desktop/Application/neo4jDatabases/database-1/installation-3.5.5/
Neo4j\ Desktop/Application/neo4jDatabases/database-2/installation-3.5.5/
Looking at the settings in the Neo4j Desktop (the neo4j.conf file), the first graph uses the ports 11213, 11214 and 11215.
The second uses the default ports.
I downloaded neo4j-community to run it from the command line on OSX.
I navigated to the neo4j-community folder and tried to run the first database with the following command:
sudo bin/neo4j -console -path Neo4j\ Desktop/Application/neo4jDatabases/database-1/installation-3.5.5
Now it starts a db, however it is not the db specified: first of all it is empty and secondly it is not using the custom ports specified in the configuration file.
How to run a neo4j graph database created with Neo4j Destop with the bin/neo4j command line executable?

Using Gremlin-Client container and Gremlin-server with neo4j

sorry to bother you. I am trying to set up an ecosystem for a graph database that is going to be used by an application.
I am going to use the gremlin-client container:
Gremlin-Console docker
Also i am going to use gremlin-server container:
Gremlin-Server container
And finally i want to use the neo4j container as the storage layer:
Neo4j container
I have read all the docker-files and i was able to connect the console with the server. But now i need to connect the gremlin server container to the neo4j container. I have several links on the web but i was not able to complete this task. It gives me an error of server failure when i tried to connect to neo4j through gremlin-server by running the gremlin-server.sh file .
I have downloaded the repository in order to change the docker-file to fit my needs. Does anyone has experience and knows the correct procedure on how to accomplish the connection between the neo4j container with the gremlin server container and making queries through the gremlin console container?
Please any help would be really appreciated.
Thanks in advance,
Juan Ignacio
Since you want to use Neo4j Server you're basically asking how to connect Gremlin Server to a Neo4j Server which was asked in this question. You must 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
Once you have Gremlin Server connected to Neo4j Server you can then connect Gremlin Console to Gremlin Server through "remoting" discussed here.
In your comments below, you alluded to the fact that you really just want to use Gremlin Console with Neo4j. I brought up the options above because you referenced use of Docker containers and specifically Neo4j Server. Note that you can get going very quickly with Neo4j in embedded mode directly in the Gremlin Console which is discussed in detail here. In that case there is no need for Docker, Neo4j Server, etc.
If you must use Neo4j Server/Docker for some reason and connect to it from the Gremlin Console, then you will still go with one of the two options discussed above, either (1) HA Mode or (2) neo4j-gremlin-bolt but you would simply create those Graph instances in Gremlin Console. For HA mode, that would mean the Gremlin Console would effectively become a node in the Neo4j cluster and for neo4j-gremlin-bolt your Graph instance would just connect over the Bolt protocol.

Connecting a local gephi instance to a remote titan server

Here is the scenario I want to resolve: I have two environments: a local machine and a virtual machine hosted in Azure
In the virtual machine I start a gremlin container which includes the gremlin client, server and connects to a cassandra graph database.
This is the information of the container running when i run the docker container ls command:
CONTAINER ID: 029095e26f53
IMAGE: 3f03c6bfb0a2
COMMAND: "/bin/sh -c /gremlin…"
CREATED: 2 weeks ago
STATUS: Up 2 weeks
PORTS: 0.0.0.0:8182->8182/tcp
NAME: gremlin
When I enter inside the container, I run the following command in order to run the gremlin client:
./bin/gremlin.sh
Once inside the gremlin console i run the following command to connect to the tinkerpop server:
:remote connect tinkerpop.server conf/remote.yaml
==>Connected - localhost/127.0.0.1:8182 ---> answer from gremlin console
If I run the following gremlin query:
:> g.V().count()
I get a number different from zero, telling me that there are a records on the graph database.
Now on the other side I have the Gephi client on my local machine which I want it to be able to show that graph database. Or at least, make Gephi to show the the visual data from a
graph = TinkerFactory.createModern()
running inside the gremlin container.
I want to do this because I need to choose a visualization tool for gremlin and titan ecosystem.
I tried to set up Gephi client feature to connect to the virtual machine's ip and the port 8182 but it shows me the red dot telling me that is not possible. What am i missing? I am pretty sure there are a few steps missing. Thanks in advance,
Juan Ignacio
If your graph is "remote" and not in-memory in the Gremlin Console then you have to devise a way to make it available locally that way. This situation is typical for Graphs that run in Gremlin Server or are wholly remote like CosmosDB, DSE Graph or Amazon Neptune.
They typical method to make it available locally is to use [subgraph()][1]-step to pull out just the portion of the graph that you care about and return that to the Gremlin Console. It will be returned as a TinkerGraph for graphs that support subgraph()-step (like Titan, though I assume you would use JanusGraph), so for your test which is using TinkerFactory and a tiny graph you could just do this:
gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml
Note the configuration of "remote-objects.yaml" because that configuration will return actual objects - an actual TinkerGraph rather than a string representation of a TinkerGraph.
gremlin> :> TinkerFactory.createModern()
That will create the "modern" graph remotely and return the TinkerGraph to the Gremlin Console. You can access that result
gremlin> graph = result[0].object
The :> stores the response from the server in a variable named "result" and that contains your TinkerGraph in a List. This is explained in the reference documentation. From there you can use that "graph" object as you would using the standard Gephi instructions.

Resources