mesos / logstash

Logstash on Mesos
Apache License 2.0
67 stars 25 forks source link

Scheduler fails to register as framework if logstash role isn't defined #94

Closed mwl closed 8 years ago

mwl commented 8 years ago

On minimal configuration, with only file input enabled, the scheduler fails to register the framework

sadovnikov commented 8 years ago

Marathon task JSON:

{
  "id": "/logstash-scheduler",
  "cpus": 0.2,
  "mem": 256.0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "mesos/logstash-scheduler:latest",
      "network": "BRIDGE"
    }
  },
  "env": {
    "ZK_URL": "zk://172.17.0.3:2181/mesos",
    "LOGSTASH_ELASTICSEARCH_URL": "http://172.17.0.5:33000",
    "LOGSTASH_HEAP_SIZE": "256",
    "LOGSTASH_EXECUTOR_IMAGE": "mesos/logstash-executor",
    "LOGSTASH_EXECUTOR_VERSION": "latest",
    "EXECUTOR_HEAP_SIZE": "128",
    "ENABLE_SYSLOG": "false",
    "ENABLE_FILE": "true",
    "EXECUTOR_FILE_PATH": "/Users/vik/projects/cs/devbox/sources/mesos-elk-demo/build/elk.log, /Users/vik/projects/cs/devbox/sources/mesos-elk-demo/build/*/*.log"
  }
}

stderr output of the task

I0121 09:02:52.177243    34 sched.cpp:1024] Got error 'Role 'logstash' is not present in the master's --roles'
I0121 09:02:52.177374    34 sched.cpp:1805] Asked to abort the driver
I0121 09:02:52.179143    34 sched.cpp:1070] Aborting framework '

and the process does not register as Mesos framework

mwl commented 8 years ago

A quick fix might be to change the mesos role, by adding MESOS_ROLE=* to env object.

sadovnikov commented 8 years ago

The suggested configuration change help. The executor registers now with Mesos Master and framework starts. However I'd expect Scheduler to check if role logstash is defined and then, if present, use it

mwl commented 8 years ago

I don't think that's the right approach. We'll use the user defined role (in --mesos-role=S)

mwl commented 8 years ago

@sadovnikov I'm pretty confident it'll work on a default cluster now (with no logstash role) as long as syslog and collectd input plugins are disabled.