【问题标题】:spark netty version issuespark netty 版本问题
【发布时间】:2018-01-14 15:08:49
【问题描述】:

我在 spark 作业中使用 redis 客户端并遇到异常

java.lang.NoSuchMethodError: io.netty.bootstrap.Bootstrap.config()Lio/netty/bootstrap/BootstrapConfig; 在 org.redisson.client.RedisClient$1$1.operationComplete(RedisClient.java:234)

netty 版本不匹配

Spark 使用 netty 版本 netty-buffer=netty-buffer-4.0.23 但 redis 需要 4.1 ,是否可以在 spark-submit 命令中为驱动程序和执行程序覆盖 netty jar。

【问题讨论】:

标签: apache-spark netty amazon-emr


【解决方案1】:

这取决于您如何组装您的项目。

基本上我们用maven-shade-pluginmaven-assembly-plugin 创建一个包含所有依赖项的胖jar。因此,为避免此问题,您可以在 shade 插件配置中指定重定位。它看起来像这样:

<relocations>
     <relocation>
          <pattern>io.netty</pattern>
          <shadedPattern>your.prefix.io.netty</shadedPattern>
    </relocation>
 </relocations>

【讨论】:

    猜你喜欢
    • 2018-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-04
    • 1970-01-01
    • 1970-01-01
    • 2013-07-03
    相关资源
    最近更新 更多