ITPub博客

首页 > IT基础架构 > > elasticsearch-head 安装介绍

elasticsearch-head 安装介绍

作者:飘絮絮絮丶 时间:2022-01-19 10:33:43 0 删除 编辑

elasticsearch-head 是用于监控 Elasticsearch 状态的客户端插件,包括数据可视化、执行增删改查操作等。elasticsearch-head 插件的安装在 Linux 和 Windows 没什么区别,安装之前确保当前系统已经安装 nodejs 即可。

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
作者:BeckJin链接:https://www.jianshu.com/p/e3f7bf6277f9来源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69946831/viewspace-3129862/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-09

  • 博文量
    2646
  • 访问量
    42190