elasticsearch5.x安装及使用elasticsearch-head 5.x

1.安装elasticsearch-head

https://github.com/mobz/elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open http://localhost:9100/

由于elasticsearch-head5.x只有作为一个独立的版本运行,所以访问elasticsearch的时候会出现跨域的问题

2.设置elasticsearch的配置文件

修改elasticsearch的跨域问题,打开elasticsearch.yml,在文件的最后添加

http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: GET, POST, PUT, DELETE, OPTIONS
http.cors.allow-headers: "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With"

3.重启elasticsearch

运行结果如图

转载于:https://my.oschina.net/liuyuantao/blog/1335196

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值