{"id":23657756,"url":"https://github.com/smok-serwis/cassandra","last_synced_at":"2026-02-13T22:02:37.984Z","repository":{"id":61772970,"uuid":"93230471","full_name":"smok-serwis/cassandra","owner":"smok-serwis","description":"Docker image: OpenJDK 17 + Cassandra 5.0.2 + Prometheus JMX exporter fully configurable through env's + tracing with Jaeger","archived":false,"fork":false,"pushed_at":"2024-12-22T21:52:01.000Z","size":230454,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T13:22:17.746Z","etag":null,"topics":["docker-image"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/smokserwis/cassandra/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smok-serwis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T07:12:28.000Z","updated_at":"2024-12-22T21:52:05.000Z","dependencies_parsed_at":"2024-12-22T18:33:08.497Z","dependency_job_id":null,"html_url":"https://github.com/smok-serwis/cassandra","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/smok-serwis/cassandra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smok-serwis%2Fcassandra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smok-serwis%2Fcassandra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smok-serwis%2Fcassandra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smok-serwis%2Fcassandra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smok-serwis","download_url":"https://codeload.github.com/smok-serwis/cassandra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smok-serwis%2Fcassandra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273099827,"owners_count":25045697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image"],"created_at":"2024-12-28T21:57:31.168Z","updated_at":"2026-02-13T22:02:37.925Z","avatar_url":"https://github.com/smok-serwis.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenJDK 17 + Cassandra 5.0.2 + Prometheus JMX exporter + Jolokia exporter + jemalloc2 + Jaeger tracing \n \nCurrent version: [Cassandra v5.0.2](https://github.com/smok-serwis/cassandra/releases/tag/5.0.2), \nnow with more configurability through the envs!\n\nDue to myriad of different licenses employed here, please take a look at\nthe [summary detailed here](/LICENSE.md).\n\nIf you're migrating from Cassandra 4, just scroll to the bottom.\n\n## Ports it listens on\n\n* 7199 - JMX\n* 7198 - Prometheus metrics exporter\n* 9042 - Native transport\n* 7000 - Internode communications\n* 9160 - Thrift client (disabled by default, set env `START_RPC` to `true` to enable it)\n\n## Volumes of interest\n\n* _/var/lib/cassandra_ - data partition\n* _/var/lib/cassandra/commitlog_ - commitlog partition\n* _/var/lib/cassandra/logs_ - logs\n* _/var/lib/cassandra/heapdump_ - heap dumps in case Cassandra crashes\n\n## Usage\n\nSince this uses OpenJDK 17, you do not need to set anymore any weird environment variables. Just enjoy!\nG1 garbage collector is enabled by default.\nYou don't need to make your images basing off this one.\n`cassandra.yaml` will be set as you set particular environment variables.\nJust set envs as needed. See [Dockerfile](/Dockerfile) and [entrypoint.py](/entrypoint.py) for details.\n\nThis exports three volumes - \n1. for data (_/var/lib/cassandra_),\n2. for commitlog (_/var/lib/cassandra/commitlog_),\n3. for logs (_/var/log/cassandra_)\n\nBest mount them as bind.\n\nRecommended options are `--network host --privileged`, althrough passing the external host\nIP in _BROADCAST_ADDRESSes_ and using _auto_ ONLY for normal addresses works fine with a bridge network.\n\nNEVER USE _auto_ if HOST NETWORKING IS ENABLED!\n\nAny arguments passed to the entry point will be called as through a Cassandra was called. Any extra arguments\nwill be passed there, after a `cassandra -f`.\n\nOr, if you pass `bash` command, a bash shell will be set for you with required envs.\n\n## Parameters\n\nFor the love of God, disable ADDRESS_FOR_ALL while setting up a second or third node. It sets SEED_NODES to point to \nthis node. It's also deprecated.\n\nSet `ADDRESS_FOR_ALL` for a variable that will replace all _ADDRESS.\n\nFollowing env's values will be placed in _cassandra.yaml_ verbatim (ie, withouting quotes)\n* **BROADCAST_ADDRESS**, **LISTEN_ADDRESS**, **RPC_ADDRESS**, **RPC_BROADCAST_ADDRESS**\n* **CLUSTER_NAME** (will be automatically escaped with quotes), default is _Test Cluster_\n* **SEED_NODES** - list of comma separated IP addresses to bootstrap the cluster from\n\nIn general, if it's found in [cassandra.yaml](/etc/cassandra/cassandra.yaml) with a dollar sign preceding it, it is safe to assume\nthat environment variable with a given name will be substituted for it.\n\nIf you need quotes, bring them with you. See for example how `CLUSTER_NAME` is set.\n\n## Extra parameters for [RTFM](etc/cassandra/cassandra.yaml)\n\nNote that where sizes are required, you should postfix them with MiB or KiB. Where tiems are requires, use milliseconds (ms)\n\n* **NUM_TOKENS** - by default 256, but take care\n* **START_RPC** - whether to start classic Cassandra Thrift RPC. Default is _false_, but you might wish to use _true_\n* **RPC_PORT** - port to which start Thrift RPC, if it is requested.\n* **DISK_OPTIMIZATION_STRATEGY** - pass _spinning_ or _ssd_, any other option will fail with an error. Default is _ssd_\n* **ENDPOINT_SNITCH** - endpoint snitch to use, by default it's _SimpleSnitch_\n* **AUTHENTICATOR** - by default _AllowAllAuthenticator_, can use also _PasswordAuthenticator_\n* **AUTHORIZER** - by default _AllowAllAuthorizer_, can use also _CassandraAuthorizer_\n* **PARTITIONER** - partitioner to use, by default _org.apache.cassandra.dht.Murmur3Partitioner_\n* **ROW_CACHE_SIZE** - row cache size to use. By default is 0MiB, which means disabled.\n* **TOMBSTONE_WARN_THRESHOLD** and **TOMBSTONE_FAIL_THRESHOLD** - there's no unit. [RTFM](etc/cassandra/cassandra.yaml)\n* **COLUMN_INDEX_SIZE** - [RTFM](etc/cassandra/cassandra.yaml), default is 64KiB\n* **BATCH_SIZE_FAIL_THRESHOLD** - maximum size of the batch that Cassandra will fail. Unit is KiB. [RTFM](etc/cassandra/cassandra.yaml)\n* **BATCHLOG_REPLAY_THROTTLE** - maximum speed at which commit log will be replayed. Default is 512 MiB, which means 512 MiB/s.\n* **REQUEST_SCHEDULER** - defaults to _org.apache.cassandra.scheduler.NoScheduler_\n* **READ_REQUEST_TIMEOUT** - defaults to _5000ms_\n* **RANGE_REQUEST_TIMEOUT** - defaults to _10000ms_\n* **STREAM_THROUGHPUT_OUTBOUND** - defaults to _25MiB/s_\n* **WRITE_REQUEST_TIMEOUT** - defaults to _2000_\n* **MAX_HEAP_SIZE** - defaults to _48g_\n* **NEW_HEAP_SIZE** - defaults to _10g_ **don't confuse with HEAP_NEWSIZE**!!\n* **COUNTER_WRITE_REQUEST_TIMEOUTS** - defaults to _5000ms_\n* **JMX_AUTH** - defaults to _yes_, set to _no_ to disable JMX auth\n* **CAS_CONTENTION_TIMEOUT** - defaults to _2000ms_\n* **TRUNCATE_REQUEST_TIMEOUT** - defaults to _60000ms_\n* **REQUEST_TIMEOUT** - defaults to _15000ms_\n* **COMPACTION_THROUGHPUT** - defaults to _64MiB/s_\n* **MAX_HINT_WINDOW** - defaults to _3h_\n* **ENABLE_USER_DEFINED_FUNCTIONS'** - defaults to _false_\n* **ENABLE_SCRIPTED_USER_DEFINED_FUNCTIONS** - defaults to _false_\n* **COMMITLOG_SEGMENT_SIZE** - size of a commit log segment. Defaults to 32MiB.\n* **DISABLE_PROMETHEUS_EXPORTER** - if set, Prometheus' exporter will be disabled\n* **KEY_CACHE_SIZE** - default is *auto*, unit is MiB\n* **FILE_CACHE_SIZE** - size of chunk cache, unit is MiB\n* **COMMITLOG_TOTAL_SPACE** - space to use for commit log. Please specify the values, the defaults are difficult to explain.\n* **COMMITLOG_SYNC** - [RTFM](etc/cassandra/cassandra.yaml). Defaults to _periodic_\n* **MEMTABLE_HEAP_SIZE** - size of heap size for memtables. Default is 1024MiB. Postfix it with MiB please.\n* **MEMTABLE_OFF_HEAP_SIZE** - size of off-heap memtables. Default is 512MiB. Postfix it with MiB please.\n* **STORAGE_COMPATIBILITY_MODE** - one used for updating. Please read the end of this article. Default is None (bootstrap in a Cassandra 5 cluster)\n\n## Enabling JMX\n\nTo enable JMX [without SSL] set the environment variable _LOCAL_JMX_ to _no_, and the\nenvironment variable _JMX_REMOTE_PASSWORD_ to target remote password.\n\nThis way you will have two users created - `monitorRole` with read-only permissions, and `controlRole`\nwith read-write JMX permissions, both having the password that you set.\n\nIF you want JMX to bind to a specific interface, define `JMX_ADDRESS`.\n\n## Optionals\n\nFollowing env's would be nice to have, but are not required:\n\n* **CASSANDRA_DC** - name of this DC that Cassandra is in. _dc1_ by default.\n* **CASSANDRA_RACK** - name of the rack that Cassandra is in, _rack1_ by default.\n\n## Jolokia\n\nJolokia is enabled by default and listens on port 8080. If you define the env `DISABLE_JOLOKIA` \nt won't be loaded.\n\n## Extra arguments\nThis simply launches cassandra with a -f flag, and passes any extra arguments to that cassandra.\n\n## Health check\n\nThis container spots a built-in healthcheck. It is done by invoking \"nodetool status\" and seeing it's exit code.\nThis assumes that 30 minutes will be a sufficient time for your Cassandra to get up and read it's commit logs and initialize.\nIf this is not the case, start the container with suitable `docker run --health-start-period`.\n\nTo enable health check just set the environment variable `HEALTHCHECK_ENABLE` to `1`.\n\nIf you choose not to enable the health check, the container will always be marked as healthy.\n\n# Disabling Prometheus exporter\n\nJust define an env called `DISABLE_PROMETHEUS`.\n\n# Enabling Jaeger tracing\n\nIn order to enable Jaeger tracing just define the envs `JAEGER_AGENT_HOST`, and optionally\n`JAEGER_AGENT_PORT`, which is 6831 by default.\n\nNote that this uses [our custom](https://github.com/smok-serwis/cassandra-jaeger-tracing)\nversion of `cassandra-jaeger-tracing`.\n\nIn order to trace spans that don't fit within an UDP packet (you'll see lots of logs saying that frame is too large),\njust define an env called `JAEGER_ENDPOINT` that will point directly to collector, eg. `http://jaeger_collector:14268/api/traces`.\nIn this case you don't need to set either `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT`.\n\nNot setting any of these will result in Cassandra's tracker being used.\n\n\n# Bash\n\nIf you invoke this container with a single argument of \"bash\", it will drop you to a shell\nwithout starting anything.\n\n## Extra JVM_OPTS\n\nIf you set an env called **EXTRA1** it will get automatically appended to [cassandra-env.sh](/cassandra-env.sh),\nproducing an extra line of:\n```bash\nJVM_OPTS=\"$JVM_OPTS ${EXTRA1}\"\\n\n```\nYou can add any number, starting from numbering them EXTRA1, without any limit.\nIt's important that they are consecutive numbers. These will simply enlarge your `JVM_OPTS`. You can for example\nuse it to [replace a dead node](https://docs.datastax.com/en/archived/cassandra/3.0/cassandra/operations/opsReplaceNode.html).\n\n## Enabling assertions\n\nAssertions are disabled by default in order to provide a modest speed-up. To enable them, use an\nenv called `ENABLE_ASSERTIONS` and set it to `1`.\n\n## Logging GC\n\nGC can be logged to:\n\n* `not logged` (default value of `LOG_GC=none`)\n* file /var/log/cassandra.gc (`LOG_GC=file`)\n* standard output (`LOG_GC=stdout`)\n\n\n## correct sysctl settings\n\n* vm.max_map_count = 1048575\n* echo 8 \u003e /sys/block/sda/queue/read_ahead_kb for the drive storing Cassandra data\n\n\n# Migrating to Cassandra 5\n\nRemember to change the env of `JAVA_HOME` to `/usr/lib/jvm/java-11-openjdk-amd64`!\n\nFor every node:\n\n    1. Stop it\n    2. Check that environment variables match (they changed a lot, they added units, this README details them all)\n    3. Set `STORAGE_COMPATIBILITY_MODE` to `UPGRADING`\n    4. Start the node, wait for it to join the cluster.\n    5. Run `nodetool upgradesstables` on all SSTables that this node has.\n\nNow for every node:\n\n    1. Stop it\n    2. Change `STORAGE_COMPATIBILITY_MODE` to `NONE`\n    3. Start it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmok-serwis%2Fcassandra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmok-serwis%2Fcassandra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmok-serwis%2Fcassandra/lists"}