DEVOPSSLIB Telegram 4154
🖥 Как задеплоить Elasticsearch

Elasticsearch — движок для поиска и аналитики в реальном времени. Разбираемся, как быстро развернуть его для логов, метрик и мониторинга.

Быстрый старт с Docker Compose

Самый простой способ поднять Elasticsearch локально или в dev-окружении — Docker Compose:
version: '3.8'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- esdata:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1

kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch

volumes:
esdata:
driver: local


Production-ready deployment

Для прода нужны дополнительные настройки, как минимум мультинодовый кластер:
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es01
- cluster.name=prod-cluster
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
- "ES_JAVA_OPTS=-Xms4g -Xmx4g"
volumes:
- esdata01:/usr/share/elasticsearch/data

es02:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es02
- cluster.name=prod-cluster
- discovery.seed_hosts=es01,es03
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
volumes:
- esdata02:/usr/share/elasticsearch/data

es03:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es03
- cluster.name=prod-cluster
- discovery.seed_hosts=es01,es02
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
volumes:
- esdata03:/usr/share/elasticsearch/data


Частые проблемы и решения

Out of memory:

• Проверьте настройки heap: не более 50% RAM
• Используйте ulimit -l unlimited для memlock

Медленные запросы:

• Оптимизируйте маппинги индексов
• Используйте index lifecycle management
• Настройте правильное количество шардов

Проблемы с дисковым пространством:

• Включите ILM для автоматической ротации индексов
• Настройте retention policy для старых данных
• Используйте _forcemerge для оптимизации

🐸 Библиотека devops'a

#арсенал_инженера
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2



tgoop.com/devopsslib/4154
Create:
Last Update:

🖥 Как задеплоить Elasticsearch

Elasticsearch — движок для поиска и аналитики в реальном времени. Разбираемся, как быстро развернуть его для логов, метрик и мониторинга.

Быстрый старт с Docker Compose

Самый простой способ поднять Elasticsearch локально или в dev-окружении — Docker Compose:

version: '3.8'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
ports:
- "9200:9200"
- "9300:9300"
volumes:
- esdata:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1

kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
- elasticsearch

volumes:
esdata:
driver: local


Production-ready deployment

Для прода нужны дополнительные настройки, как минимум мультинодовый кластер:
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es01
- cluster.name=prod-cluster
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
- "ES_JAVA_OPTS=-Xms4g -Xmx4g"
volumes:
- esdata01:/usr/share/elasticsearch/data

es02:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es02
- cluster.name=prod-cluster
- discovery.seed_hosts=es01,es03
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
volumes:
- esdata02:/usr/share/elasticsearch/data

es03:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- node.name=es03
- cluster.name=prod-cluster
- discovery.seed_hosts=es01,es02
- cluster.initial_master_nodes=es01,es02,es03
- xpack.security.enabled=true
volumes:
- esdata03:/usr/share/elasticsearch/data


Частые проблемы и решения

Out of memory:

• Проверьте настройки heap: не более 50% RAM
• Используйте ulimit -l unlimited для memlock

Медленные запросы:

• Оптимизируйте маппинги индексов
• Используйте index lifecycle management
• Настройте правильное количество шардов

Проблемы с дисковым пространством:

• Включите ILM для автоматической ротации индексов
• Настройте retention policy для старых данных
• Используйте _forcemerge для оптимизации

🐸 Библиотека devops'a

#арсенал_инженера

BY Библиотека девопса | DevOps, SRE, Sysadmin


Share with your friend now:
tgoop.com/devopsslib/4154

View MORE
Open in Telegram


Telegram News

Date: |

Among the requests, the Brazilian electoral Court wanted to know if they could obtain data on the origins of malicious content posted on the platform. According to the TSE, this would enable the authorities to track false content and identify the user responsible for publishing it in the first place. Add up to 50 administrators Activate up to 20 bots As the broader market downturn continues, yelling online has become the crypto trader’s latest coping mechanism after the rise of Goblintown Ethereum NFTs at the end of May and beginning of June, where holders made incoherent groaning sounds and role-played as urine-loving goblin creatures in late-night Twitter Spaces. Hashtags are a fast way to find the correct information on social media. To put your content out there, be sure to add hashtags to each post. We have two intelligent tips to give you:
from us


Telegram Библиотека девопса | DevOps, SRE, Sysadmin
FROM American