-
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
-
-
Prepare the
docker-compose.ymlFile-
Place the
docker-compose.ymlfile in the directory. -
Modify the file as needed to suit deployment requirements.
-
-
Copy Self-Signed Certificates
-
Copy your self-signed certificates to a folder named
certsinside the deployment directory
-
-
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.
-
Prepare the
.envFile-
Copy the
.envfile to the/root/elasticsearchdirectory. -
Modify the file as needed to suit deployment requirements.
-
-
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
Leave a Reply
You must be logged in to post a comment.