Cassandra Installation with Helm

From NovaOrdis Knowledge Base
Revision as of 02:27, 12 January 2021 by Ovidiu (talk | contribs) (→‎JVM Heap Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Internal

Overview

This article refers to the bitnami Cassandra chart.

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-release bitnami/cassandra

Configuration

JVM Heap Parameters

Java heap parameters (-Xmx, -Xms and -Xmn) are controlled for both the main cassandra process and for nodetool process (which is used by the liveness probe, and thus, is important to work well) by three environment variables:

  • JVM_OPTS
  • MAX_HEAP_SIZE
  • HEAP_NEWSIZE

While it is possible to set

JVM_OPTS="-Xmx=2G -Xms=2G -Xmn=1G"

if you do so, you must also keep the values of MAX_HEAP_SIZE and HEAP_NEWSIZE synchronized, otherwise clashing combinations of values may materialize for the cassandra or nodetool processes, and they may fail.

The best way to set the heap related values is to use MAX_HEAP_SIZE and HEAP_NEWSIZE.

Add the following to the configuration overlay:

extraEnvVars:
  - name: MAX_HEAP_SIZE
    value: '4G'
  - name: HEAP_NEWSIZE
    value: '1G'

The values defined here will take precedence and will override the values calculated by the startup scripts.

If MAX_HEAP_SIZE is set, cassandra startup script will automatically adjust the -Xms to the same value.