Installation

Instructions for installing Model9 Gravity in an on-premise environment.

Introduction

The following guides provides details on how to install and configure the Model9 Gravity application.

Prerequisites

  • 8 vCPU, 32gb RAM instance, 1TB of storage (preferably SSD).

    • AWS instance types:

      • m5d.2xlarge

      • m5ad.2xlarge

    • docker is expected to be installed on the instance.

      • A user with docker privileges will be required for running docker commands.

Installation

Depending on the system's configuration, root access might be required for some steps. Using a root user for the installation is recommended.

Download Model9 Gravity installation package file

Obtain the Model9 Gravity installation package from Model9 and move it to the target installation system.

The recommended location for the package files on the installation system is:

/data/model9/gravity/packages

Prepare installation

Set version environment variable

export GRAVITY_VERSION=<version>

In the snippet above, <version> represents the package version number. E.g., "1.0.0".

Exported environment variables will be used by the following installation steps.

Extract the package file

export GRAVITY_PACKAGES=/data/model9/gravity/packages
cd $GRAVITY_PACKAGES
tar -xzvf model9-gravity-package-$GRAVITY_VERSION.tar.gz
export GRAVITY_EXTRACTED=$(pwd)/model9-gravity-$GRAVITY_VERSION
export GRAVITY_BUILD=$(cat $GRAVITY_EXTRACTED/build-id.txt)

Create installation target folder structure

export GRAVITY_HOME=/data/model9/gravity
mkdir -p $GRAVITY_HOME/config
mkdir -p $GRAVITY_HOME/keys
mkdir -p $GRAVITY_HOME/logs
mkdir -p $GRAVITY_HOME/work

$GRAVITY_HOME/work is the work directory used by the service for data processing. It should be mounted on a block-device on which enough space is available.

Create Model9 Gravity PostgreSQL database container

A user with docker privileges or root access will be required for the following steps.

Create docker network bridge

docker network create gravity-bridge

Load the PostgreSQL docker image

docker load --input $GRAVITY_EXTRACTED/postgres-14.2-x86.docker.gz

Run docker PostgreSQL container

docker run --detach \
    --net gravity-bridge \
    --volume $GRAVITY_HOME/db/data:/var/lib/postgresql/data:z \
    --publish 0.0.0.0:5432:5432 \
    --name gravitydb \
    --restart unless-stopped \
    --env POSTGRES_PASSWORD=model9 \
    --env POSTGRES_DB=gravitydb postgres:14.2

model9 is chosen here as the default database password.

Create database

docker exec gravitydb psql -h 127.0.0.1 -p 5432 -U postgres -c 'CREATE DATABASE gravity;'

Configure Model9 Gravity

Copy key stores into the $GRAVITY_HOME/keys folder

cp $GRAVITY_EXTRACTED/keys/* $GRAVITY_HOME/keys

The key stores provided in the package include the default self-signed Model9 certificates for setting up TLS in the Gravity service. If required, these key stores can be replaced with key stores provided by the organization.

Create the Model9 Gravity configuration file

cp $GRAVITY_EXTRACTED/application.properties $GRAVITY_HOME/config

After creating the application.properties file edit it and fill in the missing values:

vi $GRAVITY_HOME/config/application.properties

vi is usually available by default on Linux systems. If more convenient, other editors such as nano can also be used.

# ----------------------------------------
# Model9 Gravity Configuration
# Documentation: https://docs.model9.io
# Support: support@model9.io
# ----------------------------------------
model9.gravity.global.license-key=
logging.level.io.model9=INFO

If the default database password has been changed, use the model9.gravity.datasource.password configuration option to change it.

For details of the configuration options and their default values, see the Configuration page.

Start the Model9 Gravity service

Load the Model9 Gravity docker image

docker load --input $GRAVITY_EXTRACTED/model9-gravity-$GRAVITY_VERSION-build-$GRAVITY_BUILD.docker.gz

Start the Model9 Gravity container

docker run --detach --publish 443:443 \
    --net gravity-bridge \
    --volume $GRAVITY_HOME/config:/data/model9/config:z \
    --volume $GRAVITY_HOME/keys:/data/model9/keys:z \
    --volume $GRAVITY_HOME/logs:/data/model9/logs:z \
    --volume $GRAVITY_HOME/work:/data/model9/work:z \
    --env "TZ=America/New_York" \
    --env "JAVA_OPTS=-Xmx28g" \
    --restart unless-stopped \
    --name model9gravity-v$GRAVITY_VERSION model9/gravity:$GRAVITY_VERSION.$GRAVITY_BUILD
  • Change the TZ environment variable as appropriate.

  • Change the -Xmx value to reflect the amount of available memory for the service (in GBs) - Remember to leave a few free GBs for the operating system.

  • 443 is the default secure port, if running the service on another port, this value should be changed as well.

Last updated