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: |

Co-founder of NFT renting protocol Rentable World emiliano.eth shared the group Tuesday morning on Twitter, calling out the "degenerate" community, or crypto obsessives that engage in high-risk trading. Matt Hussey, editorial director at NEAR Protocol also responded to this news with “#meIRL”. Just as you search “Bear Market Screaming” in Telegram, you will see a Pepe frog yelling as the group’s featured image. 1What is Telegram Channels? 6How to manage your Telegram channel? Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police.
from us


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