dockerizing_cassandra/README.md

80 lines
1.6 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:
`docker exec -it cassandra-1 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
* cassandra1: `docker exec -it cassandra1 /scripts/setup`
* cassandra2: `docker exec -it cassandra2 /scripts/setup`
* cassandra3: `docker exec -it cassandra3 /scripts/setup`
2024-07-24 15:03:39 +02:00
run a single service:
* cassandra1: `docker-compose up cassandra1 --build`
* cassandra2: `docker-compose up cassandra2 --build`
2024-07-24 15:03:39 +02:00
* ,...
open bash on server
* 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)