标签:blog 查看 services dep yml from xms pac cas
创建es.yml
,内容如下:
version: ‘3‘
services:
elasticsearch:
image: elasticsearch:6.6.2
container_name: elasticsearch
environment:
- cluster.name=elasticsearch-cluster
- node.name=node0
- node.master=true
- node.data=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- 9200:9200
- 9300:9300
启动容器:
docker-compose -f es.yml up -d
查看日志:
docker-compose -f elasticsearch
创建es-ik.yml
,内容如下:
FROM elasticsearch:6.6.2
ENV VERSION=6.6.2
# https://github.com/medcl/elasticsearch-analysis-ik/releases
ADD https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v${VERSION}/elasticsearch-analysis-ik-$VERSION.zip /tmp/
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install -b file:///tmp/elasticsearch-analysis-ik-$VERSION.zip
RUN rm -rf /tmp/*
创建镜像:
docker build -t es-ik:6.6.2 -f es-ik.yml .
查看镜像:
docker image ls
创建esclu.yml
,集成kibana管理.内容如下:
version: ‘3‘
services:
elasticsearch_n0:
image: elasticsearch:6.6.2 # 或者使用es-ik:6.6.2镜像↑
container_name: elasticsearch_n0
privileged: true
environment:
- cluster.name=elasticsearch-cluster
- node.name=node0
- node.master=true
- node.data=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch_n0,elasticsearch_n1,elasticsearch_n2"
- "discovery.zen.minimum_master_nodes=2"
ports:
- 9200:9200
- 9300:9300
elasticsearch_n1:
image: elasticsearch:6.6.2
container_name: elasticsearch_n1
privileged: true
environment:
- cluster.name=elasticsearch-cluster
- node.name=node1
- node.master=true
- node.data=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch_n0,elasticsearch_n1,elasticsearch_n2"
- "discovery.zen.minimum_master_nodes=2"
ports:
- 9201:9200
- 9301:9300
elasticsearch_n2:
image: elasticsearch:6.6.2
container_name: elasticsearch_n2
privileged: true
environment:
- cluster.name=elasticsearch-cluster
- node.name=node2
- node.master=true
- node.data=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch_n0,elasticsearch_n1,elasticsearch_n2"
- "discovery.zen.minimum_master_nodes=2"
ports:
- 9202:9200
- 9302:9300
kibana:
image: kibana:6.6.2
container_name: kibana
environment:
- SERVER_NAME=kibana
- ELASTICSEARCH_URL=http://elasticsearch_n0:9200
- XPACK_MONITORING_ENABLED=true
ports:
- 5601:5601
depends_on:
- elasticsearch_n0
启动容器:
docker-compose -f esclu.yml up -d
使用elasticsearch-head
和kibana
都可以
elasticsearch-head最简单操作,安装chrom插件,免去其他多余操作.输入 http://192.168.183.220:9200/ 连接即可
访问 http://192.168.183.220:5601/ 找到DEV TOOLS
参考:
标签:blog 查看 services dep yml from xms pac cas
原文地址:https://www.cnblogs.com/linyufeng/p/13044543.html