专栏首页IT杂记Storm客户端提交任务失败原因分析

Storm客户端提交任务失败原因分析

storm客户端提交topology失败:

java.lang.RuntimeException: org.apache.thrift7.transport.TTransportException
        at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:141)
        at backtype.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:176)
        at backtype.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:158)
        at cn.com.tiza.dataquality.service.service.JobService.start(JobService.java:93)
        at cn.com.tiza.dataquality.service.service.JobService.submit(JobService.java:149)
        at cn.com.tiza.dataquality.service.resource.JobResource.execute(JobResource.java:33)
        at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)

nimbus.log:

2017-11-17T16:12:27.038+0800 b.s.d.nimbus [WARN] Topology submission exception. (topology name='dq23') #<IllegalArgumentException java.lang.IllegalArgumentException: storm-local/nimbus/inb
ox/stormjar-bc004b80-5f6e-4b94-9505-911511e5cc1f.jar to copy to storm-local/nimbus/stormdist/dq23-94-1510906347 does not exist!>
2017-11-17T16:12:27.038+0800 o.a.t.s.TNonblockingServer [ERROR] Unexpected exception while invoking!
java.lang.IllegalArgumentException: storm-local/nimbus/inbox/stormjar-bc004b80-5f6e-4b94-9505-911511e5cc1f.jar to copy to storm-local/nimbus/stormdist/dq23-94-1510906347 does not exist!
        at backtype.storm.daemon.nimbus$fn__4364.invoke(nimbus.clj:1173) ~[storm-core-0.9.7.jar:0.9.7]
        at clojure.lang.MultiFn.invoke(MultiFn.java:236) ~[clojure-1.5.1.jar:na]
        at backtype.storm.daemon.nimbus$setup_storm_code.invoke(nimbus.clj:307) ~[storm-core-0.9.7.jar:0.9.7]
        at backtype.storm.daemon.nimbus$fn__4261$exec_fn__1104__auto__$reify__4274.submitTopologyWithOpts(nimbus.clj:953) ~[storm-core-0.9.7.jar:0.9.7]
        at backtype.storm.daemon.nimbus$fn__4261$exec_fn__1104__auto__$reify__4274.submitTopology(nimbus.clj:966) ~[storm-core-0.9.7.jar:0.9.7]
        at backtype.storm.generated.Nimbus$Processor$submitTopology.getResult(Nimbus.java:1240) ~[storm-core-0.9.7.jar:0.9.7]
        at backtype.storm.generated.Nimbus$Processor$submitTopology.getResult(Nimbus.java:1228) ~[storm-core-0.9.7.jar:0.9.7]
        at org.apache.thrift7.ProcessFunction.process(ProcessFunction.java:32) ~[storm-core-0.9.7.jar:0.9.7]
        at org.apache.thrift7.TBaseProcessor.process(TBaseProcessor.java:34) ~[storm-core-0.9.7.jar:0.9.7]
        at org.apache.thrift7.server.TNonblockingServer$FrameBuffer.invoke(TNonblockingServer.java:632) ~[storm-core-0.9.7.jar:0.9.7]
        at org.apache.thrift7.server.THsHaServer$Invocation.run(THsHaServer.java:201) [storm-core-0.9.7.jar:0.9.7]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]

经过分析nimbus有个clean-inbox的机制来定时清理inbox中的jar文件,并有两个配置项来设置定时策略:

/**
 * How often nimbus should wake the cleanup thread to clean the inbox.
 * @see NIMBUS_INBOX_JAR_EXPIRATION_SECS
 */
public static final String NIMBUS_CLEANUP_INBOX_FREQ_SECS = "nimbus.cleanup.inbox.freq.secs";

/**
 * The length of time a jar file lives in the inbox before being deleted by the cleanup thread.
 *
 * Probably keep this value greater than or equal to NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS.
 * Note that the time it takes to delete an inbox jar file is going to be somewhat more than
 * NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS (depending on how often NIMBUS_CLEANUP_FREQ_SECS
 * is set to).
 * @see NIMBUS_CLEANUP_FREQ_SECS
 */
public static final String NIMBUS_INBOX_JAR_EXPIRATION_SECS = "nimbus.inbox.jar.expiration.secs";

NIMBUS_CLEANUP_INBOX_FREQ_SECS: 表示nimbus多久唤醒一次清理线程去进行清理;

NIMBUS_INBOX_JAR_EXPIRATION_SECS:表示jar文件在inbox中存活的时长,在清理线程清理之前如果到期了就会被清理

另一方面,通过storm-core提供的StormSubmitter.submitTopology的方法进行提交任务时,上传jar包的逻辑如下:

    private static String submittedJar = null;

    private static void submitJar(Map conf, ProgressListener listener) {
        if(submittedJar==null) {
            LOG.info("Jar not uploaded to master yet. Submitting jar...");
            String localJar = System.getProperty("storm.jar");
            submittedJar = submitJar(conf, localJar, listener);
        } else {
            LOG.info("Jar already uploaded to master. Not submitting jar.");
        }
    }

只要客户端进程不停,jar包就只上传一次。

所以等一个小时后,jar会被清除,重新提交任务就找不到inbox中的jar文件。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 【翻译】GeoJSON格式规范-RFC7946

    本文翻译自https://tools.ietf.org/html/rfc7946 ,2018年1月27,28日两个大雪的周末,以序纪念。

    囚兔
  • [Intellij IDEA]File size exceeds configured limit

        这两天尝试使用 IDEA, 发现一个问题File size exceeds configured limit (2560000). Code insig...

    囚兔
  • JDBC批量提交SQL的几点问题解答

    1. 疑问 问题一:Statement的executeBatch方法是否会执行commit操作,是否还需要再执行一次commit()? 问题二:执行批量操作的过...

    囚兔
  • 一脸懵逼学习Storm的搭建--(一个开源的分布式实时计算系统)

    Storm的官方网址:http://storm.apache.org/index.html 1:集群部署的基本流程(基本套路): 集群部署的流程:下载安...

    别先生
  • IntelliJ IDEA启动一个普通的java web项目的配置

    这是我很久以前刚开始用IntelliJ IDEA时记录的笔记,正好赶上最近离职了,可以有比较多的时间把以前的记录整理一下,可以让刚接触到IntelliJ IDE...

    朱季谦
  • tensorflow中tf.app.flags.FLAGS用法介绍

    tf 中定义了 tf.app.flags.FLAGS ,用于接受从终端传入的命令行参数,相当于对python中的命令行参数模块optpars做了一层封装。

    于小勇
  • spring的spi

    SPI(service provider interface)机制是JDK内置的一种服务发现机制,可以动态的发现服务,即服务提供商,它通过在ClassPath路...

    逍遥壮士
  • 基于 CentOS 搭建 Discuz 论坛

    腾讯云提供了开发者实验室帮助用户搭建 Discuz 论坛,教程内容如下,用户可以点击开发者实验室快速上机完成实验。

    小Q
  • 使 Excel 规则更容易理解(Oracle Policy Modeling-Make your Excel rules easier to understand)

    您可以使用图例关键字创建在 Excel 中引用属性的缩写方式。可以根据情况指定此缩写形式。

    Hongten
  • sqoop 常见错误以及处理方式

    Oracle: Connection Reset Errors 错误代码 11/05/26 16:23:47 INFO mapred.JobClient: Ta...

    岑玉海

扫码关注云+社区

领取腾讯云代金券