[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