docker部署kafka服务

docker run -d --name kafka --hostname kafka-server \
    --log-opt max-size=200m \
    --log-opt max-file=1 \
    --restart=always \
    -p 9092:9092 \
    --memory 1024m \
    -e KAFKA_CFG_LOG_RETENTION_MS=60000 \
    -e KAFKA_CFG_MAX_REQUEST_SIZE=524288000 \
    -e KAFKA_CFG_MESSAGE_MAX_BYTES=524288000 \
    -e KAFKA_CFG_REPLICA_FETCH_MAX_BYTES=524288000 \
    -e KAFKA_CFG_FETCH_MESSAGE_MAX_BYTES=524288000 \
    -e KAFKA_CFG_PARTITION_FETCH_BYTES=524288000 \
    -e KAFKA_HEAP_OPTS='-Xmx512m -Xms256m' \
    -e KAFKA_CFG_NODE_ID=0 \
    -e KAFKA_CFG_PROCESS_ROLES=controller,broker \
    -e KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093 \
    -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT \
    -e KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-server:9093 \
    -e KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER \
    bitnami/kafka:3.6.1

 

posted @ 2024-05-08 14:12  ilovetesting  阅读(25)  评论(0编辑  收藏  举报