1、docker-compose.yml
version: '3' services: es_01: image: elasticsearch:7.1.0 container_name: es_01 environment: #以单一节点模式启动 - discovery.type=single-node #设置使用jvm内存大小 - ES_JAVA_OPTS=-Xms128m -Xmx512m volumes: - ./plugins:/usr/share/elasticsearch/plugins - ./data:/usr/share/elasticsearch/data - ./config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml ports: - 9200:9200 - 9300:9300 kibana_01: image: kibana:7.1.0 container_name: kibana_01 ports: - 5601:5601 links: #可以用es这个域名访问es_01容器 - es_01:es depends_on: - es_01 volumes: - ./config/kibana.yml:/usr/share/kibana/config/kibana.yml environment: #设置访问elasticsearch的地址 - ELASTICSEARCH_HOSTS=http://es:9200
2、创建主机目录
./config
./data
./plugins
3、elasticsearch.yml文件
cluster.name: "docker-cluster" node.name: "docker-node" network.host: 0.0.0.0
4、kibana.yml 文件
# # ** THIS IS AN AUTO-GENERATED FILE ** # # Default Kibana configuration for docker target server.name: kibana server.host: "0" elasticsearch.hosts: [ "http://elasticsearch:9200" ] xpack.monitoring.ui.container.elasticsearch.enabled: true i18n.locale: "zh-CN"
i18n.locale: "zh-CN" -> 设置中文
5、执行docker-compose启动容器
docker-compose up -d
标签:compose,kibana,01,elasticsearch,docker,yml,es From: https://www.cnblogs.com/lkc9/p/17783964.html
6、es参考博客
https://blog.csdn.net/k346k346/category_11247756.html