MirrorNest
← Todos os guias

Elasticsearch

A distributed search and analytics engine — the backbone of full-text search features and, paired with Kibana and Logstash/Beats, one of the most common self-hosted log-aggregation stacks (the 'ELK stack').

Destino: Any Docker hostsearch-enginelog-aggregationDockerSite oficial ↗Documentação oficial ↗
Este guia foi elaborado a partir da documentação oficial do Elasticsearch, ligada acima — verifique sempre lá os nomes exatos dos pacotes/versões antes de executar estes comandos num servidor de produção, uma vez que as versões da distribuição e do projeto mudam com o tempo.
  1. 1Run a single-node instance

    Security is enabled by default from Elasticsearch 8 onward -- this generates a real password you'll need to save.

    docker run -d \ --name elasticsearch \ -p 9200:9200 \ -e discovery.type=single-node \ -v ./elasticsearch/data:/usr/share/elasticsearch/data \ --restart unless-stopped \ docker.elastic.co/elasticsearch/elasticsearch:8.15.0
  2. 2Retrieve the auto-generated elastic user password

    docker exec -it elasticsearch /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
  3. 3Verify it's running

    curl -k -u elastic:your-password https://localhost:9200
  4. 4Add Kibana for visualization (optional)

    Kibana provides the web dashboard most people associate with 'the ELK stack' -- browsing, searching, and graphing whatever data is indexed into Elasticsearch.