修改配置文件elasticsearch.yml
[wys@elk2 elasticsearch-6.2.2]$ vim config/elasticsearch.yml
放开下面的注解 然后配置相应的内容
-
network.host: 172.16.1.177 #主机地址,这里写本机IP
-
http.port: 9200 #端口
修改后,再次启动ES后,可能会出现下面的错误
-
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
-
[2]: max number of threads [1024] for user [es] 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]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
以下内容为网上的大佬的解决方式 完全搬过来的 ::::使用root身份,执行以下操作
解决问题【1】【2】
[root@elk2 ~]# vim /etc/security/limits.conf
在文件未添加以下内容(xx处为用户名)
-
xx soft nofile 65536
-
xx hard nofile 131072
-
xx soft nproc 4096
-
xx hard nproc 4096
解决问题【3】
-
[root@elk2 ~]# sysctl -w vm.max_map_count=262144
-
[root@elk2 ~]# vim /etc/sysctl.conf #让配置永久生效
在文末添加以下内容
vm.max_map_count=262144
解决问题【4】
Centos6不支持SecComp,而ES6默认bootstrap.system_call_filter为true
[es@elk2 elasticsearch-6.2.2]$ vim config/elasticsearch.yml
禁用:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
取消bootstrap.memory_lock的注释,添加bootstrap.system_call_filter 配置
-
bootstrap.memory_lock: false
-
bootstrap.system_call_filter: false
再次启动es,成功启动