Skip to main content
Loading
Version: Graph 2.2.0

Install Aerospike Graph Service

Overview

This page describes how to install Aerospike Graph Service (AGS) in a Docker container for use with an Aerospike database.

Prerequisites

  • An Aerospike feature key file which has the graph-service key enabled. Click here to sign up for an AGS trial, or contact your Aerospike account manager.

  • A running Aerospike Database instance, version 6.2.0.7 or later. You can use an existing instance, or start one in a Docker container. See Install with Docker to set up an Aerospike Database with Docker.

  • Verify the IP address of your Aerospike database. If you are running Aerospike in a Docker container, get the IP address with the following command:

    docker inspect -f  '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' AEROSPIKE-CONTAINER-ID
  • Replace AEROSPIKE-CONTAINER-ID with the Docker container ID of your Aerospike container.

Run AGS with Docker

  1. Download the AGS Docker image. Docker is a containerization service.

    Pull from Docker:

    docker pull aerospike/aerospike-graph-service

    OR

    Pull from the Google Container Registry:

    docker pull gcr.io/aerospike-prod/aerospike-graph-service
  2. Run the AGS Docker container.

    docker run -p8182:8182 -e [OPTIONS] aerospike/aerospike-graph-service

    The options you pass to your Docker command specify how AGS will connect to your Aerospike database and what kind of indexes to create. For a complete list of available options, see Configuration Options.

    You can either specify configuration options with a properties file (recommended) or with environment variables using Docker command-line arguments.

    In the following example, the AGS Docker image runs with these configuration options:

    aerospike.client.namespace: test
    aerospike.client.host: aerospike-devel-cluster-host1:3000, aerospike-devel-cluster-host2:3000
    aerospike.graph.index.vertex.properties: property1, property2
    aerospike.graph.index.vertex.label.enabled: true
    docker run -p8182:8182 -e aerospike.client.namespace="test" \
    -e aerospike.client.host="aerospike-devel-cluster-host1:3000, aerospike-devel-cluster-host2:3000" \
    -e aerospike.graph.index.vertex.properties=property1,property2 \
    -e aerospike.graph.index.vertex.label.enabled=true \
    aerospike/aerospike-graph-service

    Java options

    Aerospike Graph is constrained by the amount of memory available to the Java Virtual Machine (JVM) in its Docker container, which is 80% of memory available to the Docker container by default. You can set the amount of memory available to the JVM by setting the aerospike.graph-service.heap.max and aerospike.graph-service.heap.min configuration options.

    In the following example, the Docker container's JVM can use up to 32GB of memory:

    docker run -p 8182:8182 \
    -e aerospike.graph-service.heap.max="32768m" \
    -e aerospike.client.host="172.17.0.1" \
    aerospike/aerospike-graph-service

    To use other Java options, set the JAVA_OPTIONS Docker environment variable with the -e command line argument. For example, to set the javax.net.ssl.trustStore option:

    -e JAVA_OPTIONS=" -Djavax.net.ssl.trustStore=/data/certs/Platinum/myTrustStore"
    note

    The leading space before the Java option is required.

    Properties file options

    You can run the AGS Docker image with a properties file named aerospike-graph.properties. Create it and store it locally. Reference it when you start the AGS Docker image.

    The following properties file uses options equivalent to those in the Docker command:

    aerospike.client.host=aerospike-devel-cluster-host1:3000, aerospike-devel-cluster-host2:3000
    aerospike.client.namespace=test
    aerospike.graph.index.vertex.label.enabled=true
    aerospike.graph.index.vertex.properties=property1,property2

    To use a properties file when running the AGS Docker image, use the -v flag to create a volume bind. In the following example, the full path to the properties file is /home/graph-user/graph/conf/aerospike-graph.properties.

    The filepath after the :, /opt/aerospike-graph/aerospike-graph.properties, is the corresponding properties file in the AGS Docker container.

    docker run -p 8182:8182 \
    -v /home/graph-user/graph/conf/aerospike-graph.properties:/opt/aerospike-graph/aerospike-graph.properties \
    aerospike/aerospike-graph-service

    Expected output

    The AGS Docker container runs a Gremlin server instance, so you will see some Gremlin server initialization messages after the container starts. The messages look similar to the following:

    Server config:

    aerospike.client.host=172.17.0.1
    aerospike.client.port=3000
    aerospike.client.namespace=test
    aerospike.graph.data.model=packed

[INFO] o.a.t.g.s.GremlinServer - 3.6.3 \,,,/ (o o) -----oOOo-(3)-oOOo-----

[INFO] o.a.t.g.s.GremlinServer - Configuring Gremlin Server from /opt/aerospike-graph/conf/docker-default/aerospike-gremlin-server.yaml [INFO] o.a.t.g.s.u.MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms ... ... ... [INFO] o.a.t.g.s.GremlinServer$1 - Channel started at port 8182.


If you've successfully completed these steps, you're ready to start using AGS.
See [Basic usage](/docs/graph/getting-started/basic-usage) to get
started on interacting with your graph data.