groupadd esgroup
useradd esroot -g esgroup -p password
cd /home/esroot/
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.tar.gz
tar -zxvf elasticsearch-6.4.2.tar.gz
mv elasticsearch-6.4.2 elasticsearch
chown -R esroot:esgroup .
su esroot
x'x'x'x修改elasticsearch的ip和端口
vi conf/elasticsearch.yml
(空格)network.host:(空格)0.0.0.0
(空格)http.port:(空格)9200
安裝ik中文分詞器:
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.2/elasticsearch-analysis-ik-6.4.2.zip
安裝完成後需重啓es
curl http://localhost:9200/_cat/plugins
//顯示,表示安裝 jbLBIzO analysis-ik 6.2.1
常見問題解決:
問題:elasticsearch dead but subsys locked
解決:rm -rf /var/lock/subsys/elasticsearch
重複出現建議看log,目錄:/var/log/elasticsearch/elasticsearch.log
問題: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
解決:
vi /etc/security/limits.conf
esroot soft nofile 65536
esroot hard nofile 65536
問題:max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]
解決:
vi /etc/security/limits.d/90-nproc.conf
* soft nproc 10240
問題:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
原因:因爲centos6.x操作系統不支持SecComp,而elasticsearch 5.5.2默認bootstrap.system_call_filter爲true進行檢測,所以導致檢測失敗,失敗後直接導致ES不能啓動
解決:
vi /etc/elasticsearch/elasticsearch.yml
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
問題:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解決:
vim /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p
https://blog.csdn.net/zhu815496402/article/details/83181300
https://my.oschina.net/liuyuantao/blog/1798724
https://blog.csdn.net/opensure/article/details/47617437