docker-compose elasticsearch kibana
时间: 2023-08-30 14:05:15 浏览: 139
Docker Compose is a tool for defining and running multi-container Docker applications. Elasticsearch and Kibana are two popular open-source tools for searching and analyzing data.
To set up Elasticsearch and Kibana using Docker Compose, follow these steps:
1. Create a new directory for your Docker Compose project.
2. Create a new file called `docker-compose.yml` in that directory.
3. Add the following code to the `docker-compose.yml` file:
```
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
environment:
- discovery.type=single-node
ports:
- 9200:9200
kibana:
image: docker.elastic.co/kibana/kibana:7.9.2
ports:
- 5601:5601
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
```
4. Save the `docker-compose.yml` file.
5. Open a terminal and navigate to the directory where you saved the `docker-compose.yml` file.
6. Run the following command to start the Elasticsearch and Kibana containers:
```
docker-compose up
```
7. Wait for the containers to start up. You can check the logs by running:
```
docker-compose logs
```
8. Once the containers are running, you can access Kibana by opening a web browser and going to `http://localhost:5601`. You can access Elasticsearch by going to `http://localhost:9200`.
That's it! You now have Elasticsearch and Kibana running in Docker Compose. You can customize the configuration by modifying the `docker-compose.yml` file.
阅读全文