容器部署ES 和 ES head插件

Posted menkeyi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了容器部署ES 和 ES head插件相关的知识,希望对你有一定的参考价值。

1使用 Docker 拉取ElasticSearch镜像

docker pull elasticsearch:6.8.3



启动镜像,设置初始堆内存和最大内存 也可以调整虚拟机内存

docker run --name=test_es -d -p 9200:9200 -p 9300:9300   -e ES_JAVA_OPTS="-Xms256m -Xmx256m" docker.io/elasticsearch:6.8.3


查看健康状态

[root@localhost jumpserver]# curl ‘192.168.92.140:9200/_cat/health?v‘
epoch              timestamp    cluster               status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1591792125 12:28:45       docker-cluster    yellow          1         1      5   5    0    0        5             0                  -                 50.0%



处理跨域拒绝访问问题:

进入es容器

[root@localhost jumpserver]# docker exec -it 053a34851bb5 bash

cd ./config  

增加红色部分参数

[root@053a34851bb5 elasticsearch]# cat ./config/elasticsearch.yml
cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"


安装elasticsearch head插件监控管理

docker pull mobz/elasticsearch-head:5

docker run -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5


在浏览器中打开elasticsearch-head页面,填入ElasticSearch地址

技术图片














以上是关于容器部署ES 和 ES head插件的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch 5.3.x 使用 Head 插件

ES安装及插件head的使用

使用es的head插件进行简单搜索

ES可视化插件ES-HEAD安装

Elasticsearch 5.2.x 使用 Head 插件连接不上集群

Elasticsearch 5.2.x 使用 Head 插件连接不上集群(转)