Spring Cloud Dataflow Local Server 是否需要连接zookeeper?

Does Spring Cloud Dataflow Local Server need to connect zookeeper?

我正在尝试在 docker 个容器上设置 scdf。

所有容器在一个网络中

两个kafka端口暴露2181

我确信 kafkas 正在连接到 zookeepers。 (如果没有,则不能正常启动)

但是在创建简单流的过程中

stream create --name test --definition "time | log" --deploy

我在代表 log 应用程序日志的 stdout_0.log 文件中获得了这些日志。

2016-12-14 01:18:03.264  INFO 62 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn          : Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-12-14 01:18:03.265  WARN 62 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn          : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_111-internal]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_111-internal]
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) ~[zookeeper-3.4.6.jar!/:3.4.6-1569965]
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) ~[zookeeper-3.4.6.jar!/:3.4.6-1569965]

stderr_1.log,我有

Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 10000
    at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84)
    at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.ensureTopicCreated(KafkaMessageChannelBinder.java:354)
    at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.createKafkaConsumer(KafkaMessageChannelBinder.java:441)
    at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.doBindConsumer(KafkaMessageChannelBinder.java:282)
    at org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder.doBindConsumer(KafkaMessageChannelBinder.java:121)
    at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:177)
    at org.springframework.cloud.stream.binding.ChannelBindingService.bindConsumer(ChannelBindingService.java:93)
    at org.springframework.cloud.stream.binding.BindableProxyFactory.bindInputs(BindableProxyFactory.java:189)
    at org.springframework.cloud.stream.binding.InputBindingLifecycle.start(InputBindingLifecycle.java:55)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
    ... 27 more

第一个日志说我正在使用localhost:0.0.0.0:2181连接zookeeper,我不是,我已经为配置了真实的IP地址卡夫卡.

第二个日志说连接的超时10000,在kafka中,我将连接超时设置为6000

所以这些不是来自kafka,而是来自scdf.

事实是,当我查找 scdf link 的参考资料时,这里说 zookeeper 是未在此架构中使用(或可能未直接使用)。

这让我感到困惑...如果这些日志不是来自 kafka 而不是来自 scdf,那么它们来自哪里?

如果scdf确实使用zookeeper,那么如何配置zookeeper的连接?

更新

我正在考虑 scdf 何时尝试创建 topic,根据我对创建 的了解topic 你必须指定 zookeeper 连接,scdf 使用 localhost for producers或者 consumers 在 zookeeper 上注册,所以 scdf 实际上是在使用 zookeeper不知何故。但是如何配置呢?

好的,在浏览参考文件之后。我得到这个:

--spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.brokers=192.168.1.100:9092
--spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.zkNodes=192.168.1.100:2181

希望这对正在寻找答案的人有所帮助....