fix: improve docker compose
This commit is contained in:
@@ -1,21 +1,27 @@
|
|||||||
version: "3" # Docker Compose format version
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
kafka:
|
kafka:
|
||||||
image: apache/kafka:latest
|
image: apache/kafka:latest
|
||||||
container_name: kafka-crash-test
|
container_name: kafka-crash-test
|
||||||
ports:
|
ports:
|
||||||
- "9092:9092" # host:container
|
- "127.0.0.1:9092:9092" # localhost interface,host:container
|
||||||
environment:
|
environment:
|
||||||
|
# who am I in the cluster
|
||||||
KAFKA_NODE_ID: 1 # node identifier in cluster
|
KAFKA_NODE_ID: 1 # node identifier in cluster
|
||||||
KAFKA_PROCESS_ROLES: broker,controller # Combined broker + controller (KRaft mode, no Zookeeper)
|
KAFKA_PROCESS_ROLES: broker,controller # Combined broker + controller (KRaft mode, no Zookeeper)
|
||||||
|
# how to vote in the cluster, service name at line 4
|
||||||
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093 # Controller nodes for quorum (node_id@host:port)
|
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093 # Controller nodes for quorum (node_id@host:port)
|
||||||
|
|
||||||
# Listener configuration
|
# Listener configuration
|
||||||
|
# what interfaces and ports on the container layer ( not host )
|
||||||
|
# PLAINTEXT and CONTROLLER are listener names, can be anything as long as
|
||||||
|
# referenced the correct ones after
|
||||||
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093 # Ports Kafka listens on internally
|
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093 # Ports Kafka listens on internally
|
||||||
|
# outside container layer ( host )
|
||||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 # Address advertised to clients
|
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 # Address advertised to clients
|
||||||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
|
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT # encryption settings for listeners
|
||||||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER # Listener for controller communication
|
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER # listener name for controller communication
|
||||||
|
|
||||||
KAFKA_LOG_DIRS: /var/lib/kafka/data # Directory for message data storage
|
KAFKA_LOG_DIRS: /var/lib/kafka/data # Directory for message data storage
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user