標籤:使用者 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