開頭
elasticsearch是一個重要的全文檢索框架,對于大數(shù)據(jù)量的表如日志,或者需要性能較好的業(yè)務(wù)要求,使用es是不二之選
搭建流程
1.https://www.elastic.co/cn/downloads/elasticsearch下載,解壓
2.修改jvm.options配置大小,根據(jù)當機內(nèi)存,建議2-4g
3.修改elasticsearch.yml 保證外網(wǎng)訪問
http.port: 9100
network.host: 0.0.0.0
transport.host: localhost
http.cors.enabled: true
http.cors.allow-origin: /.*/
啟動 :./elasticsearch -d 后臺啟動
netstat -nutlp|grep 9200
4.nginx設(shè)置安全性
由于es沒有密碼、權(quán)限控制機制,所以采用nginx進行密碼設(shè)置
采用httpd,并且將上述端口設(shè)置成僅內(nèi)網(wǎng)訪問
sudo iptables -A INPUT -s 127.0.0.1 -p TCP --dport 9100 -j ACCEPT
sudo iptables -A INPUT -p TCP --dport 9100 -j DROP
sudo service iptables save;
sudo service iptables restart;
5.安裝ik
ik版本需要和對應(yīng)的es版本保持一致,解壓到es目錄下/plugins/ik,重啟es即可
6.kibana安裝
下載和es相同版本kibana,修改con/kibana.yml配置文件
server.port: 9103
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://127.0.0.1:9101"]
啟動命令:nohup ./kibana &
停止命令:ps -ef | grep node 然后kill掉
注意:kibana是沒有密碼的,所以采用nginx密碼形式進行設(shè)置密碼(重要)
7.客戶端訪問
postman方式 https://blog.csdn.net/weixin_43343144/article/details/100007787
kibana方式 :6步驟中ip+port