安装ElasticSearch-head插件

es 搭建:https://www.cnblogs.com/zhangxiaokui/p/15686710.html

一、安装nodejs

  1、下载地址:https://nodejs.org/en/download/ 

1 cd /usr/local/
2 wget https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz
3 xz -d node-v12.14.0-linux-x64.tar.xz
4 tar -xvf node-v12.14.0-linux-x64.tar

  2、创建环境变量   

vi /etc/profile
NODE_HOME=/usr/local/node/node-v16.13.1-linux-x64
export PATH=$PATH:$NODE_HOME/bin

  3、检查安装结果

1 #检查
2 node -v
3 npm -v

二、修改es配置文件并重启:

cd /usr/local/elasticsearch-7.6.2
pkill -F pid
# 配置elasticsearch允许跨越访问
cat <<EOF >> config/elasticsearch.yml http.cors.enabled: true http.cors.allow-origin: "*" EOF
# 启动
bin/elasticsearch -d -p pid

  

三、安装head插件:

 1 # 设置npm仓库地址
 2 npm config set registry https://registry.npm.taobao.org
 3 
 4 git clone https://github.com/mobz/elasticsearch-head.git
 5 cd elasticsearch-head/
 6 #修改配置
 7 vi Gruntfile.js
 8  connect: {
 9                         server: {
10                                 options: {
11                                         host: '*',
12                                         port: 9100,
13                                         base: '.',
14                                         keepalive: true
15                                 }
16                         }
17                 }
18 # 修改head中连接集群地址
19 vi _site/app.js +4388
20    this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.124.20:9200";
21 
22 npm install
23 npm run start &

访问验证

 

 

参考博客:https://blog.csdn.net/ywl470812087/article/details/103723817

感谢ywl470812087,中间遇见很多npm install的问题,百度查了很多都没能解决,按照这个博客写的 很顺利就成功啦。

posted @ 2021-12-14 13:51  zk01  阅读(591)  评论(0编辑  收藏  举报