我跟随http://jayatiatblogs.blogspot.com/2011/11/storm-installation.html& http://seaip.narlabs.org.tw/upload/content_file/547c1db495987.pdf设置我的Apache Storm&亚马逊网络服务EC2中Ubuntu 14.04 LTS的Apache Zookeeper集群。
以下是我的slave.cfg for 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
我的从属节点上的storm.conf如下:
########### 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"
在zookeeper / conf为10.0.0.79的myid为1,对于10.0.0.124为2,对于10.0.0.84为3。 但是,当我使用zkServer.sh start开始运行我的Apache Zookeeper时,我会使用zkServer.sh状态显示状态,此消息显示:
JMX enabled by default
Using config: /home/ubuntu/zookeeper/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
当我从其中一个从节点发出命令时,例如从10.0.0.124开始:zkCli.sh -server 10.0.0.84:2181,显示以下错误:
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]
任何人都知道可能的原因是什么?怎么解决呢?
答案 0 :(得分:2)
我认为zookeeper运行不正常。
myid文件应位于dataDir = / home / ubuntu / zookeeper-data not conf目录中。