dockerizing_cassandra/README.md

93 lines
1.8 KiB
Markdown
Raw Normal View History

2024-07-24 15:03:39 +02:00
dump:
dump requires nodetool
in prod, nodetool is in /usr/bin/
in dev environment, cassandra has been installed manually and nodetool is not in the path
* dev should be aliegned to prod
https://medium.com/@kayvan.sol2/deploying-apache-cassandra-cluster-3-nodes-with-docker-compose-3634ef8345e8
2024-07-24 15:03:39 +02:00
## DOCKER instructions
2024-07-24 15:03:39 +02:00
aggiungere a /etc/host l'entry:
127.0.0.1 cassandra
start composer:
`docker compose up --build`
force recreate docker image
`docker compose build --no-cache`
2024-07-24 15:03:39 +02:00
check status:
2024-10-15 16:48:20 +02:00
`docker exec -it cassandra1 nodetool status`
## import db
`./dump.sh`
`docker compose up --build`
2024-07-24 15:03:39 +02:00
attendere che tutto sia pronto e i db siano sincronizzati
2024-07-24 15:03:39 +02:00
TODO: definire esattamente come, tendenzialmente con nodetool status , nodetool gossip, etc
eseguire uno dopo l'altro, quando sono terminati
2024-10-15 16:48:20 +02:00
```sh
docker exec -it cassandra1 /scripts/setup.sh
docker exec -it cassandra2 /scripts/setup.sh
docker exec -it cassandra3 /scripts/setup.sh
```
flush before switch off
```sh
docker exec -it cassandra1 nodetool flush
docker exec -it cassandra1 nodetool flush
docker exec -it cassandra1 nodetool flush
```
2024-07-24 15:03:39 +02:00
run a single service:
2024-10-15 16:48:20 +02:00
* cassandra1: `docker compose up cassandra1 --build`
* cassandra2: `docker compose up cassandra2 --build`
2024-07-24 15:03:39 +02:00
* ,...
2024-10-15 16:48:20 +02:00
cqlsh client:
`docker exec -it cassandra1 cqlsh cassandra1 -k dev_keyspace_1`
2024-07-24 15:03:39 +02:00
open bash on server
2024-10-15 16:48:20 +02:00
* cassandra1: `docker exec -it cassandra1 bin/bash`
2024-07-24 15:41:02 +02:00
* cassandra2: `docker exec -it cassandra2 /bin/bash`
* cassandra3: `docker exec -it cassandra3 /bin/bash`
2024-07-24 15:03:39 +02:00
## check cassandra status
Check status
`nodetool status`
Check if the Gossip protocol is enabled
`nodetool info | grep -i gossip`
Check the status of the Gossip protocol
`nodetool gossipinfo`
Check the communication between nodes
`nodetool ring`
## Documentation
2024-07-24 15:03:39 +02:00
* [cassandra dump data](docs/dump.md)
* [cassandra setup and import](docs/setup.md)