標籤:.com yml cnpm 版本號碼 windows環境 ati log 結果 elastics
前言:
ES5*以上版本需要jdk1.8,jdk1.8,jdk1.8.重要的事情說三遍
1、下載Elasticsearch
https://www.elastic.co/cn/downloads/elasticsearch#ga-release
因為是windows版本,所以下載zip即可
2、解壓,我的目錄位置:“E:\elasticsearch-5.4.1\”
在該檔案夾的bin目錄下雙擊elasticsearch.bat執行,完成後任意瀏覽器鍵入127.0.0.1:9200,出現下面介面,證明成功
3、安裝node
5以上版本安裝head需要安裝node和grunt(1.*,2.*直接用plugin命令即可安裝)
:https://nodejs.org/en/download/ 根據自己系統下載相應的msi,雙擊安裝。
安裝完成用cmd進入安裝目錄執行 node -v可查看版本號碼
在同一目錄下執行 npm install -g grunt-cli命令,安裝grunt 完出現一堆黃字 證明安裝成功(我安裝完忘記了)
用grunt -version查看版本號碼
4、安裝head
ctrl+c退出es
修改elasticsearch.yml檔案
在檔案最後加入
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
放開network.host: 192.168.0.1的注釋並改為network.host: 0.0.0.0
放開cluster.name;node.name;http.port的注釋
雙擊elasticsearch.bat重啟es
https://github.com/mobz/elasticsearch-head 下載zip檔案
解壓到指定檔案夾下,我的檔案夾是E:\elasticsearch-5.4.1\elasticsearch-head-master\
進入該檔案夾,修改E:\elasticsearch-5.4.1\elasticsearch-head-master\Gruntfile.js
進入E:\elasticsearch-5.4.1\elasticsearch-head-master\_site修改app.js 中下文內容為伺服器位址,如果是本機部署不修改也可以。
cmd進入E:\elasticsearch-5.4.1\elasticsearch-head-master檔案夾
執行 npm install
然後在head源碼目錄中,執行npm install 下載的包:
npm install
效果
初次運行安裝可能會警示告或錯誤。可以重新運行一次npm install。
最後,在head原始碼目錄下啟動nodejs:
安裝完成執行grunt server 或者npm run start(以後每次),出現證明安裝成功,如果還不成功,退出es再執行一次npm install -g grunt-cli
補充點兒安裝過程中需要注意的地方吧:
安裝npm依賴的時候,
到elasticsearch-head-master目錄下,運行命令:
npm install
如果速度較慢或者安裝失敗,可以使用國內鏡像:
npm install -g cnpm --registry=https://registry.npm.taobao.org
(上述內容來自:http://blog.csdn.net/napoay/article/details/53896348)
。
跟著你能嘗試的去試下 grunt server 命令,也是在上面提到的那個master目錄下,如果出現
fate error,can not find local grunt
的錯誤,則需要用
npm install grunt
的命令來安裝grunt。到了這裡,如果過程中沒出錯的,最好還是用一條單獨的grunt命令來看看是否還缺什麼東西,如果有缺的,就用
npm install contrip-grunt-xxx(就是提示的那些東西),命令安裝東西
可以看這裡
http://blog.csdn.net/u010504064/article/details/70231685
安裝的時候可能會遇到一個 jasmine (意思是茉莉?)找不到的警告,可以不管。
最後再用 grunt server 命令,就能在控制台中看到串連成功的提示了
6、安裝完成查看結果127.0.0.1:9100,是我建了索引後的,沒建索引時候沒節點(見最後一圖)
最後一圖,沒建節點的
Windows環境搭建Elasticsearch 5.*並配置head