-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose file does not contain volumes spec #111
Comments
AFAIK, no documentation says a volume will be mounted. You're welcome to add them on your own |
Where should a volume or volumes be mounted when using the https://github.com/confluentinc/cp-all-in-one/blob/7.5.0-post/cp-all-in-one-kraft/docker-compose.yml kraft all-in-one compose configuration? I would like to persist topics and messages across container restarts for development. |
The KAFKA_LOG_DIRS variable defines a folder for topic storage. Could you try mounting a volume there? |
@OneCricketeer that doesn't seem to work Setting services:
kafka:
profiles:
- kafka
image: confluentinc/cp-kafka:7.6.1
hostname: kafka
restart: unless-stopped
container_name: kafka
ports:
- "127.0.0.2:29092:29092"
- "127.0.0.2:9997:9997"
environment:
JMX_PORT: 9997
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:29093
KAFKA_LISTENERS: PLAINTEXT://kafka:9092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:29092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
volumes:
- kafka_logs:/tmp/kraft-combined-logs
volumes:
kafka_logs: results in logging this
|
I think I got it working by mounting a local directory instead of using a docker volume since I couldn't get the volume to have the correct permissions for some reason. I'm not sure if volumes:
- kafka_data:/var/lib/kafka
- ./tmp/kraft-combined-logs:/tmp/kraft-combined-logs
volumes:
kafka_data: |
Description
https://github.com/confluentinc/cp-all-in-one/blob/7.2.1-post/cp-all-in-one-cloud/docker-compose.yml referred in official tutorial https://github.com/confluentinc/cp-all-in-one/blob/7.2.1-post/cp-all-in-one-cloud/docker-compose.yml does not contain volumes spec.
Troubleshooting
docker-compose up followed by docker-compose down clears all the data.
Environment
The text was updated successfully, but these errors were encountered: