Skip to content

To let logstash to run as root in docker (managed by marathon) #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhengkai6 opened this issue Mar 31, 2017 · 4 comments
Closed

To let logstash to run as root in docker (managed by marathon) #86

zhengkai6 opened this issue Mar 31, 2017 · 4 comments

Comments

@zhengkai6
Copy link

First I changed the startup.option file, to let the following config items to be root user:

user and group id to be invoked as

LS_USER=root
LS_GROUP=root
But it does not take effect.

Then, I changed my marathon json file, to add parameter in docker config, but the runner is also logstash, not changed to root.

logstash 1 36.0 2.8 6103200 460876 ? Ssl 03:44 1:58 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSIni
root 105 0.0 0.0 22012 2280 ? Ss 03:47 0:00 /bin/bash
root 127 0.0 0.0 19180 1312 ? R+ 03:49 0:00 ps aux

@zhengkai6
Copy link
Author

I've already read the doc in
#79
docker-library/elasticsearch#14
#11

But they do not solve my problem, and my docker image still runs as logstash in the container.

Could anyone figure this out?
Thanks very much!

@yosifkit
Copy link
Member

You just need to override the entrypoint and just run logstash directly (the only thing gained by using the entrypoint is the drop down from root, which is what you don't want); so something like this:

{
  "id": "logstash",
  "container": {
    "type": "DOCKER",
    "args": [ "-f", "/path/to/logstash.conf" ],
    "docker": {
      "image": "logstash:5",
      "network": "BRIDGE",
      "parameters": [
        { "key": "entrypoint", "value": "logstash" }
      ]
    }
  }
}

@zhengkai6
Copy link
Author

zhengkai6 commented Aug 31, 2017

OK I will try it next time

You are also using mesos framework? Interesting...

@tianon
Copy link
Member

tianon commented Oct 4, 2017

This image is officially deprecated in favor of upstream's images (see https://www.elastic.co/guide/en/logstash/current/docker.html).

For more information, please see docker-library/elasticsearch#160, docker-library/docs#842, and docker-library/docs#945.

This image has been deprecated in favor of the official logstash image provided and maintained by elastic.co. The upstream images are available to pull via docker.elastic.co/logstash/logstash:[version] like 5.4.2. The images found here will receive no further updates once the 5.6.0 release is available upstream. Please adjust your usage accordingly.

Elastic provides open-source support for Logstash via the elastic/logstash GitHub repository and the Docker image via the elastic/logstash-docker GitHub repository, as well as community support via its forums.

Thanks!

@tianon tianon closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants