sshipway / rancher-catalogue

Catalogue for Rancher (test)
GNU General Public License v2.0
21 stars 6 forks source link

Minecraft load balancer stuck on initializing #12

Open OmgImAlexis opened 8 years ago

OmgImAlexis commented 8 years ago

Here are the full logs from the LB.

8/26/2016 3:25:57 PMINFO: ROOT -> ./etc/monit/
8/26/2016 3:25:57 PMINFO: ROOT -> ./etc/monit/conf.d/
8/26/2016 3:25:57 PMINFO: ROOT -> ./etc/monit/conf.d/logrotate
8/26/2016 3:25:57 PMINFO: ROOT -> ./etc/monit/monitrc
8/26/2016 3:25:57 PMINFO: Sending monit applied 1-c4113ae48035df162ff89a5d37af1545f002ee54e044535e42395bda7a29a953
8/26/2016 3:25:57 PMINFO: Getting haproxy
8/26/2016 3:25:58 PMINFO: Updating haproxy
8/26/2016 3:25:58 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//haproxy current=
8/26/2016 3:25:58 PMINFO: Running /var/lib/cattle/download/haproxy/haproxy-2-d2f842d7d67d6531622dd524b6403ee66414b3b1264684299f4d5574ecaeb32a/apply.sh
8/26/2016 3:25:58 PMINFO: ROOT -> ./
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/default/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/default/haproxy
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/monit/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/monit/conf.d/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/monit/conf.d/haproxy
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/haproxy/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/haproxy/haproxy.cfg
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/haproxy/certs/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/haproxy/certs/default.pem
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/haproxy/certs/certs.pem
8/26/2016 3:25:58 PMINFO: Sending haproxy applied 2-d2f842d7d67d6531622dd524b6403ee66414b3b1264684299f4d5574ecaeb32a
8/26/2016 3:25:58 PMINFO: HOME -> ./
8/26/2016 3:25:58 PMINFO: HOME -> ./etc/
8/26/2016 3:25:58 PMINFO: HOME -> ./etc/cattle/
8/26/2016 3:25:58 PMINFO: HOME -> ./etc/cattle/startup-env
8/26/2016 3:25:58 PMINFO: ROOT -> ./
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/init.d/
8/26/2016 3:25:58 PMINFO: ROOT -> ./etc/init.d/agent-instance-startup
8/26/2016 3:25:58 PMINFO: Sending agent-instance-startup applied 1-83727e6240774f2625f0b47b93e7294fa025692febcb325fd6798633a4d257f6
8/26/2016 3:25:58 PMmonit: generated unique Monit id 1d34657c87cd58a0d2e36dac016cb841 and stored to '/var/lib/monit/id'
8/26/2016 3:25:58 PMStarting monit daemon with http interface at [localhost:2812]
8/26/2016 3:31:40 PM
The system is going down NOW!
8/26/2016 3:31:40 PM
Sent SIGTERM to all processes
8/26/2016 3:31:42 PM
Sent SIGKILL to all processes
8/26/2016 3:31:42 PM
Requesting system reboot
8/26/2016 3:31:49 PMINFO: Downloading agent http://192.168.1.90:8080/v1/configcontent/configscripts
8/26/2016 3:31:49 PMINFO: Updating configscripts
8/26/2016 3:31:49 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//configscripts current=
8/26/2016 3:31:49 PMINFO: Running /var/lib/cattle/download/configscripts/configscripts-1-f0f3fb2e1110b5ada7c441705981f93a480313a324294321cff467f0c3e12319/apply.sh
8/26/2016 3:31:49 PMINFO: Sending configscripts applied 1-f0f3fb2e1110b5ada7c441705981f93a480313a324294321cff467f0c3e12319
8/26/2016 3:31:49 PMINFO: Updating agent-instance-startup
8/26/2016 3:31:49 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//agent-instance-startup current=
8/26/2016 3:31:49 PMINFO: Running /var/lib/cattle/download/agent-instance-startup/agent-instance-startup-2-83727e6240774f2625f0b47b93e7294fa025692febcb325fd6798633a4d257f6/apply.sh
8/26/2016 3:31:50 PMINFO: Updating services
8/26/2016 3:31:50 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//services current=
8/26/2016 3:31:50 PMINFO: Running /var/lib/cattle/download/services/services-1-061405f3edd960bfdfe1cfb8447be40eab5b4b608731608e224cc51c5dc30b91/apply.sh
8/26/2016 3:31:50 PMINFO: HOME -> ./
8/26/2016 3:31:50 PMINFO: HOME -> ./services
8/26/2016 3:31:50 PMINFO: Sending services applied 1-061405f3edd960bfdfe1cfb8447be40eab5b4b608731608e224cc51c5dc30b91
8/26/2016 3:31:50 PMINFO: Getting agent-instance-scripts
8/26/2016 3:31:50 PMINFO: Updating agent-instance-scripts
8/26/2016 3:31:50 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//agent-instance-scripts current=
8/26/2016 3:31:50 PMINFO: Running /var/lib/cattle/download/agent-instance-scripts/agent-instance-scripts-1-4b5124bd74cd423f98d57550b481ec77ec3a7135c6a650886ab95c043305d642/apply.sh
8/26/2016 3:31:50 PMINFO: HOME -> ./
8/26/2016 3:31:50 PMINFO: HOME -> ./events/
8/26/2016 3:31:50 PMINFO: HOME -> ./events/ping
8/26/2016 3:31:50 PMINFO: HOME -> ./events/config.update
8/26/2016 3:31:50 PMINFO: Sending agent-instance-scripts applied 1-4b5124bd74cd423f98d57550b481ec77ec3a7135c6a650886ab95c043305d642
8/26/2016 3:31:50 PMINFO: Getting monit
8/26/2016 3:31:50 PMINFO: Updating monit
8/26/2016 3:31:50 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//monit current=
8/26/2016 3:31:50 PMINFO: Running /var/lib/cattle/download/monit/monit-1-c4113ae48035df162ff89a5d37af1545f002ee54e044535e42395bda7a29a953/apply.sh
8/26/2016 3:31:50 PMINFO: ROOT -> ./
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/logrotate.d/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/logrotate.d/rancher-logs
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/conf.d/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/conf.d/logrotate
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/monitrc
8/26/2016 3:31:50 PMINFO: Sending monit applied 1-c4113ae48035df162ff89a5d37af1545f002ee54e044535e42395bda7a29a953
8/26/2016 3:31:50 PMINFO: Getting haproxy
8/26/2016 3:31:50 PMINFO: Updating haproxy
8/26/2016 3:31:50 PMINFO: Downloading http://192.168.1.90:8080/v1//configcontent//haproxy current=
8/26/2016 3:31:50 PMINFO: Running /var/lib/cattle/download/haproxy/haproxy-5-d2f842d7d67d6531622dd524b6403ee66414b3b1264684299f4d5574ecaeb32a/apply.sh
8/26/2016 3:31:50 PMINFO: ROOT -> ./
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/default/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/default/haproxy
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/conf.d/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/monit/conf.d/haproxy
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/haproxy/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/haproxy/haproxy.cfg
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/haproxy/certs/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/haproxy/certs/default.pem
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/haproxy/certs/certs.pem
8/26/2016 3:31:50 PMINFO: Sending haproxy applied 5-d2f842d7d67d6531622dd524b6403ee66414b3b1264684299f4d5574ecaeb32a
8/26/2016 3:31:50 PMINFO: HOME -> ./
8/26/2016 3:31:50 PMINFO: HOME -> ./etc/
8/26/2016 3:31:50 PMINFO: HOME -> ./etc/cattle/
8/26/2016 3:31:50 PMINFO: HOME -> ./etc/cattle/startup-env
8/26/2016 3:31:50 PMINFO: ROOT -> ./
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/init.d/
8/26/2016 3:31:50 PMINFO: ROOT -> ./etc/init.d/agent-instance-startup
8/26/2016 3:31:50 PMINFO: Sending agent-instance-startup applied 2-83727e6240774f2625f0b47b93e7294fa025692febcb325fd6798633a4d257f6
8/26/2016 3:31:50 PMStarting monit daemon with http interface at [localhost:2812]

