Spark Kafka流媒体问题

Spark Kafka流媒体问题,第1张

Spark Kafka流媒体问题

我遇到了同样的问题,我通过用依赖项构建jar解决了这个问题。

  1. 代码中删除“ sc.addJar()”。

  2. 将下面的代码添加到pom.xml

    <build><sourceDirectory>src/main/java</sourceDirectory><testSourceDirectory>src/test/java</testSourceDirectory><plugins>  <!--    Bind the maven-assembly-plugin to the package phase    this will create a jar file without the storm dependencies    suitable for deployment to a cluster.   -->  <plugin>    <artifactId>maven-assembly-plugin</artifactId>    <configuration>      <descriptorRefs>        <descriptorRef>jar-with-dependencies</descriptorRef>      </descriptorRefs>      <archive>        <manifest>          <mainClass></mainClass>        </manifest>      </archive>    </configuration>    <executions>      <execution>        <id>make-assembly</id>        <phase>package</phase>        <goals>          <goal>single</goal>        </goals>      </execution>    </executions>  </plugin></plugins>



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5616137.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存