再次启动,又出错了:
[1]: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
我们用的是新创建的用户,而不是root,所以文件权限不足。
首先用root用户登录。
然后修改配置文件:
vim /etc/security/limits.conf
添加下面的内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096
刚才报错中,还有一行:
[1]: max number of threads [1024] for user [leyou] is too low, increase to at least [4096]
这是线程数不够。
继续修改配置:
vim /etc/security/limits.d/20-nproc.conf
修改下面的内容:
* soft nproc 1024
改为:
* soft nproc 4096
vm.max_map_count:限制一个进程可以拥有的VMA(虚拟内存区域)的数量,继续修改配置文件, :
vim /etc/sysctl.conf
添加下面内容:
vm.max_map_count=655360
然后执行命令:
sysctl -p
ERROR: [1] bootstrap checks failed
[1]: 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
ERROR: Elasticsearch did not exit normally - check the logs at /home/leyou/elasticsearch/logs/elasticsearch.log
[2020-04-05T17:27:09,233][INFO ][o.e.n.Node ] [localhost.localdomain] stopping …
[2020-04-05T17:27:09,313][INFO ][o.e.n.Node ] [localhost.localdomain] stopped
[2020-04-05T17:27:09,313][INFO ][o.e.n.Node ] [localhost.localdomain] closing …
[2020-04-05T17:27:09,345][INFO ][o.e.n.Node ] [localhost.localdomain] close
修改conf-->elasticsearch.yml
elasticsearch.yml文件
node.name: node-1 前面的#打开
#network.host: 192.168.0.1
network.host: 192.168.136.110
#network.host: 0.0.0.0
#network.host: localhost
#network.host: 127.0.0.1 这里把network.host 设置为自己的ip地址 也可以设置成0.0.0.0(代表所有ip可以访问)
cluster.initial_master_nodes: ["node-1"] 这里一定要这样设置,我就是这里没有这样设置出问题的,弄了好久
这里的 node-1 是上面node.name:后面的对应值
在最后加上这两句,要不然,外面浏览器就访问不了哈
http.cors.enabled: true
http.cors.allow-origin: "*"
手机扫一扫
移动阅读更方便
你可能感兴趣的文章