My docker-compose.yml

Minecraft:
  environment:
    DIFFICULTY: normal
    EULA: 'TRUE'
    MODE: survival
    MOTD: A Minecraft server powered by Docker
    OPS: Techwiz101
    PVP: 'true'
    SEED: '0'
    VERSION: LATEST
    WHITELIST: ''
    WORLD: ''
  tty: true
  image: itzg/minecraft-server
  stdin_open: true
MinecraftLB:
  ports:
  - 25565:25565/tcp
  tty: true
  image: rancher/load-balancer-service
  links:
  - Minecraft:Minecraft
  stdin_open: true

My rancher-compose.yml

Minecraft:
  scale: 2
MinecraftLB:
  scale: 1
  health_check:
    port: 42
    interval: 2000
    unhealthy_threshold: 3
    healthy_threshold: 2
    response_timeout: 2000
sshipway commented 8 years ago

This is more a problem with the Rancher load balancer than with the minercaft template. Sometimes, the land balancer can fail to pick up its own healthchecks resulting in this behaviour. You can correct it by adding host affinity to the load balancer container; IE have a scheduling rule of "prefer host to have container minecraft"; the healthchecks always work if they are on the same host. It may be related to the other problems with incompatible MTU sizes on udp routing through the Rancher tunnel network. The issue has been reported on the Rancher support fora.