在windows中的安裝並測試elasticsearch5.0.2

來源:互聯網
上載者:User

標籤:使用者   local   tags   完整   這一   測試   hang   查看   jvm   

一、安裝elasticsearch 下載壓縮包並解壓到指定目錄

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.2.zip

啟動elasticsearch

註:預設至少2G的記憶體,如果電腦記憶體不夠, 編輯config/jvm.options中的

-Xms2g -Xmx2g 為 -Xms1g -Xmx1g

啟動

/bin/elasticsearch.bat

開啟瀏覽器,訪問進行初始化安裝

http://localhost:9200/

 

二、安裝kibana 下載壓縮包並解壓

簡介:kibana是elasticsearch5.0.2的狀態監控、平台管理和測試的web管理工具

https://artifacts.elastic.co/downloads/kibana/kibana-5.0.2-Windows-x86.zip 

編輯檔案config/kibana.yml中 elasticsearch.url指向Elasticsearch執行個體,這裡設為

server.port: 5601server.host: "localhost"elasticsearch.url: "http://localhost:9200"

啟動kibana

bin/kibana.bat

開啟查看kibana,初始化

http://localhost:5601

 

三、安裝x-pack

1.為elasticsearch 線上安裝X-pack外掛程式:

{elasticsearch}/bin/elasticsearch-plugin install x-pack 

啟動elasticsearch(如果已經啟動請跳過這一步)

bin/elasticsearch 

2.為kibana安裝X-Pack外掛程式

bin/kibana-plugin install x-pack 

啟動kibana(如果已經啟動請跳過這一步)

bin/kibana

 

訪問 http://localhost:9200與http://localhost:5601/會遇到HTTP 401問題,需要使用如下賬戶

使用者名稱: elastic密碼: changeme

 

四.命令補充

 

1.升級x-pack 停止elasticsearch 卸載舊的x-pack

bin/elasticsearch-plugin remove x-pack 

安裝新的

x-pack bin/elasticsearch-plugin install x-pack 

啟動elasticsearch 從kibana中移除x-pack

bin/kibana-plugin remove x-pack 

 

2.在kibana中安裝x-pack

bin/kibana-plugin install x-pack 

卸載x-pack 停止elasticsearch 卸載x-pack

bin/elasticsearch-plugin remove x-pack 

啟動elasticsearch 從kibana中移除x-pack

bin/kibana-plugin remove x-pack 

 

五.測試問題

1.在kibana的Dev Tools面板可以進行搜尋測試

2.使用Fiddler,jmeter等測試載入器時請添加如下要求標頭

Authorization: Basic {base64Encode(username:password)}

這裡的使用者名稱和密碼如下

username:elasticpassword:changeme

我們使用一個完整的例子如下

Connection: keep-alivePragma: no-cacheCache-Control: no-cacheUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) chrome/51.0.2704.103 Safari/537.36Accept: application/json;q=0.9,image/webp,*/*;q=0.8Accept-Encoding: gzip, deflate, sdchAccept-Language: zh-CN,zh;q=0.8Content-Type: application/x-www-form-urlencoded;charset=utf-8Host: localhost:9200Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==

 

訪問地址如下,資料如下

POST http://localhost:9200/_search?pretty
{    "query": {        "match_all": {}    }}

在windows中的安裝並測試elasticsearch5.0.2

相關文章

聯繫我們

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