Docker Swarm - strategy doesn't seem to have any effect -


i have provisioned swarm master , swarm nodes docker machine (as described here). working fine; machines created , running, have been discovered , accepts containers.

the output 'docker-machine ls' is:

$ docker-machine ls name         active      driver         state     url                          swarm               docker    errors default      -           virtualbox     stopped                                                    unknown    local        -           virtualbox     stopped                                                    unknown    my-swarm     * (swarm)   digitalocean   running   tcp://104.131.161.197:2376   my-swarm (master)   v1.11.1    node0        -           digitalocean   running   tcp://104.236.29.169:2376    my-swarm            v1.11.1    node1        -           digitalocean   running   tcp://104.236.216.164:2376   my-swarm            v1.11.1    

the problem i'm having distribution of containers. no matter strategy set swarm, seems distribute containers 1 of nodes @ time. i.e. run bunch of containers, , started on same node, shown below (with strategy spread):

$ docker ps 5c075d7ccddc        stress              "/bin/sh -c /stress.s"   32 seconds ago       31 seconds                           node0/elated_goldstine 5bae22a15829        stress              "/bin/sh -c /stress.s"   46 seconds ago       44 seconds                           node0/cocky_booth dc52b3dfa0e6        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/goofy_kalam 3b9e69c694da        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/focused_fermat ef0e006ff3e0        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/stoic_engelbart 53e46b19ab33        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/condescending_rosalind e9e126c7f4c6        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/sleepy_jang f9c0003d509d        stress              "/bin/sh -c /stress.s"   minute ago   minute                       node0/amazing_bhaskara 

what expect here containers distributed evenly on 3 nodes, script i'm running in containers designed take cpu possible. instead of them on node0 (which expect binpack). random strategy has exact same behaviour.

the output 'docker info' swarm master set active seems correct:

$ docker info containers: 15  running: 4  paused: 0  stopped: 11 images: 5 server version: swarm/1.2.1 role: primary strategy: spread filters: health, port, containerslots, dependency, affinity, constraint nodes: 3   my-swarm: 104.131.161.197:2376   └ id: l2hk:f6s3:wwim:bhni:m4xl:klea:4u22:j6ce:zhzi:oggt:76kf:mtqu   └ status: healthy   └ containers: 2   └ reserved cpus: 0 / 1   └ reserved memory: 0 b / 513.4 mib   └ labels: executiondriver=, kernelversion=4.2.0-27-generic, operatingsystem=ubuntu 15.10, provider=digitalocean, storagedriver=aufs   └ error: (none)   └ updatedat: 2016-05-09t10:25:24z   └ serverversion: 1.11.1  node0: 104.236.29.169:2376   └ id: i3tq:5bms:tm2p:gll4:64oh:bdmy:swbu:3qg4:toz2:ledw:a6sq:x34h   └ status: healthy   └ containers: 12   └ reserved cpus: 0 / 1   └ reserved memory: 0 b / 513.4 mib   └ labels: executiondriver=, kernelversion=4.2.0-27-generic, operatingsystem=ubuntu 15.10, provider=digitalocean, storagedriver=aufs   └ error: (none)   └ updatedat: 2016-05-09t10:25:02z   └ serverversion: 1.11.1  node1: 104.236.216.164:2376   └ id: otqh:ubsv:2hke:zvhl:2k7z:bygc:zx25:y6bq:bn5j:uweb:65ke:dabm   └ status: healthy   └ containers: 1   └ reserved cpus: 0 / 1   └ reserved memory: 0 b / 513.4 mib   └ labels: executiondriver=, kernelversion=4.2.0-27-generic, operatingsystem=ubuntu 15.10, provider=digitalocean, storagedriver=aufs   └ error: (none)   └ updatedat: 2016-05-09t10:25:10z   └ serverversion: 1.11.1 plugins:   volume:   network:  kernel version: 4.2.0-27-generic operating system: linux architecture: amd64 cpus: 3 total memory: 1.504 gib name: my-swarm docker root dir:  debug mode (client): false debug mode (server): false warning: no kernel memory limit support 

is there piece have missed necessary type of automatic distribution work way i'm expecting?

issue

it docker agent not have image try run on them.

note swarm build , swarm pull not build, or pull, on each docker agent.

solution a

run pull manually on each docker agent

solution b (not tested)

run local docker registry wherein docker agent pull images from.


have fun swarm! also, if may, suggest read this answer details whole step-by-step tutorial on swarm.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -