Hello everyone! I'm just new here.
I already have a single-node cluster with Docker. I have two containers:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
28625b7bead9 docker.elastic.co/elasticsearch/elasticsearch:6.4.2 "/usr/local/bin/dock…" 4 months ago Up 14 hours 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elastic_heyrovsky
5eee07ed51cb docker.elastic.co/kibana/kibana:6.4.2 "/usr/local/bin/kiba…" 3 years ago Up 14 hours kibana
All data are stored in /opt/elasticsearch/ for last 3 months.
Now I want to use multi-node cluster with docker-compose.
My docker-compose.yml is:
version: '3.5'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.2
container_name: es01
environment:
- cluster.name=elk-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- esnet
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.2
container_name: es02
environment:
- cluster.name=elk-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
- "discovery.zen.ping.unicast.hosts=es01"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata2:/usr/share/elasticsearch/data
networks:
- esnet
elasticsearch3:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.2
container_name: es03
environment:
- cluster.name=elk-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
- "discovery.zen.ping.unicast.hosts=es01"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata3:/usr/share/elasticsearch/data
networks:
- esnet
headPlugin:
image: 'mobz/elasticsearch-head:5'
container_name: head
ports:
- '9100:9100'
networks:
- esnet
kibana:
image: docker.elastic.co/kibana/kibana:6.4.2
container_name: kibana
ports:
- 5601:5601
volumes:
volumes:
- esdata4:/usr/share/kibana/plugins/logtrail
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: '["http://es:9200","http://es02:9200","http://es03:9200"]'
networks:
- esnet
volumes:
esdata1:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/opt/elasticsearch/data'
esdata2:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/opt/elasticsearch/data'
esdata3:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/opt/elasticsearch/data'
esdata4:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/opt/kibana/logtrail'
networks:
esnet:
driver: bridge
After I run docker-compose in kibana I see only fresh data. I don't see the data for last 12 hours (for example).
May be someone had the same issue or I have some errors in my docker-compose.yml file?
Thank you in advance.