环境安装:docker安装ES和Kibana
一、安装
1. 下载镜像
[root@localhost vagrant]# docker pull elasticsearch:7.4.2
[root@localhost vagrant]# docker pull kibana:7.4.2
Kibaba是作为一个可视化的客户端。
2. 配置挂载目录
[root@localhost data]# pwd
/usr/data
[root@localhost data]# mkdir -p elasticsearch/config
[root@localhost data]# mkdir -p elasticsearch/data
[root@localhost data]# cd elasticsearch/
[root@localhost elasticsearch]# echo "http.host: 0.0.0.0" >> config/elasticsearch.yml
[root@localhost elasticsearch]# cd config/
[root@localhost config]# ll
total 4 -rw-r--r--. 1 root root 18 May 30 09:12 elasticsearch.yml
3. 启动ES镜像
[root@localhost config]# docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
-v /usr/data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /usr/data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /usr/data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.4.2
4a8a194e556a51ff39c2c54c623b263154c0ddc4deb666fb1e559d57923f2078
-e "discovery.type=single-node" :单节点模式;
-e ES_JAVA_OPTS="-Xmx64m -Xmx128m":指定初始64M,最大128M,避免占据虚拟机最大内存。
最后能正常访问,说明ES安装成功:
4. Kibana
[root@localhost config]# docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.56.101:9200 -p 5601:5601 -d kibana:7.4.2
能正常访问说明安装成功