Configuring our logging database
To enable our database to accept logs, we add the following service to our docker-compose.yml
:
# docker-compose.yml
. . .
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.4
container_name: elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- "9200:9200"
- "9300:9300"
For the elasticsearch database, we have the following configurations:
discovery.type=single-node: This configures Elasticsearch to run in single-node mode, which is suitable for development or testing environments.
bootstrap.memory_lock=true: This ensures that the JVM locks the memory used by Elasticsearch, preventing it from being swapped out by the operating system.
"ES_JAVA_OPTS=-Xms512m -Xmx512m": This sets the Java heap size options, specifying that both the initial...