How can I build a cassandra cluster with docker on a windows machine?
I want to create a cassandra cluster with docker. The documentation already tells you how to do this, so I'm not a problem.
However, I am currently using Docker on Windows 10 and obviously it cannot execute the nested command in docker run --name some-cassandra2 -d -e CASSANDRA_SEEDS="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' some-cassandra)" cassandra:tag
, which results in an empty list of seeds for the container.
How can I nest such a command on Windows or - if this is not possible - get a workaround for this?
source to share
I was able to fix this thanks to docker-compose.yml by Jason Gidimin . It should work in v1 as well as v2 for docker compose. By doing it this way, you are simply allowing the docker to communicate with the move and tell the cassandres about other seeds with an environment variable the container already gives you.
The part is sleep 30
pretty smart as it makes sure the second container isn't trying to connect to a container that isn't fully ready yet.
One thing I would recommend is using external_links
instead links
. So other containers don't rely on all cassandra containers to get started / run. This will defeat the purpose of the distributed database.
I still don't know how to embed Windows cmd commands within each other, so I would still be grateful for some advice.
source to share