开发者社区> 问答> 正文

为什么运行老是Failed to get master from ZK呢.本地模式可以运行

本地模式可以运行成功,但是一到集群模式来运行的话,就会报错Failed to get master from ZK,我看了zookeeper,有leader。这是为什么呢

展开
收起
成神也成魔 2016-05-10 10:22:22 12945 0
4 条回答
写回答
取消 提交回答
  • 热爱分布式技术
    Re为什么运行老是Failed to get master from ZK呢.本地模式可以运行
    HELP ME!!!!!!!!!!!!!!!!!!!!!!

    Fail to run nimbus
    java.lang.IllegalStateException: instance must be started before calling this method
            at com.google.common.base.Preconditions.checkState(Preconditions.java:176) ~[guava-16.0.1.j
    ar:na]
            at org.apache.curator.framework.imps.CuratorFrameworkImpl.getChildren(CuratorFrameworkImpl.
    java:390) ~[curator-framework-2.5.0.jar:na]
            at com.alibaba.jstorm.zk.Zookeeper.getChildren(Zookeeper.java:184) ~[jstorm-core-2.1.1.jar:
    na]
            at com.alibaba.jstorm.cluster.DistributedClusterState.get_children(DistributedClusterState.
    java:130) ~[jstorm-core-2.1.1.jar:na]
            at com.alibaba.jstorm.cluster.StormZkClusterState.active_storms(StormZkClusterState.java:32
    9) ~[jstorm-core-2.1.1.jar:na]

    -------------------------

    Re为什么运行老是Failed to get master from ZK呢.本地模式可以运行
    [ERROR 2016-06-19 19:51:12 c.a.j.d.n.NimbusServer:137 main] Fail to run nimbus
    java.lang.IllegalStateException: instance must be started before calling this method
            at com.google.common.base.Preconditions.checkState(Preconditions.java:176) ~[guava-16.0.1.j
    ar:na]
            at org.apache.curator.framework.imps.CuratorFrameworkImpl.getChildren(CuratorFrameworkImpl.
    java:390) ~[curator-framework-2.5.0.jar:na]
            at com.alibaba.jstorm.zk.Zookeeper.getChildren(Zookeeper.java:184) ~[jstorm-core-2.1.1.jar:
    na]
            at com.alibaba.jstorm.cluster.DistributedClusterState.get_children(DistributedClusterState.
    java:130) ~[jstorm-core-2.1.1.jar:na]
            at com.alibaba.jstorm.cluster.StormZkClusterState.active_storms(StormZkClusterState.java:32
    9) ~[jstorm-core-2.1.1.jar:na]
            at com.alibaba.jstorm.daemon.nimbus.NimbusUtils.cleanupCorruptTopologies(NimbusUtils.java:2
    90) ~[jstorm-core-2.1.1.jar:na]
            at com.alibaba.jstorm.daemon.nimbus.NimbusServer.init(NimbusServer.java:168) [jstorm-core-2
    .1.1.jar:na]
            at com.alibaba.jstorm.daemon.nimbus.NimbusServer.launchServer(NimbusServer.java:132) [jstor
    m-core-2.1.1.jar:na]
            at com.alibaba.jstorm.daemon.nimbus.NimbusServer.main(NimbusServer.java:95) [jstorm-core-2.
    1.1.jar:na]
    [INFO 2016-06-19 19:51:12 c.a.j.d.n.NimbusServer:295 main] Notify to quit nimbus
    [INFO 2016-06-19 19:51:12 c.a.j.d.n.NimbusServer:142 main] Quit nimbus
    2016-06-19 20:32:31
    赞同 展开评论 打赏
  • 同学,你好,这个错误应该是找不到nimbus。麻烦你看下nimbus日志,可以贴出来

    -------------------------

    不是, 你把task理解成单独线程把

    2016-05-10 19:18:32
    赞同 展开评论 打赏
  • Re回 1楼中间件那珂的帖子







    nimbus节点和zookeeper的leader不是在一个节点上面,本地模式可以运行,共有三个节点,一使用集群模式,就提示:

    Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Failed to get master from ZK.
        at backtype.storm.utils.NimbusClient.getConfiguredClientAs(NimbusClient.java:80)
        at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:45)
        at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:40)
        at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:115)
        at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:59)
        at com.jstorm.practice.kaopu.Main.main(Main.java:33)
    Caused by: java.lang.RuntimeException: Failed to get master from ZK.
        at backtype.storm.security.auth.ThriftClient.getMaster(ThriftClient.java:131)
        at backtype.storm.security.auth.ThriftClient.<init>(ThriftClient.java:87)
        at backtype.storm.utils.NimbusClient.<init>(NimbusClient.java:94)
        at backtype.storm.utils.NimbusClient.getConfiguredClientAs(NimbusClient.java:76)
        ... 5 more
    Caused by: java.lang.RuntimeException: No alive nimbus
        at backtype.storm.security.auth.ThriftClient.getMasterByZk(ThriftClient.java:103)
        at backtype.storm.security.auth.ThriftClient.getMaster(ThriftClient.java:128)
        ... 8 more

    -------------------------

    回 1楼中间件那珂的帖子
    谢谢你的解答。

    -------------------------

    回 4楼玄弟的帖子
    恩,好的,真是麻烦你了,谢谢你。我自己去看一下,看看能不能解决。谢谢你

    -------------------------

    回 4楼玄弟的帖子
    你好,我有一个问题,百度找了很久,感觉网上都没有说清楚,相关的书解释不清晰,就是executor拥有多个task的时候,这些task是不是共享组件(spout/bolt)里面的资源,比如,一个bolt里面定义了一个ConcurrentMap,那么这些task干活的时候,是不是共享这一个Map.谢谢你。
    2016-05-10 16:54:21
    赞同 展开评论 打赏
  • 同学,把错误日志和配置信息贴一下吧
    2016-05-10 13:50:12
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Getting Ready to Use Redis with Apache Spark 立即下载
《基于 Service Worker 实现在线代理》 立即下载
MongoShake -- Multi Active-Active and Cross-Region Disaster Recoverable MongoDB Service 立即下载

相关实验场景

更多