在Elasticsearch(5.3.0)中使用elasticsearch-head

elasticsearch-head 是什么?

elasticsearch-head是一个运行在浏览器上的Elasticsearch图形界面 (GUI)。
elasticsearch-head运行在Node.js上,并使用Grunt来启动Web服务器。

安装方法

如果没有安装Node.js,需要安装。

$ node -v
v6.9.4

如果没有安装npm,就需要进行安装。

$ npm -v
3.10.10

安装Grunt(通过使用npm安装“grunt-cli”使grunt命令可用)。

$ sudo npm install -g grunt-cli

elasticsearch-head的设置

$ git clone git://github.com/mobz/elasticsearch-head.git
$ cd elasticsearch-head
$ npm install

使用Grunt启动Web服务器。

$ grunt server

请访问 http://localhost:9200。

然后

「集群健康状况:未连接」

发生了错误

修改elasticsearch的设置

$ vi /usr/local/etc/elasticsearch/elasticsearch.yml
+ http.cors.enabled: true
+ http.cors.allow-origin: “*"

追加两行后,重新启动Elasticsearch。

$ sudo services elasticsearch restart

访问 http://localhost:9200

スクリーンショット 2017-10-23 19.05.21.png

打開了( ´ ▽ ` )ノ

广告
将在 10 秒后关闭
bannerAds