Cassandra Installation with Helm: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
=Overview= | =Overview= | ||
This article refers to the bitnami Cassandra chart. | |||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
Line 17: | Line 19: | ||
==JVM Heap Parameters== | ==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 | |||
<syntaxhighlight lang='bash'> | |||
JVM_OPTS="-Xmx=2G -Xms=2G -Xmn=1G" | |||
</syntaxhighlight> | |||
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: | Add the following to the configuration overlay: | ||
<syntaxhighlight lang='yaml'> | <syntaxhighlight lang='yaml'> | ||
extraEnvVars: | extraEnvVars: | ||
- name: | - name: MAX_HEAP_SIZE | ||
value: '- | value: '4G' | ||
- name: HEAP_NEWSIZE | |||
value: '1G' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
The | 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. |
Latest revision as of 02:27, 12 January 2021
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.