群集模式下的apache风暴

时间:2016-03-11 08:50:13

标签: java maven apache-kafka apache-storm

我使用apache storm来使用kafka源进行数据处理,但是我在集群模式下运行storm时他会为我返回这个错误: 我使用这个commande line storm jar / path到我的jar文件args1

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)

这是我在pom.xml中的文件依赖:

<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>

1 个答案:

答案 0 :(得分:2)

<scope>provide</scope>

“范围”无效。名称为“已提供”:

<scope>provided</scope>

您的maven作业是否已使用该pom.xml成功运行?检查,你也可能尝试从以前成功的版本中发布工件(胖罐)。尝试执行clean目标。