安装elasticsearch遇到的坑
1、:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
elasticsearch启动时遇到的错误,意思是:elasticsearch用户拥有的内存权限太小,至少需要262144。
解决:
切换到root用户执行命令:sysctl -w vm.max_map_count=262144
查看结果:sysctl -a|grep vm.max_map_count
显示:vm.max_map_count = 262144
上述方法修改之后,如果重启虚拟机将失效,所以:
解决办法:
在 /etc/sysctl.conf
文件最后添加一行
vm.max_map_count=262144
并使其立即生效,即可永久修改:/sbin/sysctl -p
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
解决:需要修改elasticsearch.yml
中配置:cluster.initial_master_nodes: ["node-1"]
,保留一个节点即可。
3、:配置了阿里云外网ip,只能通过localhost在本地访问:curl -XGET 'http://localhost:9200/'
,如果使用ip方法就拒绝访问,或者使用浏览器访问也拒绝访问。
解决:需要在elasticsearch.yml
中配置阿里云的内网IP,这样就可以通过IP访问了。