测试环境上跑一个storm和zookeeper的应用.

测试环境要求不是那么高,所以zookeeper可以和Storm在同一个系统上.

zookeeper的安装运行比较简单,以zookeeper-3.4.8为例.

cpconf/zoo_sample.cfgconf/zoo.cfg

vim zoo.cfg

#ThenumberofmillisecondsofeachticktickTime=2000#Thenumberofticksthattheinitial#synchronizationphasecantakeinitLimit=10#Thenumberofticksthatcanpassbetween#sendingarequestandgettinganacknowledgementsyncLimit=5#thedirectorywherethesnapshotisstored.#donotuse/tmpforstorage,/tmphereisjust#examplesakes.dataDir=/export/data/zookeeper#theportatwhichtheclientswillconnectclientPort=2181#themaximumnumberofclientconnections.#increasethisifyouneedtohandlemoreclients#maxClientCnxns=60##Besuretoreadthemaintenancesectionofthe#administratorguidebeforeturningonautopurge.##http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance##ThenumberofsnapshotstoretainindataDirautopurge.snapRetainCount=2#Purgetaskintervalinhours#Setto"0"todisableautopurgefeatureautopurge.purgeInterval=1

下面这两个设置了可以减少日志的输出

autopurge.snapRetainCount=2

autopurge.purgeInterval=1

启动方法:

sh bin/zkServer.sh start

storm启动时,需要在storm.yaml中设置zookeeper的地址,就写127.0.0.1即可

storm.zookeeper.servers:-"127.0.0.1"