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

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?

Related

pgAdmin-4 container connected to PostgreSQL server at boot

I am running pgAdmin-4 as a docker container alongside my PostgreSQL deployment (in docker containers as well).
I am able to connect to the WebUI and manually add the DB server, getting access to all the needed information.
Is there any way to make the pgAdmin container automatically connected to my PostgreSQL server without the need for a manual configuration after the launch?
Thank you
You can export & save the list of servers details in a JSON file and after starting your instance you import that into pgAdmin4. See export/import servers.
Then you can map the resulted JSON file in the docker as mentioned in the documentation.

Switch active database with Neo4j docker image

I have imported my data to a new Neo4j database instead of the standard graph.db using import tool. I want to switch this database to web Neo4j. I used Neo4j docker image with /var/lib/neo4j volume. But I can't find my config file to change the active database, even after I mount conf directory specifically this file doesn't get generated.
How can I switch active Neo4j database in web client or neo4j shell?
Here is the command with which I created neo4j container:
docker run --publish=7474:7474 --publish=7687:7687 --volume=/var/lib/neo4j/import:/var/lib/neo4j/import --env=NEO4J_dbms_allow_upgrade='true' --env=NEO4J_dbms.security.allow_csv_import_from_file_urls='true' neo4j:latest
You cannot change the active database of a live Neo4J instance.
Enterprise edition does allow for some values to be changed without rebooting; the keys allowed to be changed this way are listed at the online documentation, but dbms.active_database is not one of them.
Instead, you have a few options.
You can mount a /conf directory
The conf directory can be filled with configuration files that will completely override the default ones. They are not generated by Neo4J, you must take an entire neo4j.conf file and place it in the directory which is then mounted to the container. You can change whatever values you need to in that file.
After the mapped directory is updated with the new file, you will need to bounce your image (or exec a bounce of neo4j from within the image).
You can set the active database with an environment variable
Similar to how you've passed in the other environment variables, you can pass in other configuration options. If your new database was called newgraph.db and it resided in the same directory as graph.db, you would need only to pass in --env=NEO4J_dbms_active__database=newgraph.db. If it resides in a different directory, give that directory with --env=NEO4J_dbms_directories_data=/path/to/new/data/dir.
As these are passed as environment variables, changing them requires starting a new Docker image.
You could also build your own image.
The final and perhaps most drastic option would be to create your own image that is based off of neo4j's image and has all of the changes that you need. Typically, this would not be required, but if you want to clean up your invocation of docker and not keep around any mapped configuration directories, this is the way to go. It would also ensure anybody who has your custom image needs no additional configuration; whether this is desirable is up to you and your deployment architecture.

mongooseim cluster setup eacces error on ubuntu 14.04

We are trying to create master-master cluster of two mongooseim instances on AWS in same virtual network..
All necessary ports are opened in AWS security group.
I suspect some issue with mongooseim setup on Ubuntu 14.04 LTS
After running join_cluster command on one of the node we get error as follows ( refer screenshot )
Error: {error,{badmatch,{error,eacces}}}
Attached screenshot with details.
Server configuration was not changed except vm args as shown in attached screenshot.
is this an issue with your binary ? or some other glitch ?
I ran into this issue myself. Mongoose uses erlangs internal mnesia storage system for a lot of information including cluster topology. The default path for mnesia's storage is /var/lib/mongooseim. When you do a mongooseimctl join_cluster ... it needs to wipe it's mnesia store and basically pulls a copy from the cluster it's joining. The issue arises because it also tries to delete /var/lib/mongooseim itself, which it won't have permissions to do because the running user mongooseim won't have permissions of the parent directory, /var/lib. Nor should it.
The way I fixed this was by creating a subdirectory which it could safely delete and recreate and configuring it to use that as it's mnesia directory:
sudo mkdir /var/lib/mongooseim/mnesia
sudo chown mongooseim:mongooseim /var/lib/mongooseim/mnesia
Configuration for the mnesia directory exists by default in /etc/mongooseim/app.config. In mine it was the third line. Originally looked like this:
{mnesia, [{dir, "/var/lib/mongooseim"}]},
I changed the path to the new directory I created
{mnesia, [{dir, "/var/lib/mongooseim/mnesia"}]},
After that, I stopped and started mongoose and was successfully able to join the cluster
mongooseimctl stop
mongooseimctl start && mongooseimctl started
mongooseimctl join_cluster mongooseim#other.node.name

Running neo4j on same server with different port

I am running two neo4j instance on one server but with different port. I changed port in neo4j.conf file, I am able to run it properly.
Now, when I execute the cypher query to create a node in the second instance from neo4j-shell, it is creating nodes in first instance.
I have not configured any database path. Assuming it will consider neo4j default database path i.e. data\databases\graph.db.
Please help me with my mistake.
I see a few option of neo4j-shell and It has -port. You can change it with used port or you review property such as path, file, config.
You should text ./neo4j-shell -help to see them.

Neo4j server failed to start in openshift

I want to create a social network in django framework in Openshift then I need at least a graph db (like Neo4j)and a relational db (like Mysql). I had trouble in add Neo4j to my project because openshift has not any cartridge for it. then I decide to install it with DIY, but I don't understand the functionality of start and stop files in .openshift/action hooks.Then I doing the following steps to install neo4j on server:
1.ssh to my account:
ssh 1238716...#something-prolife.rhcloud.com
2.go in a folder that have permission to write (I go to app-root/repo/ and mkdir test in it) and download the neo4j package from here. and extract it to the test folder that I created before :
tar -xvzf neo4j-community-1.9.4-unix.tar.gz
3.and finally run the neo4j file and start it:
neo4j-community-1.9.4/bin/neo4j start
but I see these logs and can't run the neo4j:
process [3898]... waiting for server to be ready............ Failed
to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
how can I run this database in openshift ? where I am wrong ? and where is the logs in please check the logs?
I've developed an openshift cartridge that fixes the permission issue in openshift. I had to change the class HostBoundSocketFactory and SimpleAppServer in neo4j just to bind without using the 0 port, but using an openshift available port.
You can check at: https://github.com/danielnatali/openshift-neo4j-cartridge
it's working for me.
I would also not place it in the app-root/repo but instead I would put it in app-root/data.
You also need to use the IP of the gear - I think the env. variable is something like OPENSHIFT_INTERAL_IP. 127.0.0.1 is not available for binding but I think the ports should be open.
There are 2 ways neo4j can run : embedded or standalone(exposed via a rest service).
Standalone is what you are trying to do. I think the right way to setup neo4j would be by writing a cartridge for openshift, and then add the cartridge to your gear. There has been some discussion about this, but it seems that nobody has taken the time to do this. Check https://www.openshift.com/forums/openshift/neo4j-cartridge. If you decide to write your own cartridge, i might assist. Here are the docs: https://www.openshift.com/developers/download-cartridges.
The other option is running in embedded mode, which i have used. You need to set up a Java EE application(because neo4j embedded mode libraries are available only with java), and put the neo4j libraries in your project. Then, you would expose some routes, check for parameters and run your neo4j queries inside the servlets.

Resources