docker - Ban more than one container on a node -
how made ban more 1 container on node use: docker, swarm, compose? example have 5 nodes , want deploy 3 replicas service , want replicas on different nodes.
docker's swarm mode defaults ha scheduling strategy, there's nothing needed service spread across multiple nodes long there multiple available nodes schedule task on. constraints, memory restrictions, , outages may impact available nodes has schedule task on. ha scheduler first searches candidate nodes have fewest instances of task (typically 0 unless have more replicas nodes), , tie breaks resulting list favoring nodes fewer tasks.
for further control spread out task on multiple nodes, i'd recommend looking placement preferences added in recent versions. don't believe has made stacks , compose file yet, expect that's matter of time until (new swarm mode features first introduced docker service
command line , later added higher level abstractions). placement preferences allow label nodes indicate higher level topology, e.g. common racks, switches, or datacenters. , placement preferences enable topology aware scheduling can spread tasks out among nodes unique values of desired label. if have 2 separate racks 5 nodes each, without topology aware scheduling scheduled on single rack, , topology aware scheduling, put half of tasks on each rack.
Comments
Post a Comment