Elasticsearch 启动报错常见坑及解决方案

1、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

提示文件描述符数量太少,修改/etc/security/limits.conf文件,添加

*        hard    nofile           65536
*        soft    nofile           65536
2、max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

/etc/sysctl.conf 文件添加

vm.max_map_count=262144

保存后生效

sysctl -p
3、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.0默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
解决:
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
4、 max number of threads [1024] for user [es] is too low, increase to at least [4096]

系统其它普通用户最多进程默认是1024个,而root用户是 unlimited(不受限制)

vi /etc/security/limits.d/90-nproc.conf
*          soft    nproc     4096
root       soft    nproc     unlimited
5、主机无法访问虚拟机的elasticsearch

修改elasticsearch.yml 中的 Network

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
network.host: 0.0.0.0
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
6.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.yml

# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#

你可能感兴趣的:(随笔,elasticsearch,elk)