Elasticsearch-02CentOS7安装elasticsearch-head插件
【摘要】
文章目录
概述安装nodejs下载elasticsearch-heades跨域配置启动 elasticsearch-head访问 head
概述
elasticsearch-head...
概述
elasticsearch-head是一个界面化的集群操作和管理工具,使用JavaScript开发,依赖Node.js库,使用Grunt工具构建,所以需要先安装Node.js
服务器信息:
- OS: CentOS 7
- IP: 192.168.91.128
安装nodejs
官网: https://nodejs.org/en/download/
这里我们选择使用二进制安装包
[root@localhost ~]# wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
--2019-04-18 07:42:13-- https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
Resolving nodejs.org (nodejs.org)... 104.20.22.46, 104.20.23.46, 2606:4700:10::6814:172e, ...
Connecting to nodejs.org (nodejs.org)|104.20.22.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12309200 (12M) [application/x-xz]
Saving to: ‘node-v10.15.3-linux-x64.tar.xz’
100%[========================================================================================================================================>] 12,309,200 110KB/s in 3m 0s
2019-04-18 07:45:18 (66.9 KB/s) - ‘node-v10.15.3-linux-x64.tar.xz’ saved [12309200/12309200]
# 解压
[root@localhost ~]# tar xf node-v10.15.3-linux-x64.tar.xz
# 为了方便,重命名
[root@localhost ~]# mv node-v10.15.3-linux-x64 nodejs
# 软连接
[root@localhost bin]# ln -s /root/nodejs/bin/npm /usr/local/bin/
[root@localhost bin]# ln -s /root/nodejs/bin/node /usr/local/bin/
# 查看 node 和 npm的版本
[root@localhost ~]# node -v
v10.15.3
[root@localhost ~]# npm -v
6.4.1
[root@localhost ~]#
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
下载elasticsearch-head
Github地址: https://github.com/mobz/elasticsearch-head
# 下载
[root@localhost ~]# wget https://github.com/mobz/elasticsearch-head/archive/master.zip
# 解压
[root@localhost ~]# unzip master.zip
- 1
- 2
- 3
- 4
es跨域配置
es 和 head 属于两个进程,前后端访问存在跨域问题,修改下es的配置文件
elasticsearch.yml中追加
http.cors.enabled: true
http.cors.allow-origin: "*"
- 1
- 2
重启es 生效
启动 elasticsearch-head
# 进入目录
[root@localhost ~]# cd elasticsearch-head-master/
# install
[root@localhost elasticsearch-head-master]# npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
audited 1751 packages in 17.269s
found 34 vulnerabilities (19 low, 8 moderate, 7 high)
run `npm audit fix` to fix them, or `npm audit` for details
# 启动
[root@localhost elasticsearch-head-master]# npm run start
> elasticsearch-head@0.0.0 start /root/elasticsearch-head-master
> grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:910
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
访问 head
访问 http://192.168.91.128:9100/
修改下Es的地址
文章来源: artisan.blog.csdn.net,作者:小小工匠,版权归原作者所有,如需转载,请联系作者。
原文链接:artisan.blog.csdn.net/article/details/89389951
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)