centos 7 安装 elasticsearch,及常见错误 Failed to start Elasticsearch....

今天给项目上线,原本运维得工作不知道怎么跑到我的身上.....
开始主题

一切安装完毕,准备就绪得时候,突然发现了重要得一茬,这个项目我用搜索引擎 Elasticsearch 
开始 安装 Elasticsearch 搜索引擎

下载 rpm 包安装之后(wget 官网下载贼慢,建议直接迅雷下载,再上传,几分钟就完事)

 systemctl start   elasticsearch //启动完成
 systemctl status  elasticsearch //查看状态

没问题,就是外网一直无法访问,突然脑梗,想起了什么

vim /etc/elasticsearch/elasticsearch.yml

找到network.host 修改后面得地址(没有直接添加)
为 network.host: 0.0.0.0 //0.0.0.0表示允许所有主机访问,127.0.0.1表示只允许本地访问

好问题来了,进行这一步之后一直起不起来服务

错误日志如下:
[2019-04-26T03:28:05,915][ERROR][o.e.b.Bootstrap          ] [localhost.localdomain] node validation exception
[4] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3818] for user [admin] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

在此博客寻得答案
解决elasticsearch配置network.host: 0.0.0.0导致elasticsearch服务启动不成功的问题

经过此次安装总结如下(多次实验,一次性安装到位)
 

1、官网下载rpm安装包到服务器:www.elastic.co/downloads/elasticsearch

2、执行安装命令:

rpm -ivh elasticsearch-6.5.3.rpm
3、调整配置

搜索引擎配置

vim /etc/elasticsearch/elasticsearch.yml
#增加以下配置
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]
#调整以下配置
#配置允许访问搜索引擎的主机:0.0.0.0表示允许所有主机访问,127.0.0.1表示只允许本地访问
network.host: 0.0.0.0
#配置搜索引擎端口
http.port: 9200


系统文件配置

vim /etc/security/limits.conf
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
 
vim /etc/security/limits.d/90-nproc.conf 
soft nproc 2048
 
vi /etc/sysctl.conf
vm.max_map_count=655360
#该文件修改完成后需要执行下面的命令让上面这行的配置生效
sysctl -p

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章