1
votes

I'm following the http://jayatiatblogs.blogspot.com/2011/11/storm-installation.html & http://seaip.narlabs.org.tw/upload/content_file/547c1db495987.pdf to set up my Apache Storm & Apache Zookeeper cluster at Ubuntu 14.04 LTS in Amazon Web Services EC2.

Below are my zoo.cfg for my slave nodes:

## The number of milliseconds of each tick. The length of a single tick, which i
s the basic time unit used by ZooKeeper, as measured in milliseconds.
## It is used to regulate heartbeats, and timeouts. For example, the minimum ses
sion timeout will be 2 ticks.
tickTime=2000

## The number of ticks that the initial synchronization phase can take
## The new entry, initLimit is timeouts ZooKeeper uses to limit the length of ti
me the ZooKeeper servers in quorum have to connect to a leader.
initLimit=1000

## The number of ticks that can pass between sending a request and getting an ac
knowledgement
## Amount of time, in ticks to allow followers to sync with ZooKeeper. If follow
ers fall too far behind a leader, they will be dropped.
## The entry syncLimit limits how far out of date a server can be from a leader.
syncLimit=500

## The directory where the snapshot is stored. The location where ZooKeeper will
 store the in-memory database snapshots and, unless specified otherwise, the tra
nsaction log of updates to the database.
dataDir=/home/ubuntu/zookeeper-data

## The location of the log file. Write the transaction log to the dataLogDir rat
her than the dataDir.
#dataLogDir=/home/ubuntu/zookeeper/log/data_log

## The port to listen for client connections; that is, the port that clients att
empt to connect to.
clientPort=2181

## No need to put in standalone mode
## server.id = host:port:port
server.1=10.0.0.79:2888:3888
server.2=10.0.0.124:2888:3888
server.3=10.0.0.84:2888:3888

## The number of snapshots to retain in dataDir
## When enabled, ZooKeeper auto purge feature retains the autopurge.snapRetainCo
unt most recent snapshots and the corresponding transaction logs in the dataDir
and dataLogDir respectively and deletes the rest.
## Defaults to 3. Minimum value is 3.
autopurge.snapRetainCount=3

## Purge task interval in hours. Enable regular purging of old data and transact
ion logs every 24 hours
## Set to "0" to disable auto purge feature
## The time interval in hours for which the purge task has to be triggered. Set
to a positive integer (1 and above) to enable the auto purging. Defaults to 0.
autopurge.purgeInterval=1

The storm.conf at my slave nodes is as below:

########### These MUST be filled in for a storm configuration
 storm.zookeeper.server:
     - "10.0.0.79"
     - "10.0.0.124"
     - "10.0.0.84"
#     - "localhost"
 storm.zookeeper.port: 2181
# storm.zookeeper.port: 2888:3888

# nimbus.host: "localhost"
 nimbus.host: "10.0.0.185"
# nimbus.thrift.port: 6627
#
#ui.port: 8772
#
 storm.local.dir: "/home/ubuntu/storm/data"
 java.library.path: "/usr/lib/jvm/java-7-oracle"

 supervisor.slots.ports:
     - 6700
     - 6701
     - 6702
     - 6703
     - 6704
#
# worker.childopts: "-Xmx768m"
# nimbus.childopts: "-Xmx512m"
# supervisor.childopts: "-Xmx256m"
#
# ##### These may optionally be filled in:
#
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"

## Metrics Consumers
# topology.metrics.consumer.register:
#   - class: "backtype.storm.metric.LoggingMetricsConsumer"
#     parallelism.hint: 1
#   - class: "org.mycompany.MyMetricsConsumer"
#     parallelism.hint: 1
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"

The myid at zookeeper/conf for 10.0.0.79 is 1, for 10.0.0.124 is 2, for 10.0.0.84 is 3. However, when I start run my Apache Zookeeper using zkServer.sh start, then I show the status using zkServer.sh status, this message shows:

JMX enabled by default
Using config: /home/ubuntu/zookeeper/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

When I issue the command from one of the slave node, e.g. from 10.0.0.124: zkCli.sh -server 10.0.0.84:2181 , the error below shown:

2015-05-27 04:44:03,745 [myid:] - INFO  [main-SendThread(10.0.0.84:2181):ClientC                                                                                        nxn$SendThread@975] - Opening socket connection to server 10.0.0.84/10.0.0.84:21                                                                                        81. Will not attempt to authenticate using SASL (unknown error)
Welcome to ZooKeeper!
2015-05-27 04:44:03,761 [myid:] - WARN  [main-SendThread(10.0.0.84:2181):ClientC                                                                                        nxn$SendThread@1102] - Session 0x0 for server null, unexpected error, closing so                                                                                        cket connection and attempting reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744                                                                                        )
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocket                                                                                        NIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
JLine support is enabled
[zk: 10.0.0.84:2181(CONNECTING) 0]

Anyone knows what is the possible causes & how to solve it?

1

1 Answers

2
votes

I think zookeeper is not running properly.

myid file should be located in dataDir=/home/ubuntu/zookeeper-data not conf directory.

Refer to the zookeeper documentation