# Elasticstash single node via docker-compose

**URL:** <https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720>\
**Category:** Elasticsearch\
**Created:** [May 19, 2019, 7:19pm UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720 "2019-05-19T19:19:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkimrey](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jkimrey](https://discuss.elastic.co/u/jkimrey)\
**Post date:** [May 19, 2019, 7:19pm UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720/1 "2019-05-19T19:19:06Z")

</div>

Hi.

I'm trying to run Elasticsearch in a Docker container using a docker-compose.

This is for non-production, so I'm trying to set the single node environment variable.

Even though I'm setting it in my docker-compose, I'm still getting an error because bootstrap checks are still being performed.

Here's my docker-compose:

```
version: "3"
   services:
       elasticsearch:
           image: 'elasticsearch'
           ports:
                - '9200:9200'
                - '9300:9300'
            environment:
                - bootstrap.memory_lock=true
                - discovery.type=single-node
                - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
                - cluster.routing.allocation.disk.threshold_enabled=false
            ulimits:
                memlock:
                    soft: -1
                    hard: -1
           user: 'elasticsearch'

```

Here's the error I'm receiving:

```
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,377+0000", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
elasticsearch_1 | ERROR: [3] bootstrap checks failed
elasticsearch_1 | [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
elasticsearch_1 | [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
elasticsearch_1 | [3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,386+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "stopping ..." }
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,400+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "stopped" }
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,400+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "closing ..." }
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,409+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "closed" }
elasticsearch_1 | {"type": "server", "timestamp": "2019-05-19T19:01:41,412+0000", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "1cb4ad6ee202", "message": "Native controller process has stopped - no new native processes can be started" }
elasticsearch_elasticsearch_1 exited with code 78

```

Any suggestions would be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 19, 2019, 8:13pm UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720/2 "2019-05-19T20:13:45Z")

</div>

It looks like it is not picking up your settings, particularly `discovery.type=single-node`. Is the `docker-compose.yml` file you quote above exactly what you are using? If so, it looks badly-formatted, containing an extra space before `environment:` and `ulimits:` compared with `ports:` and `user:` and so on.

---

<div class="post-metadata">

**Author:** ![jkimrey](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jkimrey](https://discuss.elastic.co/u/jkimrey)\
**Post date:** [May 20, 2019, 1:15pm UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720/3 "2019-05-20T13:15:54Z")

</div>

Actually it was a silly issue on my end - what I'm actually doing is overriding the default command to run a script vs initially starting up elasticsearch which I assume is negating the settings in the docker-compose.

I'm starting via bash script so that I can add a (delayed) sub process to insert data into elasticsearch based on a file I'm reading at the time the container starts.

That brings up my next question - is there a parameter I can pass to start elasticsearch in development mode when I'm already in the container?

For instance running the command 'elasticsearch' from within the container (bash) starts elasticsearch in production mode - is there something I can pass with 'elasticsearch' to start in development mode?

Thanks.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 21, 2019, 6:06am UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720/4 "2019-05-21T06:06:30Z")

</div>

> [@jkimrey](#):
>
> is there a parameter I can pass to start elasticsearch in development mode when I'm already in the container?

Yes, you can pass settings to the `elasticsearch` launcher using `-E`, so you're looking for something like the following.

```auto
$ bin/elasticsearch -Ediscovery.type=single-node

```

Alternatively you can set `discovery.type: single-node` in `elasticsearch.yml`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 18, 2019, 6:06am UTC](https://discuss.elastic.co/t/elasticstash-single-node-via-docker-compose/181720/5 "2019-06-18T06:06:37Z")

</div>

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