[Elasticsearch] Elasticsearch installation on windows

熱門文章 (Popular Post)

Posted by : Duran Hsieh 3月 09, 2017

前言

Elasticsearch 是以 Lucene 為基礎的搜尋引擎,無固定 schema、JSON 文件方式儲存資料(與 Monog database 相似,No SQL Database),並以 HTTP 請求方式提供使用者操作。本篇文章將簡單介紹:
  1. 如何在 windows 作業系統下,安裝 Elasticsearch註冊 windows 服務方法
  2. 在Windows作業系統下,使用 docker 啟動Elasticsearch
若有錯誤或任何建議,也煩請各位先進不吝指教。


介紹

Windows
Step 1.前置作業  - JRE安裝
           Preparation - JRE installation

並確認環境變數設定
name:JAVA_HOME
varable: your_jre_location (ex: C:\Program Files\Java\jre1.8.0_111)


Step 2.下載 elasticsearch 並解壓縮
            Download elasticsearch then unzip



Step 3.開啟 bin 資料夾,你可以點選 elasticsearch.bat 直接啟動 elasticsearch
           Open bin folder, you can click  elasticsearch.bat then start elasticsearch directly.



Step 4. 開啟瀏覽器,輸入 http://localhost:9200,可以看見elasticsearch相關資訊
            Open browser then go to http://localhost:9200, you can see information of elasticsearch.




註冊Windows服務 (Register windows service)
Step 1.開啟命令提示字元到 elasticsearch-5.2.2\bin,輸入下列指令:
           Open command line and change directory to elasticsearch\bin, enter command as below
elasticsearch-service install Elasticsearch

Step 2.開啟服務,你可以看到 Elasticsearch 服務,請啟動他。
           open "service",you can see Elasticsearch service, please turn it on.



Step 3.開啟瀏覽器,前往 http://localhost:9200





Docker
請先確認環境是否已經安裝 docker
please make sure docker has been installed.


Step 1.開啟命令提示字元,輸入指令:
           Open command line then enter command as below:
docker pull elasticsearch


透過下列指令確認 redis image 已經下載
docker images


Step 2.啟動 elasticsearch
Run elasticsearch
(port 9200:9200, 環境變數 http.host=0.0.0.0, 環境變數 transport.host=127.0.0.1 背景執行)
docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" -d elasticsearch


Step 3. 開啟瀏覽器,前往 http://127.0.0.1:9200/
            Open browser, go to http://127.0.0.1:9200/



參考資料

1Elasticsearch
2. Elasticsearch - wiki
3. Install Elasticsearch with Docker - Elasticsearch Reference







Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Duran Hsieh @ Matsurigoto - Date A Live - Powered by Blogger - Designed by Johanes Djogan -