如何在巡航控制中为卡夫卡指定时间范围



试图访问API,该API被授予Apache Kafka的巡航控制。上面写着

  • 获取按给定资源利用率排序并按给定主题正则表达式和分区编号/范围筛选的分区负载
    Get/kafkacruisecontrol/partition_load?resource=[resource]&start=[start_TIMESTAMP]&end=[end_TIMESTAMP]&topic=[主题]&partition=[分区/start_partition-end_partition]

  • 注意:所有时间戳都是第二粒度的epoch时间(在文档中给出(

所以这是我构建的URL(根据我的要求,我只需要开始和结束时间(

http://localhost:8081/kafkacruisecontrol/partition_load?start=1533101050920&end=1533102938311&json=真正的

当我击中这个时,它会抛出以下异常

{
"errorMessage": "Error processing GET request '/partition_load' due to 'com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]'.",
"stackTrace": "java.util.concurrent.ExecutionException: com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]ntat java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)ntat java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)ntat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.getAndMaybeReturnProgress(KafkaCruiseControlServlet.java:1347)ntat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.getPartitionLoad(KafkaCruiseControlServlet.java:716)ntat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.doGet(KafkaCruiseControlServlet.java:361)ntat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)ntat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)ntat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)ntat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)ntat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)ntat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)ntat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)ntat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)ntat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)ntat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)ntat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)ntat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)ntat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)ntat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)ntat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)ntat org.eclipse.jetty.server.Server.handle(Server.java:564)ntat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)ntat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)ntat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)ntat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)ntat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)ntat org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)ntat org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)ntat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)ntat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)ntat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)ntat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)ntat java.lang.Thread.run(Thread.java:748)nCaused by: com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]ntat com.linkedin.kafka.cruisecontrol.KafkaCruiseControl.clusterModel(KafkaCruiseControl.java:352)ntat com.linkedin.kafka.cruisecontrol.async.GetClusterModelInRangeRunnable.getResult(GetClusterModelInRangeRunnable.java:36)ntat com.linkedin.kafka.cruisecontrol.async.GetClusterModelInRangeRunnable.getResult(GetClusterModelInRangeRunnable.java:15)ntat com.linkedin.kafka.cruisecontrol.async.OperationRunnable.run(OperationRunnable.java:45)ntat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)ntat java.util.concurrent.FutureTask.run(FutureTask.java:266)ntat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)ntat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)nt... 1 morenCaused by: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]ntat com.linkedin.cruisecontrol.monitor.sampling.aggregator.MetricSampleAggregator.aggregate(MetricSampleAggregator.java:197)ntat com.linkedin.kafka.cruisecontrol.monitor.sampling.aggregator.KafkaPartitionMetricSampleAggregator.aggregate(KafkaPartitionMetricSampleAggregator.java:150)ntat com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor.clusterModel(LoadMonitor.java:423)ntat com.linkedin.kafka.cruisecontrol.KafkaCruiseControl.clusterModel(KafkaCruiseControl.java:346)nt... 8 moren",
"version": 1  }

我是不是错过了什么?

供参考,这里是用于巡航控制的githublink API

您得到的异常似乎是这样的。

这似乎是在您指定的时间段内没有足够的有效窗口时触发的。由于您指定的时间段约为30分钟,是否可能没有足够长的时间来提出此请求。

根据巡航控制自述:

一个新崛起的经纪人的指标可能需要几分钟才能稳定下来。巡航控制系统将删除不一致的指标(例如,当主题中的字节数高于中的broker字节数(,因此前几个快照windows可能没有足够的有效分区。

这也可能是相关的。在发出此请求之前,您已经运行集群多长时间了?

我遇到了类似的问题,结果发现__CruiseControlMetrics主题消息版本过低。

message.format.version>0.9.0

巡航控制需要更新版本的消息,以便获取消息标题数据。如果消息格式版本设置过低,则消息解析将失败,并且不会生成任何训练数据。

相关内容

  • 没有找到相关文章

最新更新