• Error contacting service. It is probably not running.


    平台:centos-6.3-i386

       jdk-7u51

            storm 0.9.1

       python 2.6.6

         hadoop 1.2.1

    运行zookeeperd后显示启动成功:


    JMX enabled by default
    Using config: /data/programfiles/zookeeper-3.4.5/bin/../conf/zoo.cfg
    Starting zookeeper ... STARTED


    但用bin/zkServer.sh status查看,反馈如下:


    JMX enabled by default
    Using config: /data/programfiles/zookeeper-3.4.5/bin/../conf/zoo.cfg
    Error contacting service. It is probably not running.


    很奇怪,我用netstat -lntup查了一下端口,没发现2181端口被启用


    查了zookeeper.out日志,发现如下的错误:


    2014-04-16 11:59:54,425 [myid:] - ERROR [main:ZooKeeperServerMain@63] - Unexpected exception, exiting abnormally
    java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:344)
        at sun.nio.ch.Net.bind(Net.java:336)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:95)
        at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:110)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

    从错误信息来看,是端口被使用了,但我用netstat -lntup是没被使用的,再用 lsof -i:2181,发现了2181端口果然被占用了


    [root@ programfiles]# lsof -i:2181
    COMMAND     PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
    memcached 15843 root   56u  IPv4 1650939492      0t0  TCP .:11213->.:eforward (ESTABLISHED)
    php-cgi   28154  www    7u  IPv4 1650939491      0t0  TCP .:eforward->.:11213 (ESTABLISHED)


    接下来就很好办了,启用另外一个端口就ok了

  • 相关阅读:
    敏捷软件开发——迭代计划版本号
    01背包问题
    南邮算法分析和实验设计1 分而治之
    PowerShell与Unix Shell对比:八大实例
    grep、sed、awk、perl、js、vim等对正则表达式的支持的差别
    perl的一些基本用法
    Lua学习笔记1
    在eclipse中建立lua开发环境
    MYSQL设置远程账户登陆总结,mysql修改、找回密码、增加新用户,MySQL数据库的23个注意事项
    LuaForWindows_v5.1.4-45和lua-5.1.4.tar.gz
  • 原文地址:https://www.cnblogs.com/mrchige/p/5907860.html
Copyright © 2020-2023  润新知