This Docker Compose file sets up an OpenSearch cluster along with Logstash for data processing and OpenSearch Dashboards for visualization.
- Docker Engine installed
- Docker Compose installed
-
Clone this repository.
-
Navigate to the directory containing the
docker-compose.yml
file. -
Run the following command to start the services:
docker-compose up -d --wait
-
Once the services are up and running, you can access OpenSearch Dashboards at
http://localhost:5601
. -
In order to search create index prefix for
*
-
Use OpenSearch Dashboards to explore and visualize your data.
- Image:
opensearchproject/opensearch:latest
- Container Name:
opensearch-node
- Ports:
9200:9200
for HTTP REST API9600:9600
for monitoring purposes
- Environment Variables:
cluster.name
: Name of the OpenSearch clusternode.name
: Name of the OpenSearch nodediscovery.seed_hosts
: Hosts to seed the discovery processcluster.initial_cluster_manager_nodes
: Initial cluster manager nodesbootstrap.memory_lock
: Lock memory on startupOPENSEARCH_JAVA_OPTS
: Java options for OpenSearchDISABLE_INSTALL_DEMO_CONFIG
: Disable installation of demo configurationsDISABLE_SECURITY_PLUGIN
: Disable security plugin
- Health Check: Uses curl to check if OpenSearch is running.
- Container Name:
logstash
- Volumes:
- Mounts AWS credentials and Logstash configuration files
- Environment Variables:
OPENSEARCH_HOST
: Hostname of the OpenSearch nodeOPENSEARCH_PORT
: Port of the OpenSearch HTTP REST APIBUCKET_NAME
: AWS S3 bucket nameBUCKET_PREFIX
: Prefix for objects in the S3 bucketBUCKET_REGION
: Region of the AWS S3 bucketAWS_SHARED_CREDENTIALS_FILE
: Location of AWS credentials file
- Dependencies: Depends on OpenSearch node being healthy.
- Image:
opensearchproject/opensearch-dashboards:latest
- Container Name:
opensearch-dashboards
- Ports:
5601:5601
for accessing the Dashboards UI
- Environment Variables:
OPENSEARCH_HOSTS
: Hosts of the OpenSearch clusterDISABLE_SECURITY_DASHBOARDS_PLUGIN
: Disable security plugin for OpenSearch Dashboards
- Dependencies: Depends on OpenSearch node being healthy.
- Health Check: Uses curl to check if OpenSearch Dashboards is running.
- Image:
busybox
- Container Name:
healthcheck
- Dependencies: Depends on OpenSearch node, OpenSearch Dashboards, and Logstash.
- Command: Sleeps indefinitely to keep the container running.
- Make sure to adjust configurations according to your environment and requirements.
- This setup is for demonstration purposes and may need modifications for production use.