elasticsearch6安装与使用

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

猜你喜欢

转载自my.oschina.net/u/232595/blog/2252499