Running Neo4j Community on AWS


(M. David Allen) #1

I wanted to share an article I wrote recently for community members about how to use AMIs we provide on Amazon.

Get up and running quickly with the Neo4j VM Image on AWS

I'd love to get people's feedback on this. We're actively working on improving the documentation and writing technical articles, to make it easy to use Neo4j anywhere in the cloud.

(A Bramson) #2

Let's say I've built a graph database on my local machine. And let's say I've managed to follow the instructions and create a Neo4j Community Instance on AWS (but don't otherwise know anything about how to use AWS). How would/could I load the database from my local machine onto my AWS instance? I managed to figure out how to create a dump of my database from Stack Exchange, but I don't know what to do from there.

Also, the easiest way to run code to build the network seems to be using AWS's Cloud9 online IDE. So instructions for using that to connect to the graph database (e.g., using Python) would be very helpful.


(M. David Allen) #3

@a_bramson for community, some of the standard backup/restore tools don't apply (those are in enterprise) so generally to make a copy of a graph database we do this:

  • Shut the database down
  • Create a copy of the entire /var/lib/neo4j/data directory
  • Zip that, move it to the target machine where you want to restore
  • Unzip
  • Restart database.

(Ben Butler Cole) #4

@a_bramson You should be able to do neo4j-admin dump to avoid fiddling around on the filesystem directly. This produces a single-file dump which can be loaded elsewhere with neo4j-admin load.

(A Bramson) #5

@ben.butler-cole Yes, this is what I have been doing to create and restore backups locally. So the remaining question is: "Where do input the that load command?" I've not used AWS yet, but my understanding is that there won't be an interface like the Neo4j Desktop (which raises another question about accessing something like the Neo4j Browser for a database running on AWS), so I don't know where the appropriate terminal will was actually quite difficult to get useful information on thie dump-load process for the desktop version, and I haven't found any info for doing this on AWS.

(M. David Allen) #6

@a_bramson you would input that command in an SSH terminal session.

Given that you've started an AMI on AWS, at the time of your AMI creation you needed to choose an SSH key to communicate with your instance. Follow AWS directions to SSH to that instance, and then you can run sudo neo4j-admin dump along the lines that Ben recommends.

(Ben Butler Cole) #7

I expect that neo4j-admin is in your path on the EC2 instance. To run neo4j-admin load then Neo4j must stopped and you must run as the neo4j user.

(Ninth Mind) #8

I followed your instructions, but I still can't connect to my instance. I double checked that the security group was correct (ports 7473, 7474, 7687, 22,), I tried all sorts of usernames (neo4j, ubuntu, root), i used the PublicDNS and the Public IPv4, i chmod 400 my .pem file, I tried deploying another instance, and in no circumstance am I able to connect!

Any ideas?

(Ninth Mind) #9

Found my problem! It was the VPC Subnet Routing table was configured wrong. These docs helped me:
Specifically the part that said "Check the route table for the subnet."

Troubleshooting Connecting to Instance