Linux 系统 elasticsearch-head 安装介绍

转自:https://www.jianshu.com/p/e3f7bf6277f9

elasticsearch-head 是用于监控 Elasticsearch 状态的客户端插件,包括数据可视化、执行增删改查操作等。

Elasticsearch 5.0之后的安装方式和之前不太一样

下载 elasticsearch-head

elasticsearch-head,可以直接下压缩包,也可以通过 git clone。

输入命令,等待下载完成:

git clone git://github.com/mobz/elasticsearch-head.git

安装 grunt-cli

npm install -g grunt-cli

安装 grunt

elasticsearch-head 下载完成后,进入 elasticsearch-head 文件夹,执行命令:

npm install grunt --save

安装依赖的 npm 包

npm install

修改启动文件

所有依赖包安装成功后,修改 elasticsearch-head 目录下的 Gruntfile.js 文件,在 options 属性内增加 hostname,设置为 0.0.0.0。

connect: {
    server: {
        options: {
            hostname: '0.0.0.0',
            port: 9100,
            base: '.',
            keepalive: true
        }
    }
}

修改 Elasticsearch 配置文件 config/elasticsearch.yml

在配置文件最后增加两个配置项,这样 elasticsearch-head 插件才可以访问 Elasticsearch 。

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

启动 elasticsearch-head

在 elasticsearch-head 目录下,执行命令:

grunt server

输出如下内容表示启动成功:

Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

访问 http://localhost:9100 地址,就可以看到当前 Elasticsearch 集群信息。

elasticsearch-head

猜你喜欢

转载自blog.csdn.net/aa5305123/article/details/83993073