High Availability Deployment

In a single-node deployment all services run on one host. For high availability, Energy SOAR Base can run on multiple nodes that share a Cassandra cluster and an Elasticsearch cluster. Each component that must change for a clustered deployment is listed below.

Component

Single-node

HA

Energy SOAR Base database

Cassandra (single host)

Cassandra cluster (multiple hosts)

Energy SOAR Base search index

Lucene (local) or Elasticsearch

Elasticsearch (required; Lucene is single-node only)

File attachment storage

Local filesystem (/opt/energysoar/files)

HDFS or S3-compatible object store

Energy SOAR Workflow database

SQLite

PostgreSQL

Energy SOAR Automation

Single instance, shared Elasticsearch

Multiple instances, shared Elasticsearch

Energy SOAR Base

Every Base node in the cluster must use the same play.http.secret.key. Copy the value from /etc/energysoar/secret.conf on the first node to all other nodes before starting them.

Database

Edit /etc/energysoar/application.conf.d/database.conf on each node. Replace the single hostname with the list of all Cassandra nodes and switch the index backend to Elasticsearch:

db.janusgraph {
  storage {
    backend: cql
    hostname: ["10.0.0.1", "10.0.0.2", "10.0.0.3"]
    cql {
      cluster-name: energysoar
      keyspace: energysoar
      read-consistency-level: ONE
      write-consistency-level: ONE
    }
  }
  index {
    search {
      backend: elasticsearch
      hostname: ["10.0.0.1", "10.0.0.2"]
      index-name: energysoar
      elasticsearch {
        bulk-refresh: wait_for
      }
    }
  }
}

The cluster-name value must match the cluster_name setting in cassandra.yaml on all Cassandra nodes.

File storage

Local filesystem storage (provider: localfs) is specific to one node and cannot be shared. Replace it with HDFS or S3.

HDFS:

storage {
  provider: hdfs
  hdfs {
    root: "hdfs://namenode:10000"
    location: "/energysoar"
    username: energysoar
  }
}

S3-compatible (MinIO or AWS S3):

storage {
  provider: s3
  s3 {
    bucket: energysoar
    readTimeout: 1 minute
    writeTimeout: 1 minute
    chunkSize: 1 MB
    endpoint-url: "http://minio:9000"
    aws {
      credentials {
        provider: static
        access-key-id: "ACCESS_KEY"
        secret-access-key: "SECRET_KEY"
      }
      region {
        provider: static
        default-region: "us-east-1"
      }
    }
  }
}

Energy SOAR Workflow

Replace the embedded SQLite database with PostgreSQL by adding the following environment variables to /etc/energysoar/n8n.env:

DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=10.0.0.4
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=password

Restart the energysoar service after editing the file.

Energy SOAR Automation

Multiple Automation instances can run against the same Elasticsearch cluster. Point each instance to the shared Elasticsearch nodes in /etc/cortex/application.conf:

search {
  uri = "http://10.0.0.1:9200,10.0.0.2:9200"
}

Backup in HA mode

The backup.sh script requires Cassandra credentials when authentication is enabled on the cluster. Pass the -H flag to enable HA mode:

CASS_USER=energysoar CASS_PASS=password /opt/energysoar/lib/extra/backup.sh -H -a

-H switches Cassandra export from an unauthenticated cqlsh call to an authenticated one using the provided credentials. The -a flag runs a full backup (configuration and data).