Herkese merhaba!

Uzun yıllardır bol miktarda kişisel zaman ve enerji harcayarak bilgimizi hepinizle paylaşıyoruz. Ancak şu andan itibaren bu blogu çalışır durumda tutabilmek için yardımınıza ihtiyacımız var. Yapmanız gereken tek şey, sitedeki reklamlardan birine tıklamak olacaktır, aksi takdirde hosting vb. masraflar nedeniyle maalesef yayından kaldırılacaktır. Teşekkürler.

Tekli ve çoklu Cassandra kümeleri oluşturmak için aşağıdaki örnekleri kullanabilirsiniz.


Tekli Küme


version: "3.7"

services:

blog-cassandra:
image: "cassandra:3.11.9"
container_name: "blog-cassandra"
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"

Container


     Name                   Command               State                               Ports
------------------------------------------------------------------------------------------------------------------------
blog-cassandra docker-entrypoint.sh cassa ... Up 7000/tcp, 7001/tcp, 7199/tcp, 0.0.0.0:9042->9042/tcp, 9160/tcp

Nodetool Durumu


$ docker exec -it blog-cassandra nodetool status

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 172.24.0.2 70.68 KiB 256 100.0% f0011962-19e0-488e-9f4f-cb25481ef7aa rack1

Çoklu Küme


version: "3.7"

services:

cassandra-1:
image: "cassandra:3.11.9"
container_name: "cassandra-1"
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
- "CASSANDRA_SEEDS=cassandra-1,cassandra-2"

cassandra-2:
image: "cassandra:3.11.9"
container_name: "cassandra-2"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
- "CASSANDRA_SEEDS=cassandra-1,cassandra-2"
depends_on:
- "cassandra-1"

cassandra-3:
image: "cassandra:3.11.9"
container_name: "cassandra-3"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
- "CASSANDRA_SEEDS=cassandra-1,cassandra-2"
depends_on:
- "cassandra-2"

Container


   Name                  Command               State                               Ports
---------------------------------------------------------------------------------------------------------------------
cassandra-1 docker-entrypoint.sh cassa ... Up 7000/tcp, 7001/tcp, 7199/tcp, 0.0.0.0:9042->9042/tcp, 9160/tcp
cassandra-2 docker-entrypoint.sh cassa ... Up 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
cassandra-3 docker-entrypoint.sh cassa ... Up 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp

Nodetool Durumu


$ docker exec -it cassandra-1 nodetool status
$ docker exec -it cassandra-2 nodetool status
$ docker exec -it cassandra-3 nodetool status

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 172.25.0.3 75.74 KiB 256 66.9% bf167974-7248-49d5-b60e-55988af5e9ef rack1
UN 172.25.0.2 90 KiB 256 65.2% 803da76a-41cb-415d-8acb-11cc7f7b6f69 rack1
UN 172.25.0.4 90.01 KiB 256 67.8% 51d21a7c-c65c-470a-8deb-2065b0bd2b67 rack1