{"id":20994013,"url":"https://github.com/michelderu/docker-compose-stargate-traefik","last_synced_at":"2026-05-06T19:33:10.961Z","repository":{"id":80119646,"uuid":"339999552","full_name":"michelderu/docker-compose-stargate-traefik","owner":"michelderu","description":"Scalable Cassandra + Stargate + Traefik combination using docker-compose","archived":false,"fork":false,"pushed_at":"2021-05-06T15:08:57.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T08:49:27.653Z","etag":null,"topics":["cassandra","docker-compose","scaleable","stargate","traefik"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michelderu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-18T09:32:36.000Z","updated_at":"2023-07-25T10:47:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb4b921e-54ed-4a3e-81e4-8d44006ab725","html_url":"https://github.com/michelderu/docker-compose-stargate-traefik","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelderu%2Fdocker-compose-stargate-traefik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelderu%2Fdocker-compose-stargate-traefik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelderu%2Fdocker-compose-stargate-traefik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelderu%2Fdocker-compose-stargate-traefik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michelderu","download_url":"https://codeload.github.com/michelderu/docker-compose-stargate-traefik/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243410230,"owners_count":20286387,"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","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":["cassandra","docker-compose","scaleable","stargate","traefik"],"created_at":"2024-11-19T07:16:28.210Z","updated_at":"2025-12-25T19:43:49.709Z","avatar_url":"https://github.com/michelderu.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scalable docker-compose with Cassandra and Stargate, loadbalanced by Traefik\nThis project aims to create a scalable (up and down) environment for Cassandra and Stargate.  \nCassandra is globally accepted as the most reliable and scalable database delibering single-digit-millisecond performance.  \nStargate is a developer friendly gateway to Cassandra that offers REST, Document and GraphQL APIs.\n\nStorage (Cassandra) and Stargate (Compute) can be separately scaled up and down. Traefik is used to load balance any number Stargate instances.\n\n## Traefik host name\nTraefik will listen to the hostname `stargate.localhost` for loadbalancing Stargate requests. In order for this to work, you might need to extend your `/etc/hosts` file as follows:\n```\n##\n# Host Database\n#\n# localhost is used to configure the loopback interface\n# when the system is booting.  Do not change this entry.\n##\n127.0.0.1\tlocalhost\n127.0.0.1\tstargate.localhost\n```\n\n## Scripted startup\nThere are two scripts provided to startup the cluster.\n- `start-c1s1t1.sh` will start the cluster with 1 node of Cassandra, 1 node of Stargate and 1 node of Traefik\n- `start-c3s2t1.sh` will start the cluster with 3 nodes of Cassandra, 2 nodes of Stargate and 1 node of Traefik\n\nCassandra is configured with a maximum heap size of 4 GB. Stargate with a heapsize of 2 GB but will mostly use 1 GB.\n\nAfter startup `docker stats` will be started for insight in resource consumption.\n\n## Manual startup\nIt is also possible to run the cluster using `docker-compose` in a manual way.\n\n### Startup 1 Cassandra, 1 Stargate and 1 Traefik container\nStart Cassandra ans Traefik:\n```sh\ndocker-compose up -d cassandra traefik\n```\nWait for Cassandra to startup, this can be checked by waiting for `\"Startup complete\"` to appear in the logs:\n```sh\ndocker logs docker-compose-stargate-traefik_cassandra_1\n```\nNow startup Stargate:\n```sh\ndocker-compose up -d stargate\n```\nWait for Stargate to startup, this can be checked by waiting for `\"Finished starting bundles\"` to appear in the logs:\n```sh\ndocker logs docker-compose-stargate-traefik_stargate_1\n```\n\n### Scale up \nNow that you have a cluster running with 1 Cassandra, 1 Stargate and 1 Traefik node, you can scale-up Storage (Cassandra) and Compute (Stargate) separately from each other.\n\nIt is best practise to scale up one-by-one, waiting for the container to start and settle.\n\n#### Scale up Cassandra\nIn order to scale Cassandra, use:\n```sh\ndocker-compose up -d --scale cassandra=\u003cn\u003e cassandra\n```\nReplace `\u003cn\u003e` with the amount of containers to run. Remember to scale one-by-one starting with 2 and check the log:\n```sh\ndocker logs docker-compose-stargate-traefik_cassandra_\u003cn\u003e\n```\nReplace `\u003cn\u003e` with the current scale.\n\n#### Scale up Stargate\nIn order to scale Stargate, use:\n```sh\ndocker-compose up -d --scale stargate=\u003cn\u003e stargate\n```\nReplace `\u003cn\u003e` with the amount of containers to run. Remember to scale one-by-one starting with 2 and check the log:\n```sh\ndocker logs docker-compose-stargate-traefik_stargate_\u003cn\u003e\n```\nReplace `\u003cn\u003e` with the current scale.\n\n## Understanding the cluster\nCassandra nodes are responsible for storage. Stargate nodes are responsible for handling the compute for the API endpoints.  \nThis is also shown through the token ring cluster as follows:\n- Cassandra nodes are shown through `nodetool status` as nodes running in the dc/rack. They should al be `UN` (Up and Normal)\n- Stargate nodes connect themselves to the token ring also but have a specialization to not store data. They can be shown through `nodetool describecluster`. The new nodes compared to the previous command will be the stargate nodes.\n- To double check, you can compare the IP adresses with the Stargate containers using `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' docker-compose-stargate-traefik_stargate_\u003cn\u003e`\n\n## Test performance using JMeter\nDownload JMeter from https://jmeter.apache.org/download_jmeter.cgi and unpack in the current directory.  \nRun the test in CLI mode:\n```sh\n./apache-jmeter-5.4.1/bin/jmeter -n -t ingest.jmx -l results.csv -e -o ./results\n./apache-jmeter-5.4.1/bin/jmeter -n -t ingest-serverless.jmx -l results-serverless.csv -e -o ./results-serverless\n```\n\n## Run cqlsh\n```sh\ndocker exec -it docker-compose-stargate-traefik_cassandra_1 cqlsh\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelderu%2Fdocker-compose-stargate-traefik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichelderu%2Fdocker-compose-stargate-traefik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelderu%2Fdocker-compose-stargate-traefik/lists"}