Graylog2 / graylog-docker

Official Graylog Docker image
https://hub.docker.com/r/graylog/graylog/
Apache License 2.0
367 stars 133 forks source link

Enhancement for setting master in a hashicorp nomad cluster #103

Closed perbly closed 4 years ago

perbly commented 4 years ago

Hi

Seems like a small change for subtmitting a pull request. But for those who are interested in running graylog in a nomad cluster this code in docker-entrypoint.sh solved the master selection. Maybe it can be added to the docs aswell.

# check if we are inside a nomad cluster
# First member is having alloc-index 0, so
if [[ ! -z "${NOMAD_ALLOC_INDEX}" ]]; then
  if [ ${NOMAD_ALLOC_INDEX} == 0 ]; then
    export GRAYLOG_IS_MASTER="true"
  else
    export GRAYLOG_IS_MASTER="false"
  fi
fi

Hope it helps somebody.

jalogisch commented 4 years ago

@perbly do you mind committing a PR for that if you already have a solution? That is how Open Source contribution works.

To be superhuman you would in addition submit a PR to the docs to give some context and that people actually can know about that: https://github.com/Graylog2/documentation