Elasticsearch: Deployment Instructions

  1. Navigate to the Deployment Directory

    • Navigate to the directory where the Docker Compose file will be stored:
      /root/elasticsearch.

    • If the directory does not exist, create it:

      mkdir -p /root/elasticsearch
      mkdir -p /root/elasticsearch/certs
  2. Prepare the docker-compose.yml File

    • Place the docker-compose.yml file in the directory.

    • Modify the file as needed to suit deployment requirements.

  3. Copy Self-Signed Certificates

    • Copy your self-signed certificates to a folder named certs inside the deployment directory

  4. Run the Docker Compose File (Initial Attempt)
    Run the following command to start the deployment:

    docker-compose up -d

The first run may fail because the certs folder must be placed in the elastic-config Docker volume.

  1. Prepare the .env File

    • Copy the .env file to the /root/elasticsearch directory.

    • Modify the file as needed to suit deployment requirements.

  2. Deploy the Elasticsearch Cluster

    • Start the containers with the following command:

      docker-compose up -d

Ensure all necessary files (docker-compose.yml, .env, certificates) are correctly configured before deployment.

Ensure all necessary files (docker-compose.yml, .env, certificates) are correctly configured before deployment.


Useful Docker Commands:

  • Get container logs (in real-time, last 200 lines):

    docker logs -f -n200 elasticsearch-docker-node-1
  • Get detailed information about the container:

    docker inspect elasticsearch-docker-node-1
  • View resource usage statistics:

    docker stats elasticsearch-docker-node-1
  • Stopping and Removing Containers

    docker-compose down

Comments

Leave a Reply