Windows環境搭建Elasticsearch 5.*並配置head

來源:互聯網
上載者:User

標籤:.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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.