/ec2neo

CloudFormation Templates for deploying Neo4j

Primary LanguageRuby

NEO4J on AWS EC2

About

CloudFormation templates that bootstrap Neo4j onto an Amazon AWS EC2 machine, in Amazon Linux or Ubuntu flavours. These will install the stable version of Neo4j.

It's intended to help application developers get up and running quickly with Neo4j, without in-depth experience of Linux servers, AWS, or installing databases like Neo4j. It is not indended for long term use: it doesn't use durable storage.

What you'll get:

  • A Neo4j Enterprise installation, with a username and password of your choosing.
  • Using the OpenJDK JVM
  • There's no backup (but they do write to an Amazon EBS volume)

It runs in all current (January 2014) Amazon Regions. It uses Amazon Security Groups to optionally secure the database.

Cost

If you use this tool, you'll be creating a "stack" of the following on Amazon AWS:

  • One EC2 server (you choose the size)
  • One Elastic IP address
  • 100 GB of EBS storage
  • One security group

Amazon will charge the cost for all this to your credit card on an hourly basis, from when you start the stack, until you stop the stack. Please look up the pricing calculator if you're concerned about the hosting cost.

Pre-requisites

To use this tool you'll need:

  • An AWS account, with credentials, and credit card on file
  • An EC2 key pair, in the US-EAST zone (which is the default)
  • A browser
  • If you want to restrict access to the database, you'll want to know what IP address range to restrict it to. You can easily find that.

Choosing an OS

We support 2 Operating Systems:

  • Amazon Linux is based on Red Hat Linux, and the stable release of Neo4j will be supported.
  • Ubuntu Linux is an easy to use Linux distribution, and we recommend you use this if you're not sure which to choose.

Usage

  • Log onto the AWS CloudFormation console with your AWS account.
  • Click Create New Stack
  • Fill in the Stack Name field (whatever name you'd like)
  • Click the Provide a template URL radio button
  • Paste the Amazon Linux Template or the Ubuntu Template into the field next to the button
  • Click the Create button
  • Fill in the 3 parameters.
    • The SSHKeyName parameter is the name of your EC2 Key pair (we suggested NEO4J)
    • The Network Whitelist allows you to control access to your database. You can restrict it to your own IP address using the /32 suffix. The default (0.0.0.0/0) will allow connections from anywhere on the public Internet.
    • The Instance Type lets you choose the size of machine to use.

Parameters

  • Click Continue button
  • You can optionally add tags to help identify your stacks. Click Continue button.
  • You may review your options here. Click Continue button.
  • Your stack is now being created. Click the Close button.
  • Click the Refresh button on the top right hand side of the CloudFormation view until your stack is complete. You should see the image below:

Completed Stack

  • The running Neo4j server may not immediately be available.
  • The Output tab will show you the endpoint of the Neo4j server (see below). Click on it, and when prompted for password, enter the password that you chose in pre-requisites.

Stack Output

  • Configure your application to talk to the endpoint.

Storage

The Neo4j database is stored on an Amazon EBS volume. Right now, that volume is removed when the CloudFormation stack is removed. We may change this in a future release.

Backups

We write daily gzipped backups to the Amazon ephemeral storage (/mnt). We'll probably change this in due course.

Decomissioning

If you're done using your Neo4j installation, you can delete the stack from the AWS CloudFormation console.

Troubleshooting

Why might this go wrong?

  • Resources are sometimes not available at Amazon. That's just part of our brave new cloudy world. Right now the templates will attempt to use the first availability zone in the region.
  • It's hard to legally and reliably get the Oracle JVM onto the system. So we're using OpenJDK. This should not cause issues, but Neo4j may complain on start. You can safely ignore that message.
  • Sometimes, something will happen that we cannot predict. We'd appreciate your help here; a GitHub issue or email to the Mailing List with some smart questions or observations.

How to see detail:

  • You can use the Get System Log feature of EC2 to see the output of this template.

  • If you're on the Amazon Linux template, you can SSH onto the machine and type '''cat /var/log/cfn-init.log'''.