我一直在尝试在Docker容器上运行Zookeeper和Kafka。我在我的终端中得到了很多错误[error occurred during error reporting , id 0xb]
和[Too many errors, abort]
。然后是library initialization failed - unable to allocate file descriptor table - out of memory
。
我使用下面的docker-compose.yml文件
version: "3.8"
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.5.4
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:5.5.4
# If you want to expose these ports outside your dev PC,
# remove the "127.0.0.1:" prefix
ports:
- 127.0.0.1:9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
3条答案
按热度按时间wlwcrazw1#
我通过覆盖docker.service中的命令参数
ExecStart
修复了这个问题然后进入了
保存并运行
sudo systemctl daemon-reload
和sudo systemctl restart docker
。u3r8eeie2#
尝试将ulimits配置添加到zookeeper中
n3schb8v3#
我认为你的Kafka经纪人需要依赖你的zookeper。这对我很有效: