Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-15-2019 06:14 PM
If I deploy Neo4j on AWS EC2, Is it possible to use Neo4j Browser to access neo4j and run Cypher queries? I ask because my code to create nodes and relationships and query them is all in Cypher. I have been using my own laptop so far, but the next dataset is huge, and might require more RAM/storage, so I need to use EC2 for this.
If it is possible, would appreciate if anyone has any links/resources that help with deploying neo4j on ec2 and access it using Neo4J Browser.
Many Thanks.
04-15-2019 10:14 PM
Definitely possible. I run my Neo4j on EC2 all the time. Change the config file to be accessible to non-local, i.e. - 0.0.0.0 (you should see the line for it ). Change EC2 to have elastic IP and be publicly accessible. If you are behind a firewall make sure you can ssh into the EC2, should allow you to hit it from http://<my.elastic.ip.address>:7474/browser. you can either set up a neo4j service as seen by https://neo4j.com/docs/operations-manual/current/installation/linux/debian/ or just create a tmux session and run NEO4J_HOME/bin neo4j console.
You can also leave it local and if you can ssh into the instance then just run NEO4J_HOME/bin cypher-shell, although I normally change the default password via the browser. BTW, EBS-optimized instances suck for normal writing and reading, even on large machines with big IOPS. Best to use the instance storage SSD even though they are ephemeral and then back up the tar gz the graph.db and save to an EBS if you need to snapshot your data.
07-16-2019 11:22 AM
Hi Benjamin,
I encountered a similar situation and I came across your answer. I think your answer should be the solution but I got stuck somewhere. I'd really appreciate if you could share your perspectives.
Background:
I set up a Neo4j database on AWS EC2 following this tutorial:
What I tried:
By following your answer, I ssh to the instance, but I cannot find the "NEO4J_HOME" folder. All the files I can see is:
"licensing", "pre-neo4j.sh", "reset-password-aws.sh".
Am I doing something wrong here? Would you please share more insight?
Thanks in advance!
07-16-2019 11:32 AM
Depending on what distro you have it might be different.
My Home folder is /var/lib/neo4j.
cd /var/lib/neo4j should direct you to the Neo4j Home holder
To run cypher from a shell script/ cypher script, you need to find the bin folder in Neo4j_home and then you can pipe the script into cypher-shell as follows
cat myscript.cypher | bin/cypher-shell -u neo4j -p mypassword
07-16-2019 01:57 PM
Hi Benjamin,
Thanks for the timely response! I have a follow-up question: I couldn't even find the "/var" folder.
Here's what I did:
Connect to the EC2 instance by:
"ssh -i Neo4j-AWS-Key.pem ubuntu@ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com"
Execute "ls" and here's what I got:
It looks like completely empty... Nothing there.
However, I can connect to the browser from "http://<my.elastic.ip.address>:7474/browser".
Am I doing something stupid here? Thanks!
07-16-2019 02:40 PM
According to the link you shared they have the following information: https://neo4j.com/developer/neo4j-cloud-vms/
It says it the conf file should be located at /etc/neo4j/neo4j.conf
try cd /var/lib/neo4j
That should change your to the home directory. Other than that I am not sure.
You can navigate your file system/folders with cd
if you run cd ..
it will bring to the folder above, if you run cd ../../..
eventually you will get to the root folder. Hope that helps.
07-16-2019 04:26 PM
Hi Benjamin.
Thanks so much for the help!!! I found the home folder by cd /var/lib/neo4j
(previously I thought cannot do this because I didn't see the var
folder).
However, there is no bin
folder in the directory.
I found the bin
folder here: cd /usr/bin
, from which I found the cypher-shell
.
I don't know why there's no bin
folder in the home directory though...
I think I should be able to pipe the script into the shell script then. THANKS SO MUCH for your help!!!
04-16-2019 04:43 PM
Absolutely. The docs have great installation instructions for Linux. After you install it, make sure you have these lines set in your /etc/neo4j/neo4j.conf
:
dbms.connectors.default_listen_address=0.0.0.0 # Listen for remote connections
dbms.connector.bolt.enabled=true
dbms.connector.https.enabled=true
I would recommend setting dbms.connector.http.enabled=false
so you're not sending credentials and data over the wire in plaintext — use https
on port 7473 instead. You don't need to worry about the certificate warnings, your connection is encrypted even with a self-signed cert (created by default, so you don't even need to do that yourself).
08-17-2022 03:16 AM
What do you mean by automatically? Is the self-signed-cert created by neo4j when starting it with HTTPS enabled ?
I just installed on Ubuntu and I am having trouble getting the .conf to take effect. I restart neo4o after each change, but it is quite random what config settings seem to be active. Perhaps I am missing something. Mayne it takes longer time for the conf to take effect or something. If I enable https, regular http stop working, but only sometimes. Very weird.
All the sessions of the conference are now available online