Windows環境下搭建 【Elasticsearch】

來源:互聯網
上載者:User

標籤:msu   com   搭建   cal   打包壓縮   target   check   search   管理工具   

Elasticsearch,簡稱ES, 是一個基於Lucene的分布式全文檢索搜尋伺服器,和SQL Server的全文索引(Fulltext Index)有點類似,都是基於分詞和分段的全文檢索搜尋引擎,具有分詞,同義字,詞幹查詢的功能,但是ES天生具有分布式和即時的屬性。

 

一,安裝Java SE環境

安裝Java JDK和配置JAVA_HOME環境變數:

1,從Java Se Download下載和安裝Java SE開發包,當前最新版本是Java SE 10.0.2

2,安裝完成之後,需要在伺服器上建立JAVA_HOME環境變數,設定變數值是:D:\Program Files\Java\jdk-10.0.2

3, 禁用Java JDK的自動更新,避免Elasticsearch收到JRE版本影響。

在控制台(Control Panel)上點擊Java表徵圖,開啟Java控制台,切換到Update 選項卡(tab),取消選擇“Check for Updates Automatically”,禁止系統自動進行JDR的自動更新。

切換到Advanced選項卡,設定Application Installation為Never install.

 

二,安裝Elasticsearch

1,從官方下載中心 Elasticsearch Download 下載Elasticsearch安裝包,當前最新版本是6.3.1

2,將zip檔案解壓到D盤,進入 D:\elasticsearch-6.3.1\bin 目錄,雙擊執行 elasticsearch.bat,該指令檔執行 Elasticsearch 啟動程式

3,開啟瀏覽器,輸入 http://localhost:9200 ,顯式以下畫面,說明ES安裝成功。

       

     

三,安裝head外掛程式

為了便於管理ES,可使用head外掛程式,這是最初級的管理工具,在瀏覽器中顯示ES叢集,索引等資訊,十分簡便好用。 

1, 首先要安裝Nodejs,:https://nodejs.org/en/

2, 解壓  elasticsearch-head-master 到 D:\elasticsearch-6.3.1\elasticsearch-head-master

3, 配置 elasticsearch-6.3.1\config\elasticsearch.yml

# 設成0.0.0.0讓任何人都可以訪問,線上服務不要這樣設定。#network.host: 0.0.0.0http.port: 9200# 解決elasticsearch-head 叢集健康值: 未串連問題http.cors.enabled: truehttp.cors.allow-origin: "*"

4, 在elasticsearch-head-master目錄下執行 npm install -g grunt-cli

grunt 是基於Node.js的項目構建工具,可以進行打包壓縮、測試、執行等等的工作,head外掛程式就是通過grunt啟動。

5, 在elasticsearch-head-master目錄下執行npm install 安裝依賴

6, 修改elasticsearch-head-master配置。

修改伺服器監聽地址:Gruntfile.js  

        connect: {            server: {                options: {                    port: 9100,                    base: ‘.‘,                    keepalive: true,                    hostname: ‘*‘                }            }        }

7, 啟動運行head服務, 執行 grunt server 命令。

8, 訪問head管理頁面,地址:http://localhost:9100/ 

 

 

四, 配置EalsticSearch為Windows服務

切換到Elasticsearch的bin目錄執行相應命令:

安裝     service.bat install

啟動     service.bat start

 

 

 

 

 ***************************** *** Keep learning and growing. *** *****************************

——

Windows環境下搭建 【Elasticsearch】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.