docker部署es-head

docker部署es-head

拉取镜像

docker pull  mobz/elasticsearch-head:5

修改head的_site/vendor.js文件
此文件解决es-head创建索引时报406 Not Acceptable

docker cp df624816b091:/usr/src/app/_site/vendor.js ./

修改共有两处:

1. 6886行 /contentType: "application/x-www-form-urlencoded 
    改成 contentType: "application/json;charset=UTF-8" 
2. 7574行 var inspectData = s.contentType ==`= "application/x-www-form-urlencoded" &&` 
    改成 var inspectData = s.contentType === "application/json;charset=UTF-8" &&

elasticsearch配置文件elasticsearch.yml需添加

http.cors.enabled: true
http.cors.allow-origin: "*"

启动head容器

docker run -d -p 9100:9100 --restart=always  --name  es-head -v /opt/es-head/vendor.js://usr/src/app/_site/vendor.js  es-head:5

你可能感兴趣的:(docker部署es-head)