# Error creating 3 nodes Elasticsearch in docker

**URL:** <https://discuss.elastic.co/t/error-creating-3-nodes-elasticsearch-in-docker/234149>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 25, 2020, 12:28pm UTC](https://discuss.elastic.co/t/error-creating-3-nodes-elasticsearch-in-docker/234149 "2020-05-25T12:28:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![securigeek](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@securigeek](https://discuss.elastic.co/u/securigeek)\
**Post date:** [May 25, 2020, 12:28pm UTC](https://discuss.elastic.co/t/error-creating-3-nodes-elasticsearch-in-docker/234149/1 "2020-05-25T12:28:11Z")

</div>

Hello Community,

I am pretty new with docker and have been tasked with testing the complete ELK cluster on docker . WIth the example given on the website it only has 2 nodes and hence I reused the format to add a 3node in thedocker-compose file. But when I try to compose-up I get the following error message :

`ERROR: yaml.parser.ParserError: while parsing a block mapping  
in "./docker-compose.yml", line 34, column 5  
expected , but found ''  
in "./docker-compose.yml", line 55, column 6

docker-compose.yml :

version: '2.2'

services:  
es01:  
container\_name: es01  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.7.0](http://docker.elastic.co/elasticsearch/elasticsearch:7.7.0)  
environment:  
- node.name=es01  
- discovery.seed\_hosts=es02,es03  
- cluster.initial\_master\_nodes=es01,es02,es03  
- ELASTIC\_PASSWORD=$ELASTIC\_PASSWORD  
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"  
- xpack.license.self\_generated.type=basic  
- xpack.security.enabled=true  
- xpack.security.http.ssl.enabled=true  
- xpack.security.http.ssl.key=$CERTS\_DIR/es01/es01.key  
- xpack.security.http.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.http.ssl.certificate=$CERTS\_DIR/es01/es01.crt  
- xpack.security.transport.ssl.enabled=true  
- xpack.security.transport.ssl.verification\_mode=certificate  
- xpack.security.transport.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.transport.ssl.certificate=$CERTS\_DIR/es01/es01.crt  
- xpack.security.transport.ssl.key=$CERTS\_DIR/es01/es01.key  
volumes: ['data01:/usr/share/elasticsearch/data', 'certs:$CERTS\_DIR']  
ports:  
- 9200:9200  
healthcheck:  
test: curl --cacert $CERTS\_DIR/ca/ca.crt -s [https://localhost:9200](https://localhost:9200) \>/dev/null; if [[$$? == 52]]; then echo 0; else echo 1; fi  
interval: 30s  
timeout: 10s  
retries: 5

es02:  
container\_name: es02  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.7.0](http://docker.elastic.co/elasticsearch/elasticsearch:7.7.0)  
environment:  
- node.name=es02  
- discovery.seed\_hosts=es02,es03  
- cluster.initial\_master\_nodes=es01,es02,es03  
- ELASTIC\_PASSWORD=$ELASTIC\_PASSWORD  
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"  
- xpack.license.self\_generated.type=basic  
- xpack.security.enabled=true  
- xpack.security.http.ssl.enabled=true  
- xpack.security.http.ssl.key=$CERTS\_DIR/es02/es02.key  
- xpack.security.http.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.http.ssl.certificate=$CERTS\_DIR/es02/es02.crt  
- xpack.security.transport.ssl.enabled=true  
- xpack.security.transport.ssl.verification\_mode=certificate  
- xpack.security.transport.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.transport.ssl.certificate=$CERTS\_DIR/es02/es02.crt  
- xpack.security.transport.ssl.key=$CERTS\_DIR/es02/es02.key  
volumes: ['data02:/usr/share/elasticsearch/data', 'certs:$CERTS\_DIR']  
ports:  
- 9200:9200

es03:  
container\_name: es03  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.7.0](http://docker.elastic.co/elasticsearch/elasticsearch:7.7.0)  
environment:  
- node.name=es03  
- discovery.seed\_hosts=es01,es02  
- cluster.initial\_master\_nodes=es01,es02,es03  
- ELASTIC\_PASSWORD=$ELASTIC\_PASSWORD  
- "ES\_JAVA\_OPTS=-Xms512m -Xmx512m"  
- xpack.license.self\_generated.type=basic  
- xpack.security.enabled=true  
- xpack.security.http.ssl.enabled=true  
- xpack.security.http.ssl.key=$CERTS\_DIR/es01/es03.key  
- xpack.security.http.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.http.ssl.certificate=$CERTS\_DIR/es03/es03.crt  
- xpack.security.transport.ssl.enabled=true  
- xpack.security.transport.ssl.verification\_mode=certificate  
- xpack.security.transport.ssl.certificate\_authorities=$CERTS\_DIR/ca/ca.crt  
- xpack.security.transport.ssl.certificate=$CERTS\_DIR/es01/es03.crt  
- xpack.security.transport.ssl.key=$CERTS\_DIR/es03/es03.key  
volumes: ['data03:/usr/share/elasticsearch/data', 'certs:$CERTS\_DIR']  
ports:  
- 9200:9200

```
wait_until_ready:
	image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
	command: /usr/bin/true
	depends_on: {"es01": {"condition": "service_healthy"}}

volumes: {"data01", "data02","data03" "certs"}`
  ``
  
  
  Please help. 

```

Thanks in advance.

---

<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 22, 2020, 12:28pm UTC](https://discuss.elastic.co/t/error-creating-3-nodes-elasticsearch-in-docker/234149/2 "2020-06-22T12:28:11Z")

</div>

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