docker启动elasticsearch问题
问题1:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
答:在宿主机上修改
echo "vm.max_map_count=262144" >> /etc/sysctl.conf sysctl -w vm.max_map_count=262144
https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docker.html
问题2:
initial heap size [134217728] not equal to maximum heap size [536870912]; this can cause resize pauses and prevents mlockall from locking the entire heap
答:修改启动参数 Xms = Xmx
environment: - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
问题3:
无法进行远程连接访问 9300端口NoNodeAvailableException[None of the configured nodes are available:
答:这种错误发生的原因是elasticsearch从5版本以后默认不开启远程连接,需要修改相关配置文件。 修改/usr/share/elasticsearch.yml,将transport.host:0.0.0.0前的#去掉。其作用是允许任何ip地址访问elasticsearch,开发测试阶段可以这么做,生产环境下指定具体的IP。
docker cp elasticsearch:/usr/share/elasticsearch/config/elasticsearch.yml /usr/share/elasticsearch.yml
