gpt4 book ai didi

docker - 如何将高级Kafka配置添加到Landoop `fast-data-dev`镜像

转载 作者:行者123 更新时间:2023-12-02 18:39:36 31 4
gpt4 key购买 nike

有谁知道如何将自定义Kafka配置选项传递给landoop/fast-data-dev Docker镜像?

由于无法对自定义配置文件和/或配置参数进行操作,到目前为止,我尝试通过将以下内容添加到docker compose文件中将自己的server.properties配置文件安装到/opt/confluent/etc/kafka

landoop:
hostname: 'landoop'
image: 'landoop/fast-data-dev:latest'
expose:
- '3030'
ports:
- '3030:3030'
environment:
- RUNTESTS=0
- RUN_AS_ROOT=1
volumes:
- ./docker/landoop/tmp:/tmp
- ./docker/landoop/opt/confluent/etc/kafka:/opt/confluent/etc/kafka

但是,这会使Kafka抛出以下日志:
landoop_1       | 2017-09-28 11:53:03,886 INFO exited: broker (exit status 1; not expected)
landoop_1 | 2017-09-28 11:53:04,749 INFO spawned: 'broker' with pid 281
landoop_1 | 2017-09-28 11:53:05,851 INFO success: broker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
landoop_1 | 2017-09-28 11:53:11,867 INFO exited: rest-proxy (exit status 1; not expected)
landoop_1 | 2017-09-28 11:53:12,604 INFO spawned: 'rest-proxy' with pid 314
landoop_1 | 2017-09-28 11:53:13,024 INFO exited: schema-registry (exit status 1; not expected)
landoop_1 | 2017-09-28 11:53:13,735 INFO spawned: 'schema-registry' with pid 341
landoop_1 | 2017-09-28 11:53:13,739 INFO success: rest-proxy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

另外,当我转到 http://localhost:3030/kafka-topics-ui/时,我看到以下内容:
KAFKA REST
/api/kafka-rest-proxy
CONNECTIVITY ERROR

有什么建议么?谢谢。

最佳答案

我做了几件事简化了整个过程。这仅对开发环境有效

  • 使用交互式 shell 作为入口点
  • 启动docker
  • 在主机网络上启动docker
  • 对server.properties文件进行必要的更改,包括运行docker的主机IP(如(2)docker在主机网络上运行)

  • ** 4.如果要进行任何高级配置,可以立即进行**
  • 运行实际入口点“/usr/local/bin/setup-and-run.sh”

  • 实际使用的命令:
  • 启动容器

  • sudo docker run -it --entrypoint / bin / bash --net = host --rm -e ADV_HOST = HOSTIP landoop / fast-data-dev:latest
  • 添加以下内容到/run/broker/server.properties

  • advertised.host.name =主机IP

    advertised.port = 9092
  • 运行/usr/local/bin/setup-and-run.sh
  • 关于docker - 如何将高级Kafka配置添加到Landoop `fast-data-dev`镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46473155/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com