OpenJDK 17 + Cassandra 5.0.2 + Prometheus JMX exporter fully configurable through env's
5.6K
Current version: Cassandra v5.0.2, now with more configurability through the envs!
Due to myriad of different licenses employed here, please take a look at the summary detailed here.
START_RPC to true to enable it)Since we're not using that awful Oracle JRE we can just skip the license agreement for now.
You don't need to make your images basing off this one.
cassandra.yaml will be set as you set particular environment variables.
Just set envs as needed. See Dockerfile and entrypoint.py for details.
This exports three volumes -
Best mount them as bind.
Recommended options are --network host --privileged, althrough passing the external host
IP in BROADCAST_ADDRESSes and using auto for normal addresses works fine with a bridge network.
Any arguments passed to the entry point will be called as through a Cassandra was called. Any extra arguments
will be passed there, after a cassandra -f.
Set ADDRESS_FOR_ALL for a variable that will replace all _ADDRESS.
Following env's values will be placed in cassandra.yaml verbatim (ie, withouting quotes)
ADDRESS_FOR_ALL was given, in that case it will take precedence)In general, if it's found in cassandra.yaml with a dollar sign preceding it, it is safe to assume that environment variable with a given name will be substituted for it.
If you need quotes, bring them with you. See for example how CLUSTER_NAME is set.
To enable JMX [without SSL] set the environment variable LOCAL_JMX to no, and the environment variable JMX_REMOTE_PASSWORD to target remote password.
This way you will have two users created - monitorRole with read-only permissions, and controlRole
with read-write JMX permissions, both having the password that you set.
Following env's would be nice to have, but are not required:
Jolokia is enabled by default and listens on port 8080. If you define the env DISABLE_JOLOKIA
t won't be loaded.
This simply launches cassandra with a -f flag, and passes any extra arguments to that cassandra.
This container spots a built-in healthcheck. It is done by invoking "nodetool status" and seeing it's exit code.
This assumes that 30 minutes will be a sufficient time for your Cassandra to get up and read it's commit logs and initialize.
If this is not the case, start the container with suitable docker run --health-start-period.
To enable health check just set the environment variable HEALTHCHECK_ENABLE to 1.
If you choose not to enable the health check, the container will be always marked as healthy.
In order to enable Jaeger tracing just define the envs JAEGER_AGENT_HOST, and optionally
JAEGER_AGENT_PORT, which is 6831 by default.
Note that this uses our custom
version of cassandra-jaeger-tracing.
In order to trace spans that don't fit within an UDP packet (you'll see lots of logs saying that frame is too large), just define an env called JAEGER_ENDPOINT that will point directly to collector, eg. http://jaeger_collector:14268/api/traces. In this case you don't need to set either JAEGER_AGENT_HOST and JAEGER_AGENT_PORT.
Not setting any of these will result in Cassandra's tracker being used.
If you invoke this container with a single argument of "bash", it will drop you to a shell without starting anything.
If you set an env called EXTRA1 it will get automatically appended to cassandra-env.sh, producing an extra line of:
JVM_OPTS="$JVM_OPTS ${EXTRA1}"\n
You can add any number, starting from numbering them EXTRA1, without any limit.
It's important that they are consecutive numbers. These will simply enlarge your JVM_OPTS. You can for example
use it to replace a dead node.
To use the G1 Garbage Collector just define an env called GC and set it to "G1".
The default garbage collector in Concurrent Mark & Sweep.
Assertions are disabled by default in order to provide a modest speed-up. To enable them, use an
env called ENABLE_ASSERTIONS and set it to 1.
GC can be logged to:
not logged (default value of LOG_GC=none)LOG_GC=file)LOG_GC=stdout)Content type
Image
Digest
Size
483.1 MB
Last updated
over 5 years ago
docker pull smokserwis/cassandra