elasticsearch7启动问题及解决
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: 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
切回root用户
vim /etc/security/limits.conf
末尾添加
elk hard nofile 65536
elk soft nofile 65536
elk是启动es所用的用户
检查是否变成了65536
su elk
ulimit -Hn
修改es配置
cd /usr/local/elasticsearch-7.1.1
vim config/elasticsearch.yml
内容如下
cluster.name: "test-cluster"
network.host: 0.0.0.0
# custom config
node.name: "node-1"
discovery.seed_hosts: ["127.0.0.1", "[::1]"]
cluster.initial_master_nodes: ["node-1"]
# 开启跨域访问支持,默认为false
http.cors.enabled: true
# 跨域访问允许的域名地址,(允许所有域名)以上使用正则
http.cors.allow-origin: /.*/