欢迎投稿

今日深度:

linux安装elasticsearch-head (es可视化界面),http.cors.

linux安装elasticsearch-head (es可视化界面),http.cors.


 系列-Linux centos7.6 安装elasticsearch8.x (es8) 教程

Linux centos7.6 安装elasticsearch8.x (es8) 教程_言之有李LAX的博客-CSDN博客

系列-linux安装elasticsearch-head (es可视化界面)

linux安装elasticsearch-head (es可视化界面)_言之有李LAX的博客-CSDN博客

es-head安装有几种方式,此篇文章采用最常用的node版本安装

目录

elasticsearch的安装教程请移步

下载

安装

启动

常见问题

1.es修改:

2.elasticsearch-head 修改


下载

直接复制下面的连接到浏览器,下载出来压缩包后上传到服务器,安装目录依然是/usr/local

将压缩包上传至此即可

https://codeload.github.com/mobz/elasticsearch-head/zip/refs/heads/master

 

安装

 1.解压文件

unzip elasticsearch-head-master.zip &>/dev/null

2.进入elasticsearch-head-master,安装node_module

注意:此时需要linux服务器上面已经安装了node.js和npm

如果没有安装的参考下面的连接

https://blog.csdn.net/weixin_44260806/article/details/123642412

在elasticsearch-head-master里执行以下语句:

npm install

启动

# 依赖安装好之后直接启动

npm run start

但是这种方式启动关闭shell页面后就停止了  换一种方式启动

nohup npm run start &

如果想要停止,使用下面的方式:

lsof -i:9100  查出端口运行的进程id

kill -9 进程id

此时通过浏览器即可访问到页面

http://121.4.73.163:9100/?auth_user=elastic&auth_password=123456

用户名密码即上篇文章中安装es时设置的,不清楚的请移步查看

常见问题

正常情况下启动后连接是显示失败的:集群健康值: 未连接

这种情况需要修改几处

1.es修改:

cd /usr/local/elasticsearch-8.4.3/config

vim elasticsearch.yml

在文末添加下面三条语句,三条都要添加,网上好多只添加前两句,最后还是会有跨域问题,加上最后一句后我这边就可以访问了。

http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length

保存退出后重启es

2.elasticsearch-head 修改

修改Gruntfile.js

cd /usr/local/elasticsearch-head-master

vim Gruntfile.js

找到最后connect->server->options中添加hostname:hostname: '*'

 

www.htsjk.Com true http://www.htsjk.com/Elasticsearch/46063.html NewsArticle linux安装elasticsearch-head (es可视化界面),http.cors.  系列-Linux centos7.6 安装elasticsearch8.x (es8) 教程 Linux centos7.6 安装elasticsearch8.x (es8) 教程_言之有李LAX的博客-CSDN博客 系列-linux安装elasti...
评论暂时关闭