概述
本文开始安装storm集群。
部署过程
- 上传storm安装包、解压和配置环境变量
cd /usr/local
tar -zxvf apache-storm-1.1.0.tar.gz
mv apache-storm-1.1.0 storm
# 配置环境变量,添加 /usr/local/bin
vi ~/.bashrc
export STORM_HOME=/usr/local/storm
export PATH=$PATH:$ZOOKEEPER_HOME/bin:$SCALA_HOME/bin:$STORM_HOME/bin
source ~/.bashrc
# 查看 storm 版本
storm version
Running: java -client -Ddaemon.name= -Dstorm.options= -Dstorm.home=/usr/local/storm -Dstorm.log.dir=/usr/local/storm/logs -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.conf.file= -cp /usr/local/storm/lib/storm-core-1.1.0.jar:/usr/local/storm/lib/kryo-3.0.3.jar:/usr/local/storm/lib/reflectasm-1.10.1.jar:/usr/local/storm/lib/asm-5.0.3.jar:/usr/local/storm/lib/minlog-1.3.0.jar:/usr/local/storm/lib/objenesis-2.1.jar:/usr/local/storm/lib/clojure-1.7.0.jar:/usr/local/storm/lib/ring-cors-0.1.5.jar:/usr/local/storm/lib/disruptor-3.3.2.jar:/usr/local/storm/lib/log4j-api-2.8.jar:/usr/local/storm/lib/log4j-core-2.8.jar:/usr/local/storm/lib/log4j-slf4j-impl-2.8.jar:/usr/local/storm/lib/slf4j-api-1.7.21.jar:/usr/local/storm/lib/log4j-over-slf4j-1.6.6.jar:/usr/local/storm/lib/servlet-api-2.5.jar:/usr/local/storm/lib/storm-rename-hack-1.1.0.jar:/usr/local/storm/conf org.apache.storm.utils.VersionInfo
Storm 1.1.0
URL https://git-wip-us.apache.org/repos/asf/storm.git -r e40d213de7067f7d3aa4d4992b81890d8ed6ff31
Branch (no branch)
Compiled by ptgoetz on 2017-03-21T17:04Z
From source with checksum 4ddc442e8b804654454ab26fbec6348
2.修改配置文件
mkdir /var/storm
vi /usr/local/storm/conf/storm.yaml
# 需要修改的配置内容如下:
storm.zookeeper.servers:
- "192.168.201.33"
- "192.168.201.34"
- "192.168.201.35"
nimbus.seeds: ["192.168.201.33"]
storm.local.dir: "/var/storm"
# 指定每个机器上可以启动多少个 worker,一个端口号代表一个
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
启动storm 集群及其ui 界面
启动master节点,三个服务器的supervisor节点,以及master节点上的storm界面:
一个节点,storm nimbus >/dev/null 2>&1 &
三个节点,storm supervisor >/dev/null 2>&1 &
一个节点,storm ui >/dev/null 2>&1 &
启动logviewer: storm logviewer >/dev/null 2>&1 &
杀掉:storm kill WordCountTopology
访问storm界面