Cant pass the name of my cluster using docker


(Tadeu Bernacchi) #1

Hello guys,

I'm new with elastic and i'm trying to bring up an environment using Elastic and Docker to set up a Graylog Server, but when i try to pass the name of my cluster i got stuck:

[root@notebook docker]# docker run -d --name=elastic 08794661d6b0 -e "cluster.name=graylog"
2a011103b6b71304ee5f960e5d7165032c08e8684ff6bc51ed001bb38efef728
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: "-e": executable file not found in $PATH".

(The image 08794661d6b0 is docker.elastic.co/elasticsearch/elasticsearch 5.4.0)

Any help it will be appreciate!

Thanks!


(xeraa) #2
$ docker run --help

Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

The option needs to be passed before the image. In your example it assumes -e is the command. Try docker run -d --name=elastic -e "cluster.name=graylog" 08794661d6b0 :slight_smile:


(Tadeu Bernacchi) #3

Thanks,

It was my bad, i'm still learning, thanks again!


(Tadeu Bernacchi) #4

Hello again guys,

I'm run another container:

[root@notebook docker]# docker run -it --name=elastic -e "cluster.name=graylog" 08794661d6b0 /bin/bash

and i went to check the elasticsearch.yml and i got this:

**[elasticsearch@e5710541152b config]$ cat elasticsearch.yml **
cluster.name: "docker-cluster"

Is it normal? What am i doing wrong??

Thanks again!


(xeraa) #5

Yeah, that's the default setting from https://github.com/elastic/elasticsearch-docker/blob/master/build/elasticsearch/elasticsearch.yml#L1

But with your environment variable you are correctly overriding it — mentioned in the docs as well: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_a_present_the_parameters_via_docker_environment_variables

Check the cluster name with curl against localhost:9200/


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.