无法将Metrics Collector与Kafka一起使用Spring Cloud Dataflow

时间:2018-09-09 08:12:30

标签: spring-cloud-stream spring-cloud-dataflow

每个文档我都按照以下步骤操作,但是以某种方式,spring flow用户界面不显示指标。

第1步:启动Metric Server(kafka_2.11-0.11.0.2在端口9098上运行-由于默认端口上部署了其他一些应用程序,因此该端口不能保持默认值)

nohup ./bin/dataflow-server-metrics-collector-kafka-10 >/data/metrics.out &

上面的shell脚本是SCDF纱线的一部分,指向metrics-collector-kafka-10-1.0.0.RELEASE,在/config/collectors.yml中具有以下配置

server:
  port: 8081
security:
  basic:
    enabled: false
spring:
  cloud:
    stream:
      bindings:
        input:
          destination: metrics
      default:
        contentType: application/json

步骤2:我使用以下语句启动了SCDF服务器,该语句指向度量收集器的本地URI;由于上述yml中的安全性已禁用,因此在启动SCDF时不必费心提供用户名/ pwd

nohup ./bin/dataflow-server-yarn --spring.cloud.dataflow.metrics.collector.uri=http://10.73.122.131:8081  > /data/scdf.out &

第3步:我创建了一个流并将其部署到我们的Yarn群集中。部署时,我使用了以下命令:

stream deploy --name pmmlTest --properties "app.*.spring.cloud.stream.bindings.applicationMetrics.destination=metrics"

现在,当我期望Flo UI显示计数器时,将显示SCDF日志: 'Failure while requesting metrics from url http://10.73.122.131:8081/collector/metrics/streams': I/O error on GET request for "http://10.73.122.131:8081/collector/metrics/streams": Connection refused

我相信的原因是,指标收集器始终将bootstrap.servers用作kafka代理绑定的localhost:9092,而不是localhost:9098

我试图在/Config/Collectors.yml中添加以下行,但结果相同。

kafka:
  consumer:
    bootstrap: localhost:9098

不确定如何正确告诉指标收集器使用9098而不是9092。 这是Metrics Collector的启动日志:

    2018-09-09 13:24:21,972  INFO main o.a.k.c.c.ConsumerConfig:180 - ConsumerConfig values: 
    auto.commit.interval.ms = 100
    auto.offset.reset = latest
    bootstrap.servers = [localhost:9092]
    check.crcs = true
    client.id = consumer-1
    connections.max.idle.ms = 540000
    enable.auto.commit = false
    exclude.internal.topics = true
    fetch.max.bytes = 52428800
    fetch.max.wait.ms = 500
    fetch.min.bytes = 1
    group.id = anonymous.38cc5d54-0ce5-4332-8203-f733d7c3f756
    heartbeat.interval.ms = 3000
    interceptor.classes = null
    key.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer
    max.partition.fetch.bytes = 1048576
    max.poll.interval.ms = 300000
    max.poll.records = 500
    metadata.max.age.ms = 300000
    metric.reporters = []
    metrics.num.samples = 2
    metrics.sample.window.ms = 30000
    partition.assignment.strategy = [class org.apache.kafka.clients.consumer.RangeAssignor]
    receive.buffer.bytes = 65536
    reconnect.backoff.ms = 50
    request.timeout.ms = 305000
    retry.backoff.ms = 100
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.mechanism = GSSAPI
    security.protocol = PLAINTEXT
    send.buffer.bytes = 131072
    session.timeout.ms = 10000
    ssl.cipher.suites = null
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = null
    ssl.key.password = null
    ssl.keymanager.algorithm = SunX509
    ssl.keystore.location = null
    ssl.keystore.password = null
    ssl.keystore.type = JKS
    ssl.protocol = TLS
    ssl.provider = null
    ssl.secure.random.implementation = null
    ssl.trustmanager.algorithm = PKIX
    ssl.truststore.location = null
    ssl.truststore.password = null
    ssl.truststore.type = JKS
    value.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer

2018-09-09 13:24:22,030  WARN main o.a.k.c.c.ConsumerConfig:188 - The configuration 'value.serializer' was supplied but isn't a known config.
2018-09-09 13:24:22,031  WARN main o.a.k.c.c.ConsumerConfig:188 - The configuration 'key.serializer' was supplied but isn't a known config.
2018-09-09 13:24:22,032  INFO main o.a.k.c.u.AppInfoParser:83 - Kafka version : 0.10.1.1
2018-09-09 13:24:22,032  INFO main o.a.k.c.u.AppInfoParser:84 - Kafka commitId : f10ef2720b03b247

0 个答案:

没有答案