为什么运行老是Failed to get master from ZK呢.本地模式可以运行-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

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

成神也成魔 2016-05-10 10:22:22 11641
本地模式可以运行成功,但是一到集群模式来运行的话,就会报错Failed to get master from ZK,我看了zookeeper,有leader。这是为什么呢
分享到
取消 提交回答
全部回答(4)
  • 小金子
    2016-06-19 20:32:31
    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
    0 0
  • 玄弟
    2016-05-10 19:18:32
    同学,你好,这个错误应该是找不到nimbus。麻烦你看下nimbus日志,可以贴出来

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

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

    0 0
  • 成神也成魔
    2016-05-10 16:54:21
    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.谢谢你。
    0 0
  • 中间件那珂
    2016-05-10 13:50:12
    同学,把错误日志和配置信息贴一下吧
    0 0
添加回答
云计算
使用钉钉扫一扫加入圈子
+ 订阅

时时分享云计算技术内容,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

推荐文章