ElasticSearch下載與安裝 版本5.6.16 (window版)
涉及軟件:jdk1.8以上,node工具,ElasticSearch,ElasticSearch-head
ElasticSearch5.x版本需要jdk1.8以上支持
linux版本配置jdk1.8版本啓動 linux版本配置jdk版本
一、下載ElasticSearch與安裝
進入官網版本下載頁:下載ElasticSearch
找到對應的版本進行下載.zip壓縮包即可。
1、配置ElasticSearch
打開文件夾目錄下的conf目錄,找到elasticsearch.yml
文件,在文件末尾添加配置
# 配置集羣名稱
cluster.name: unionEsCluster
# 配置節點名稱
node.name: union-es-master
# 做爲主節點(集羣模式使用)
node.master: true
# 啓用跨域(爲了解決與elasticsearch-head工具整合添加的配置)
http.cors.enabled: true
http.cors.allow-origin: "*"
更多詳細配置請查閱文檔
打開壓縮包找到啓動文件bin/elasticsearch.bat
雙擊即可啓動。
二、安裝ElasticSearch-head工具
使用elasticsearch-head工具可以查看數據結構以及操作數據等
-
1、安裝node工具,版本 >= 6.0 下載
-
2、下載ElasticSearch-head工具 下載
安裝ElasticSearch-head工具,解壓壓縮包,在文件目錄下運行cmd命令
```cmdnpm install
npm run start如圖:
運行
- 3、自定義elasticsearch-head地址訪問
a. 修改es-head目錄下的/Gruntfile.js找到如下代碼,增加hostname屬性,也可以自行更改監聽地址
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
b. 修改head的連接地址
在es-head的安裝目錄下_site/app.js,將這一行的 http://localhost:9200
改成你的主機名或公網IP,eg: http://192.168.9.253:9200
init: function(parent) {
this._super();
this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
// XHR request fails if the URL is not ending with a "/"
this.base_uri += "/";
}
訪問localhost:9100
即可訪問到elasticSearch-head
三、其它配置
1、Kibana 5.6.16安裝使用
下載kibana 選擇對應的版本
- 解壓後修改配置文件
config/kibana.yml
添加配置
#配置本機ip
server.host: "192.168.9.253"
#配置es集羣url
elasticsearch.url: "http://192.168.9.253:9200"
- 啓動kibana
雙擊bin/kibana.bat
文件,訪問:http://localhost:5601/
即可訪問
詳細使用請查看文檔