2016-03-11 76 views
0

我用apache风暴来处理数据与kafka源,但是我在集群模式下运行风暴他为我返回这个错误: 我用户这个commande线风暴jar /我的jar文件的路径args1apache风暴在集群模式

在pom.xml中
Exception in thread "main" java.lang.RuntimeException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. 
at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:106) 
at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:126) 
at backtype.storm.utils.Utils.readStormConfig(Utils.java:146) 
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:45) 
at com.storm.Topologie.main(Topologie.java:48) 

这是我的文件的依赖性:

<dependencies> 
     <dependency> 
     <groupId>org.apache.storm</groupId> 
     <artifactId>storm-core</artifactId> 
     <version>0.9.5</version> 
     <!-- keep storm out of the jar-with-dependencies --> 
     <scope>provide</scope> 
    </dependency> 
      <dependency> 
     <groupId>org.apache.storm</groupId> 
     <artifactId>storm-kafka</artifactId> 
     <version>0.10.0</version> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.kafka</groupId> 
     <artifactId>kafka_2.9.2</artifactId> 
     <version>0.8.1.1</version> 
     <exclusions> 
      <exclusion> 
       <groupId>org.apache.zookeeper</groupId> 
       <artifactId>zookeeper</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>log4j</groupId> 
       <artifactId>log4j</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

和我的pom.xml的最后一部分

<build> 
<plugins> 
    <plugin> 
    <artifactId>maven-assembly-plugin</artifactId> 
    <configuration> 
     <descriptorRefs> 
     <descriptorRef>jar-with-dependencies</descriptorRef> 
     </descriptorRefs> 
     <archive> 
     <manifest> 
     <mainClass>com.storm.Topologie</mainClass> 
     </manifest> 
     </archive> 

    </configuration> 
    <executions> 
      <execution> 
       <id>make-assembly</id> 
       <phase>package</phase> 
       <goals> 
        <goal>single</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 

回答

2
<scope>provide</scope> 

那 “范围” 是无效的。名称为'provided':

<scope>provided</scope> 

您的maven作业是否成功运行该pom.xml?检查一下,你也可能试图发布以前成功构建的工件(fat jar)。尝试执行clean目标。

+0

非常感谢你,它运行良好,我也删除了jara文件中的defaults.yaml文件,它的工作原理 – inoubli

+0

您可以使用下面的命令从jar中删除defaults.yaml zip -d storm-example.jar默认值。 YAML –