1. 程式人生 > 其它 >安裝ElasticSearch-head外掛

安裝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的問題,百度查了很多都沒能解決,按照這個部落格寫的 很順利就成功啦。

本文來自部落格園,作者:zk01,轉載請註明原文連結:https://www.cnblogs.com/zhangxiaokui/p/15687593.html