ES安裝步驟總覽
- 安裝JDK環境(省略安裝步驟)
n 安裝JDK是由於ElasticSearch是由Java語言編寫的
- 安裝ElasticSearch.
n 注意事項:ES非常占內存,默認啟動占1G,可修改為512m
- 安裝Kibana
1. 安裝ElasticSearch
簡介:ElasticSearch是一個基於Lucene的搜索服務器。它提供了一個分布式多用戶能力的全文搜索引擎,基於RESTful web接口。Elasticsearch是用Java開發的,並作為Apache許可條款下的開放源碼發布,是當前流行的企業級搜索引擎。設計用於雲計算中,能夠達到實時搜索,穩定,可靠,快速,安裝使用方便。
1.1修改配置文件
- (root) 解壓壓縮包
tar –zxvf elasticsearch-7.0.1-linux-x86_64.tar.gz
- (root)解壓后新建目錄
mkdir /usr/elasticsearch
- (root)將家目錄下的elasticsearch-7.0.1文件夾放入新建目錄下
mv elasticsearch-7.0.1 /usr/elasticsearch
- (root)修改所屬組和所屬用戶(注意:當前目錄所屬一定不要是root)
chown –R didi-liu /usr/elasticsearch 和 chgrp –R didi-liu /usr/elasticsearch
- (didi-liu)切換到/usr/elasticsearch/ elasticsearch-7.0.1/config/ 下
vi elasticsearch.yml
配置入下圖
1.2可能回報如下錯誤
1.2.1 容量過小錯誤
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
- 解決方案:(切換到root用戶下)
- vi /etc/security/limits.conf (中添加)
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
- vi /etc/systemctl.conf (中添加)
vm.max_map_count=655360
- 修改后, :wq進行保存
sysctl -p
1.2.2不支持SecComp報錯:
ERROR: bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解決方法:
在elasticsearch.yml中配置bootstrap.system_call_filter為false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
解決以上錯誤需關閉防火牆,才可訪問到對應端口(service iptable stop),並重啟
1.2.3主機名配置錯誤:
[rest.suppressed ] /_cat/health Params: {h=node.total}MasterNotDiscoveredException[waited for [30s]]
解決方法:這個報錯可能是因為主機名未改成配置的節點名(我這里把主機名改為:node-1)
1.3啟動elasticsearch
切換到elasticsearch的bin目錄下,執行
./elasticsearch
啟動完成且成功截圖(沒有在一直跳日志)
2. 安裝Kibana
簡介:ElasticSearch是一個基於Lucene的搜索服務器。它提供了一個分布式多用戶能力的全文搜索引擎,基於RESTful web接口。Elasticsearch是用Java開發的,並作為Apache許可條款下的開放源碼發布,是當前流行的企業級搜索引擎。設計用於雲計算中,能夠達到實時搜索,穩定,可靠,快速,安裝使用方便。
2.1修改配置文件
Kibana相對於elasticsearch來說簡單許多。只需要修改Kibana中間配置即可
- (root) 解壓壓縮包
tar –zxvf kibana-7.0.1-linux-x86_64.tar.gz
- (root)修改所屬組和所屬用戶(注意:當前目錄所屬一定不要是root)
chown –R didi-liu kibana-7.0.1-linux-x86_64 和 chgrp –R didi-liu kibana-7.0.1-linux-x86_64
- (didi-liu)切換到/home/didi-liu/kibana-7.0.1-linux-x86_64/config/ 下
vi kibana.yml
配置文件如下:
修改后,:wq 保存並退出
2.2啟動kibana
切換到kibana的bin目錄下,執行
./ kibana
啟動完成且成功截圖(監聽啟動[listening]/所有啟動項都顯示Status changed from yellow to green - Ready)