一突倍、mac安裝ES
- 1、安裝java1.8以上版本
brew cask install homebrew/cask-versions/java8
- 2烧颖、到Elastic官方網(wǎng)站炕淮,下載tar包跳夭,解壓就可以了们镜。 注意現(xiàn)在新的版本已經(jīng)到7.41, 如果想下載老版本,下面有鏈接past releases, 點進去就可以選擇老的版本了踩衩。
- 3嚼鹉、創(chuàng)建自己想要存放es的目錄,將安裝包移動到新建目錄下驱富,tar -vxf elasticsearch-6.8.4.tar锚赤。cd 到解壓后目錄下的bin目錄下,運行命令 sh elasticsearch 啟動服務褐鸥,稍等十幾秒线脚,到瀏覽器打開http://localhost:9200/,就可以返回當前es 的相關信息叫榕,json格式浑侥,說明啟動成功。
wangjifeideMacBook-Pro:~ wangjifei$ mkdir es
wangjifeideMacBook-Pro:~ wangjifei$ cd es
wangjifeideMacBook-Pro:es wangjifei$ cp ~/Downloads/elasticsearch-6.8.4.tar.gz ./
wangjifeideMacBook-Pro:es wangjifei$ ls
elasticsearch-6.8.4.tar.gz
wangjifeideMacBook-Pro:es wangjifei$ tar -xvf elasticsearch-6.8.4.tar.gz
wangjifeideMacBook-Pro:es wangjifei$ ls
elasticsearch-6.8.4 elasticsearch-6.8.4.tar.gz
wangjifeideMacBook-Pro:es wangjifei$ cd elasticsearch-6.8.4
wangjifeideMacBook-Pro:elasticsearch-6.8.4 wangjifei$ ls
LICENSE.txt README.textile config logs plugins
NOTICE.txt bin lib modules
wangjifeideMacBook-Pro:elasticsearch-6.8.4 wangjifei$ cd bin/
wangjifeideMacBook-Pro:bin wangjifei$ ./elasticsearch
訪問瀏覽器[http://localhost:9200/](http://localhost:9200/)
如下:啟動成功
{
"name" : "0MqXXcT",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "fsyCYKLDT4WZib3ZUt1HCg",
"version" : {
"number" : "6.8.4",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "bca0c8d",
"build_date" : "2019-10-16T06:19:49.319352Z",
"build_snapshot" : false,
"lucene_version" : "7.7.2",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
二晰绎、elasticsearch-head的安裝
- 1寓落、安裝node
brew install node
- 2零如、下載插件并安裝(git下載)
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
安裝完成后在elasticsearch-head/node_modules目錄下會出現(xiàn)grunt文件会宪。
- 3、啟動服務
wangjifeideMacBook-Pro:elasticsearch-head wangjifei$ ./node_modules/grunt/bin/grunt server &
[1] 5903
wangjifeideMacBook-Pro:elasticsearch-head wangjifei$ Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
集群健康值:顯示“未連接”
解決方案:
vim $ES_HOME$/config/elasticsearch.yml
增加如下字段:
http.cors.enabled: true
http.cors.allow-origin: "*"
-
5矮嫉、重啟es拨齐,并刷新head頁面,發(fā)現(xiàn)已經(jīng)可以連接上:
三蹂匹、kibana圖形化工具下載
- 1、kibana圖形化工具下載
打開官網(wǎng),選擇downloads
玫霎,進入下載頁面眷蚓,下載對應的版本,啟動kibana投队。
wangjifeideMacBook-Pro:es wangjifei$ tar -xvf kibana-6.8.4-darwin-x86_64.tar.gz
wangjifeideMacBook-Pro:es wangjifei$ cd kibana-6.8.4-darwin-x86_64
wangjifeideMacBook-Pro:kibana-6.8.4-darwin-x86_64 wangjifei$ ls
LICENSE.txt bin data optimize src
NOTICE.txt built_assets node package.json target
README.txt config node_modules plugins webpackShims
wangjifeideMacBook-Pro:kibana-6.8.4-darwin-x86_64 wangjifei$ ./bin/kibana
- 2钞螟、kibana的漢化
1. Github倉庫下載kibana中文漢化包
git clone https://github.com/anbai-inc/Kibana_Hanization.git
2. cd Kibana_Hanization/old/
# /Users/wangjifei/es/kibana-6.8.4-darwin-x86_64為Kibana安裝目錄
python main.py /Users/wangjifei/es/kibana-6.8.4-darwin-x86_64
3. 修改kibana的配置文件
vim config/kibana.yml
將配置文件的最后一行注釋解開,修改為 i18n.locale: "zh-CN"
4. 重啟kibana(這里有個問題)
重啟時需要先殺掉kibana進程在重啟拯啦,但是ps -ef |grep kibana 或者 ps -ef |grep 5601
都找不到進程id甫匹,由于kibana依賴node薪贫,可以通過ps -ef |grep node 來找到進程id,kill掉