如何使用docker-conpose 部署8.1.3版本的elasticsearch集群和kabana,关闭https
时间: 2024-05-08 19:15:13 浏览: 119
docker-compose部署elasticsearch集群
以下是使用docker-compose部署Elasticsearch和Kibana的步骤:
1. 创建一个docker-compose.yml文件:
```
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.1.3
container_name: elasticsearch
environment:
- discovery.type=single-node
ports:
- "9200:9200"
- "9300:9300"
volumes:
- esdata:/usr/share/elasticsearch/data
networks:
- elastic
kibana:
image: docker.elastic.co/kibana/kibana:8.1.3
container_name: kibana
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
ports:
- "5601:5601"
networks:
- elastic
volumes:
esdata:
networks:
elastic:
```
2. 运行以下命令启动容器:
```
docker-compose up -d
```
3. 验证Elasticsearch和Kibana已经成功部署,可以通过浏览器访问以下地址:
Elasticsearch: http://localhost:9200
Kibana: http://localhost:5601
4. 关闭https,可以在elasticsearch容器的配置文件中添加以下内容:
```
xpack.security.enabled: false
```
将其添加到elasticsearch.yml文件中,然后重新启动elasticsearch容器即可。
```
docker-compose restart elasticsearch
```
注意:关闭https可能存在安全问题,请谨慎操作。
阅读全文