-
Notifications
You must be signed in to change notification settings - Fork 279
Creating a cluster in docker swarm #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using the solution from #94 doesn't work on a multi node cluster (or at least my multi node cluster). |
It might be because of #150. |
Correct me if I am wrong; I took a look at that issue, and it seems like he needed to make a modification to the Dockerfile entrypoint script. This modification was made due to the IP address being assigned to the Cassandra instance being the loopback IP and not the one used for communication between nodes (even though he was running a single node Cassandra instance). I think this can be considered separate from my issue since I just want to get a working dockercompose file on an instance of Dockerswarm running X nodes, and not necessarily using an overlay network. So even putting all the services (or raw containers depending on whatever the final solution is) on a network that has a driver set as host is viable. I am able to get a working Cassandra Ring with the following commands: Ran on node A: Ran on node B: |
I was able to get this working by simplifying your YAML to the following: services:
cassandra-masters:
image: cassandra:latest
environment:
- MAX_HEAP_SIZE=128m
- HEAP_NEWSIZE=32m
- CASSANDRA_BROADCAST_ADDRESS=cassandra-masters
deploy:
mode: replicated
replicas: 1
cassandra-slaves:
image: cassandra:latest
environment:
- MAX_HEAP_SIZE=128m
- HEAP_NEWSIZE=32m
- CASSANDRA_SEEDS=cassandra-masters
- CASSANDRA_BROADCAST_ADDRESS=cassandra-slaves
deploy:
mode: replicated
replicas: 1
depends_on:
- cassandra-masters By using Also, I believe the spaces around the Given that this works without compose (and that I'm able to get it working with compose), I'm going to close, and would suggest that if you need further help getting this working, you might want to try the Docker Community Forums, the Docker Community Slack, or Stack Overflow. |
Hey sorry about the late response, but thank you so much! I am not currently in the same development environment, but I will be sure to point this resource to the team that took this on. Thank you again! |
Hi all,
I am trying to make a cluster in docker swarm, but am having no headway and cant seem to wrap my head around why my methods are not working.
I have a two node cluster, and am trying to use the following dockercompose:
The environment variables used to be static IPs of the nodes, but after switching to an overlay network it needs to grab the node IP dynamically. I would appreciate help, or a working dockercompose file ;)
The text was updated successfully, but these errors were encountered: