Elasticsearch-02CentOS7安装elasticsearch-head插件
生活随笔
收集整理的這篇文章主要介紹了
Elasticsearch-02CentOS7安装elasticsearch-head插件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 概述
- 安裝nodejs
- 下載elasticsearch-head
- es跨域配置
- 啟動 elasticsearch-head
- 訪問 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 ~]#下載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.zipes跨域配置
es 和 head 屬于兩個進程,前后端訪問存在跨域問題,修改下es的配置文件
elasticsearch.yml中追加
http.cors.enabled: true http.cors.allow-origin: "*"重啟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 expressionaudited 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 serverRunning "connect:server" (connect) task Waiting forever... Started connect web server on http://localhost:910訪問 head
訪問 http://192.168.91.128:9100/
修改下Es的地址
總結
以上是生活随笔為你收集整理的Elasticsearch-02CentOS7安装elasticsearch-head插件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Elasticsearch-01Cent
- 下一篇: Elasticsearch-03 Cen