上传apache-storm-1.1.0.tar.gz到/usr/local
执行命令:
tar -zxvf apache-storm-1.1.0.tar.gz
rm -rf apache-storm-1.1.0.tar.gz
mv apache-storm-1.1.0/ storm
vim ~/.bashrc
添加以下内容:
export STORM_HOME=/usr/local/storm
export PATH=$PATH:$STORM_HOME/bin
执行命令:
source ~/.bashrc
mkdir /var/storm
vim /usr/local/storm/conf/storm.yaml
修改以下内容:
storm.zookeeper.servers:
- "192.168.2.161"
- "192.168.2.162"
- "192.168.2.163"
nimbus.seeds: ["192.168.2.161"]
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
执行启动命令:
一个nimbus 节点:storm nimbus >/dev/null 2>&1 &
三个节点:storm supervisor >/dev/null 2>&1 &
一个nimbus节点:storm ui >/dev/null 2>&1 &
两个supervisor 节点启动logviewer:
storm logviewer >/dev/null 2>&1 &
访问ui界面:
http://192.168.2.161:8080
提交任务:
storm jar storm-helloworld-0.0.1-SNAPSHOT.jar com.xu.eshop.storm.WordCountTopology WordCountTopology
kill任务:
storm kill WordCountTopology