getsocial-rnd / neo4j-aws-ha-cluster

Neo4j Enterprise HA Cluster on AWS ECS
Apache License 2.0
13 stars 3 forks source link
aws ecs high-availability neo4j

DEPRECATED due to the deprecation of Neo4j HA clustering, please consider using getsocial-rnd/neo4j-aws-causal-cluster

neo4j-aws-ha-cluster

A setup for HA (High-Availability) deployment of a Neo4j Enterprise cluster on top of AWS ECS.

You can obtain Neo4j from the official website. Please contact sales@neo4j.com for Enterprise licensing.

Includes:

Features

Prerequisites:

How does it work?

Infrastructure

Neo4j graph database is deployed as a highly-available (HA) cluster with master-slave replication. 

It uses Bolt – a highly efficient, lightweight binary client-server protocol designed for database applications.

Essentially it's a Neo4j cluster with a minimum of 2 nodes (use at least 3 for HA), which is split logically into 2 ECS clusters (yet still it's 1 Neo4j cluster):

A Read-Write cluster with one master node and multiple slaves:

A Read-only cluster with one slave node:

Ports open:

  - HTTP(s): 7473, 7474
  - Bolt: 7687

Usage

  1. Create an ECR repository for Neo4j custom images. You will use it's ARN. (ARN looks like arn:aws:ecr:us-east-1:123456789012:repository/neo).

  2. Save environment variable for use in makefile (customize them first)

    $ export NEO_ECR_REPO=<paste here ARN of your ECR repo>
    $ export NEO_AWS_REGION=<your AWS region>
  3. Build Docker image and push it to your ECR:

    $ make build
    $ make push_image
  4. Feel free to modify cloudformation.yml in any way you like before spinning up infrastructure, however most of the things are customizable via parameters.

  5. Create a Cloud Formation stack using cloudformation.yml.

    During this step you will define all the resources you need and configure Docker image with Neo4j for ECS. Please make sure to set 2 tags for your stack (on "Options" page):

    Name: <how you name your stack>
    Environment: <your env name, e.g production>

Upgrade version

Please see detailed instructions to upgrade using this CF template.

Known Problems

TODO

* Parametrize autoscaling.
* Allow disabling slave-only more for simplest 1-node setups.