如何使用docker-conpose 部署8.1.3版本的elasticsearch和kabana,关闭https
时间: 2024-05-14 17:14:18 浏览: 121
以下是部署8.1.3版本的elasticsearch和kibana的docker-compose.yml文件,其中关闭了https:
```
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.1.3
container_name: elasticsearch
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- "9200:9200"
networks:
- elastic
kibana:
image: docker.elastic.co/kibana/kibana:8.1.3
container_name: kibana
environment:
- "ELASTICSEARCH_HOSTS=http://elasticsearch:9200"
ports:
- "5601:5601"
networks:
- elastic
networks:
elastic:
driver: bridge
volumes:
esdata:
driver: local
```
运行以下命令启动docker-compose:
```
docker-compose up -d
```
然后您可以通过以下URL访问Kibana和Elasticsearch:
- Kibana: http://localhost:5601
- Elasticsearch: http://localhost:9200
注意:这种方式可能会有一些安全问题,因为它完全禁用了https。如果您需要更安全的设置,请考虑启用https,并使用证书来进行身份验证。
阅读全文