bobrik / marathoner

Service discovery for marathon
26 stars 5 forks source link

Updater not picking up state change #3

Closed sivaramsk closed 9 years ago

sivaramsk commented 9 years ago

Tried with the below json. I don't see updater picking up the state change. I was also running logger and it too did not show any change after the app was launched. What am I doing wrong here?

Updater output: (Version 1.9) 2015/05/27 12:57:28 getting state from marathon.. 2015/05/27 12:57:29 getting state from marathon.. 2015/05/27 12:57:30 getting state from marathon..

Listerner Output: (Version 1.8) 2015/05/27 12:40:51 dial succeeded 16.2.1.1:7676 2015/05/27 12:40:51 received update request 2015/05/27 12:40:51 state is the same, not doing any updates

Logger output: (Version 1.7) 2015/05/27 13:22:03 dial succeeded 16.2.1.1:7676 2015-05-27T13:22:03.120367153Z: {}

{ "id": "busybox-port", "cmd": "while sleep 10; do date -u +%T; done", "cpus": 0.5, "mem": 64.0, "instances": 1, "container": { "type": "DOCKER", "docker": { "image": "busybox:latest", "network": "BRIDGE", "portMappings": [ { "containerPort": 6379, "hostPort": 0, "servicePort": 11000, "protocol": "tcp" } ] } }, "labels": { "marathoner_haproxy_enabled": "true" }

bobrik commented 9 years ago

ports: [0] is required in app settings for marathoner. Also make sure your marathon version supports labels.

sivaramsk commented 9 years ago

After defining ports, updater has started picking up the state. I could see this from the logger.

devel@devel:~$ docker run --rm bobrik/marathoner-logger:1.7 -u 16.2.1.1:7676 2015/05/28 06:23:19 dial succeeded 16.2.1.1:7676 2015-05-28T06:23:19.638523004Z: {"/busybox-port-8082-1":{"Name":"/busybox-port-8082-1","Labels":{"marathoner_haproxy_enabled":"true"},"Ports":[6379,11001],"Tasks":[{"ID":"busybox-port-8082-1.70df86bc-0475-11e5-9872-6229af2a64b1","Host":"16.1.2.1","Ports":[31000],"StagedAt":"2015-05-27T13:36:55.607Z","StartedAt":"2015-05-27T13:36:56.169Z"}]},"/busybox-port-8082-2":{"Name":"/busybox-port-8082-2","Labels":{"marathoner_haproxy_enabled":"true"},"Ports":[6379,11002],"Tasks":[{"ID":"busybox-port-8082-2.6fb389db-0475-11e5-9872-6229af2a64b1","Host":"16.2.2.1","Ports":[31000],"StagedAt":"2015-05-27T13:36:53.694Z","StartedAt":"2015-05-27T13:36:54.256Z"}]},"/busybox-port-8082-3":{"Name":"/busybox-port-8082-3","Labels":{"marathoner_haproxy_enabled":"true"},"Ports":[6379,11003],"Tasks":[{"ID":"busybox-port-8082-3.7342a40d-0475-11e5-9872-6229af2a64b1","Host":"16.2.2.1","Ports":[31001],"StagedAt":"2015-05-27T13:36:59.611Z","StartedAt":"2015-05-27T13:37:00.145Z"}]}}