1.ES安装
1.下载ES镜像问题
docker pull elasticsearch
2.运行ES
docker run -it --name elasticsearch -d -p 9200:9200 -p 9300:9300 -p 5601:5601 elasticsearch
一定要关闭防火墙!
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
测试访问:
注意:-p 5601:5601 是kibana的端口地址 (我这里kibana的container共用elasticsearch的网络,所以这样设置。
补充: 如果运行时候报错:
docker run -it --name elasticsearch -d -p 9200:9200 -p 9300:9300 -p 5601:5601 elasticsearch
docker: Error response from daemon: Conflict. The container name "/elasticsearch" is already in use by container "f4ffad5c0550aac679a973b6ade22e16ab1664b6754552736cb75a65dd28e2b4". You have to remove (or rename) that container to be able to reuse that name.
处理:
看到已经退出了:
重启下: docker restart elasticsearch 或者 docker start 容器id
如果没有退出:
docker rm fb087642b497(镜像ID)
2. Kibana安装 kibana连接本地es : ELASTICSEARCH_URL
docker run -it -d -e ELASTICSEARCH_URL=http://127.0.0.1:9200 --name kibana --network=container:elasticsearch kibana
注意:
docker run -it --name elasticsearch -d -p 9200:9200 -p 9300:9300 -p 5601:5601 elasticsearch -v /usr/local/es/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml
测试运行结果
http://192.168.91.66:5601/app/kibana