[ELK] 生产环境使用 Elasticsearch Docker 镜像的优化选项


 

【 配置内核设置 vm.max_map_count 至少为 262144 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_configuration_files_must_be_readable_by_the_elasticsearch_user

 

Linux:

echo vm.max_map_count=262144 >> /etc/sysctl.conf

sysctl -w vm.max_map_count=262144

 

macOS with Docker for Mac:

screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

sysctl -w vm.max_map_count=262144

 

Windows and macOS with Docker Desktop:

docker-machine ssh

sudo sysctl -w vm.max_map_count=262144

 

【 配置文件必须为 elasticsearch 用户可读 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_configuration_files_must_be_readable_by_the_elasticsearch_user

 

【 提高 ulimits 】

检查:docker run --rm centos:7 /bin/bash -c 'ulimit -Hn && ulimit -Sn && ulimit -Hu && ulimit -Su'

docker run 设置:--ulimit nofile=65535:65535

 

【 关闭 swapping:为了性能和节点稳定性 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_disable_swapping

 

【 随机公开端口 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_randomize_published_ports

 

【 设置堆大小 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-set-heap-size

 

【 部署固定版本的镜像 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_pin_deployments_to_a_specific_image_version

 

【 总是绑定数据 volumes 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_always_bind_data_volumes

 

【 避免使用 loop_lvm 模式 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_avoid_using_loop_lvm_mode

 

【 集中你的日志 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_centralize_your_logs

 

【 Docker 下的 ElasticSearch 配置 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-configuration-methods

 

【 挂载 ElasticSearch 配置文件 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-config-bind-mount

 

【 使用自定义 Docker 镜像 】

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_c_customized_image

 

Other:https://tool.offso.com/navs/play-with-docker

Link:https://www.cnblogs.com/farwish/p/12870381.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM