简体   繁体   中英

How to set up a cluster in Docker Swarm?

I need to setup a cluster of nodes using Docker Swarm. When I say a node, it should have a db, few apps/services and they need to commuicate with each other. I can create a single instance of this using Docker Compose.

But, I need multiple instances of this setup. So, would Docker Swarm help?

When I say a node, it should have a db, few apps/services and they need to commuicate with each other

Docker Swarm is a tool for managing cluster of nodes, when node is a machine (VM/physical) with docker installed. it's not clear what you expect "node" to be, but with swarm you can run any number of containers which will be deployed across the different machines in the cluster.

But, I need multiple instances of this setup. So, would docker swarm help?

You can define anything on the cluster, but basically swarm is meant to enable communication between the nodes. if you want all your services (which you call "node") to be on the same machine anyway, so swarm will not give you any benefits. just copy-paste the docker compose file between all your nodes. But this isn't something common/recommended in general so maybe if you'll explain better your needs, it would be easier to help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM