1. 安裝配置zookeeperhtml
tar -xf zookeeper-3.4.6.tar.gz
將解壓後的zookeeper-3.4.6文件放在系統的/home/storm/中。java
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/storm/zookeeper-3.4.3/zookeeperdir/zookeeper-data
dataLogDir=/home/storm/zookeeper-3.4.3/zookeeperdir/logs
# the port at which the clients will connect
clientPort=2181
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
# 2888,3888 are election port
server.1=zookeeper:2888:3888
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/home/storm/zookeeper/data
# the port at which the clients will connect
clientPort=2181
server.1=192.168.1.222:2888:3888
server.2=192.168.1.223:2888:3888
server.3=192.168.1.224:2888:3888
sudo vi /etc/profile
export ZOOKEEPER_HOME=/home/storm/zookeeper-3.4.6node
zookeeper-3.4.6/bin/zkServer.sh start
注意:須要每一個節點都運行上述命令!linux
tar xvf zeromq-2.1.7.tar.gz
cd zeromq-2.1.7
./configure
make
sudo make install
unzip jzmq-master.zip
cd jzmq-master
./autogen.sh
./configure
make
sudo make install
安裝時,可能碰到兩個錯誤:git
tar xvf storm-0.9.5.tar.gz
cd storm-0.9.5
修改配置文件 conf/storm.yamlgithub
storm.zookeeper.servers:
- "192.168.1.222"
- "192.168.1.223"
- "192.168.1.224"
- "192.168.1.225"
nimbus.host: "192.168.2.222"
ui.port: 9090
#
#
# ##### 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"
#
storm.local.dir: "/home/storm/storm_workdir"
java.library.path: "/usr/local/lib:/usr/lib"
storm nimbus &
storm ui &
從節點apache
storm supervisor &
storm ui &(可選)
執行jps 命令瀏覽器
在沒有運行任務時,咱們必須應該要看到4個進程:服務器
QuorumPeerMain、nimbus、core、supervisoride
使用瀏覽器:
http://192.168.1.222:9090/ 能夠看到Storm UI 界面
storm jar stom-wordcount.jar storm.starter.WordCountTopology wordcount