linux安装elasticsearch以及可能出现的问题

linux安装elasticsearch以及可能出现的问题一 安装环境 1 centos6 or centos7 2 jdk 1 8 二 安装操作 1 到官网下载 elasticsearc 6 8 并且解压 官网地址 https www elastic co downloads past releases 下载地址 wget https artifacts elastic

大家好,我是讯享网,很高兴认识大家。

一、安装环境

1.centos6 or centos7

2.jdk 1.8

二、安装操作

1.到官网下载elasticsearch5.6.8,并且解压

官网地址:https://www.elastic.co/downloads/past-releases

//下载地址 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.8.tar.gz //解压 tar xvf elasticsearch-5.6.8.tar.gz

讯享网

2.修改elasticsearch.yml配置文件,端口默认为9200,ip地址设置为0.0.0.0,这样子其他ip地址都能访问,cluster.name需要和skywalking的clusterName一致

讯享网[localhost elasticsearch-5.6.8]$ vim config/elasticsearch.yml


讯享网

3.设置好后,直接执行bin目录下的elasticsearch

 

sh bin/elasticsearch &

 

4.浏览器直接访问ip+端口,出现下图数据说明成功了

 

三、可能遇到的问题以及解决办法

1.ERROR: bootstrap checks failed:max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]

原因:无法创建本地文件问题,用户最大可创建文件数太小

解决方案:

切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:

vi /etc/security/limits.conf

添加如下内容:

*  soft nofile 65536

* hard nofile

* soft nproc 2048

* hard nproc 4096

备注:* 代表Linux所有用户名称(比如hadoop)

保存、退出、重新登录才可生效

如果非root用户,可以在vi前加sudo

 

 

 

2.max number of threads [1024] for user [es] likely too low, increase to at least [2048]

原因:无法创建本地线程问题,用户最大可创建线程数太小

解决方案:

切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。

vi /etc/security/limits.d/90-nproc.conf

修改 * soft nproc 1024 为  * soft nproc 2048

 

 

3、max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least []

原因:最大虚拟内存太小

解决方案:

切换到root用户下,修改配置文件sysctl.conf

vi /etc/sysctl.conf

添加下面配置:vm.max_map_count=

并执行命令:sysctl -p

这里要主义的的是,如果非root用户,保存命令为:sudo sysctl -p

 

4、ElasticSearch启动找不到主机或路由

原因:ElasticSearch 单播配置有问题

解决方案:检查ElasticSearch中的配置文件

vi  config/elasticsearch.yml

注意此配置格式

discovery.zen.ping.unicast.hosts:["192.168..:9300","192.168..:9300"]

 

5、org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream

原因:ElasticSearch节点之间的jdk版本不一致

 

6、Unsupported major.minor version 52.0

原因:jdk版本太低

解决方案:elasticsearch5.0.0支持jdk1.8.0

 

7、bin/elasticsearch-plugin install license        ERROR: Unknown plugin license

原因:ElasticSearch5.0.0以后插件命令已经改变

解决方案:bin/elasticsearch-plugin install x-pack

 

8、启动异常: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 

原因:因为Centos6不支持SecComp,而ES5.2.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。详见 :https://github.com/elastic/elasticsearch/issues/22899

解决方案:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

 

9、格式问题:Exception in thread "main" 2017-11-10 06:29:49,106 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]]

原因:elasticsearch.yml中的配置项的格式有问题

解决方案:请尽量保持冒号前面没空格,后面一个空格,不要用tab键

bootstrap.memory_lock: false

 

参考文章:https://blog.csdn.net/u0/article/details/

 

 

 

 

小讯
上一篇 2025-02-18 15:18
下一篇 2025-01-26 15:18

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/83369.html