HA 中的 Spark:java.lang.NoSuchMethodError:org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/S

Posted

技术标签:

【中文标题】HA 中的 Spark:java.lang.NoSuchMethodError:org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;【英文标题】:Spark in HA: java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String; 【发布时间】:2015-12-14 10:06:11 【问题描述】:

我正在尝试以独立模式(通过 zookeeper)为 Spark 1.5.2 设置 HA。启动火花时,我遇到了这个异常。看起来是不兼容的问题。但是我不确定如何进行。

15/12/14 10:42:27 ERROR ErrorMonitor: Uncaught fatal error from thread [sparkMaster-akka.actor.default-dispatcher-3] shutting down ActorSystem [sparkMaster]
java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;
        at org.apache.curator.framework.recipes.leader.LeaderLatch.<init>(LeaderLatch.java:147)
        at org.apache.curator.framework.recipes.leader.LeaderLatch.<init>(LeaderLatch.java:125)
        at org.apache.spark.deploy.master.ZooKeeperLeaderElectionAgent.start(ZooKeeperLeaderElectionAgent.scala:39)
        at org.apache.spark.deploy.master.ZooKeeperLeaderElectionAgent.<init>(ZooKeeperLeaderElectionAgent.scala:34)
        at org.apache.spark.deploy.master.ZooKeeperRecoveryModeFactory.createLeaderElectionAgent(RecoveryModeFactory.scala:74)
        at org.apache.spark.deploy.master.Master.onStart(Master.scala:165)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1$$anonfun$preStart$1.apply$mcV$sp(AkkaRpcEnv.scala:100)
        at org.apache.spark.rpc.akka.AkkaRpcEnv.org$apache$spark$rpc$akka$AkkaRpcEnv$$safelyCall(AkkaRpcEnv.scala:197)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1.preStart(AkkaRpcEnv.scala:99)
        at akka.actor.Actor$class.aroundPreStart(Actor.scala:472)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1.aroundPreStart(AkkaRpcEnv.scala:92)
        at akka.actor.ActorCell.create(ActorCell.scala:580)
        at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
        at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
        at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
        at akka.dispatch.Mailbox.run(Mailbox.scala:219)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
15/12/14 10:42:27 ERROR ActorSystemImpl: Uncaught fatal error from thread [sparkMaster-akka.actor.default-dispatcher-3] shutting down ActorSystem [sparkMaster]
java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;
        at org.apache.curator.framework.recipes.leader.LeaderLatch.<init>(LeaderLatch.java:147)
        at org.apache.curator.framework.recipes.leader.LeaderLatch.<init>(LeaderLatch.java:125)
        at org.apache.spark.deploy.master.ZooKeeperLeaderElectionAgent.start(ZooKeeperLeaderElectionAgent.scala:39)
        at org.apache.spark.deploy.master.ZooKeeperLeaderElectionAgent.<init>(ZooKeeperLeaderElectionAgent.scala:34)
        at org.apache.spark.deploy.master.ZooKeeperRecoveryModeFactory.createLeaderElectionAgent(RecoveryModeFactory.scala:74)
        at org.apache.spark.deploy.master.Master.onStart(Master.scala:165)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1$$anonfun$preStart$1.apply$mcV$sp(AkkaRpcEnv.scala:100)
        at org.apache.spark.rpc.akka.AkkaRpcEnv.org$apache$spark$rpc$akka$AkkaRpcEnv$$safelyCall(AkkaRpcEnv.scala:197)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1.preStart(AkkaRpcEnv.scala:99)
        at akka.actor.Actor$class.aroundPreStart(Actor.scala:472)
        at org.apache.spark.rpc.akka.AkkaRpcEnv$$anonfun$actorRef$lzycompute$1$1$$anon$1.aroundPreStart(AkkaRpcEnv.scala:92)
        at akka.actor.ActorCell.create(ActorCell.scala:580)
        at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
        at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
        at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
        at akka.dispatch.Mailbox.run(Mailbox.scala:219)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

【问题讨论】:

检查您的集群版本和您正在使用的库! Spark 1.5.2。 Hadoop 2.6.0。动物园管理员 3.4.5 【参考方案1】:

使用与 spark 相同的 curator 版本

 <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-client</artifactId>
            <version>1.5.2</version>
        </dependency>

【讨论】:

【参考方案2】:

我在尝试使用 Hadoop 3.3.0 设置高可用性 Spark 2.4.7 时遇到此错误。将 Hadoop 版本降级到 3.2.2 解决了这个问题。

【讨论】:

以上是关于HA 中的 Spark:java.lang.NoSuchMethodError:org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/S的主要内容,如果未能解决你的问题,请参考以下文章

Spark-Standalone-HA模式

Spark HA 配置中spark.deploy.zookeeper.url 的意思

Spark搭建HA详解

多个NameNode的HDFS集群切换HA后,Spark应用变得很慢的处理办法

Spark HA模式访问Hadoop HA下的数据

Spark on Yarn with HA