Sunday, February 27, 2022

Deploy Elasticsearch On Docker Docker-Compose

 in This Tutorial you will Learn " How To Run Deploy Elasticsearch On Docker | Docker-Compose "    
 
Elasticsearch is a free, open-source search and analytics engine based on the Apache Lucene library.       
Docker is a software platform that allows you to build, test, and deploy applications quickly.
Docker Compose is a tool that was developed to help define and share multi-container applications.
________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; dnf groupinstall "Development Tools" -y ; docker-compose --version ; docker --version

docker volume create elast_data
docker run -d \
     -p 9200:9200 -p 9300:9300 \
     -e "discovery.type=single-node" \
     -v elast_data:/usr/share/elasticsearch/data \
     docker.elastic.co/elasticsearch/elasticsearch:7.16.3

docker ps
docker exec -it funny_germain /bin/sh
curl -X GET "localhost:9200/"
docker stop funny_germain
docker rm funny_germain
_________________________________________________________________________________________
Docker-compose -
nano docker-compose.yaml
version: '3.3'

services:
  my-elast:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3
    ports:
      - 9200:9200
      - 9300:9300
    volumes:
      - elast_data:/usr/share/elasticsearch/data
    environment:
      - "discovery.type=single-node"

volumes:
  elast_data:
docker-compose up -d
docker-compose ps
docker ps
docker exec -it root_my-elast_1 /bin/sh
curl -X GET "localhost:9200/"
_________________________________________________________________________________________

No comments:

Post a Comment