部署Storm
下载并解压Storm
- 下载Storm软件包。
1
wget https://archive.apache.org/dist/storm/apache-storm-1.2.1/apache-storm-1.2.1.tar.gz
- 将apache-storm-1.2.1.tar.gz放置于server1节点的“/usr/local”目录下,并解压。
1 2
mv apache-storm-1.2.1.tar.gz /usr/local tar -zxvf apache-storm-1.2.1.tar.gz
- 建立软链接,便于后期版本更换。
1
ln -s apache-storm-1.2.1 storm
添加Storm到环境变量
- 打开配置文件。
1
vi /etc/profile
- 按“i”进入编辑模式,添加Storm到环境变量。
1 2
export STORM_HOME=/usr/local/storm export PATH=$STORM_HOME/bin:$PATH
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 使环境变量生效。
1
source /etc/profile
修改Storm配置文件

Storm所有的配置文件都在“$STORM_HOME/conf”目录下,修改以下配置文件前,需要切换到“$STORM_HOME/conf”目录。
1
|
cd $STORM_HOME/conf |
- 修改storm.yaml文件。
1
vi storm.yaml
- 按“i”进入编辑模式,修改内容如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
storm.zookeeper.servers: - "agent1"# 可改成对应的IP地址 - "agent2" - "agent3" storm.zookeeper.port: 2181 storm.local.dir: "/usr/local/storm/stormLocal"# 需手动创建 nimbus.seeds: ["server1"]# 可改成对应的IP地址 supervisor.slots.ports:# slot个数视情况而定 - 6700 - 6701 - 6702 - 6703 storm.health.check.dir: "healthchecks" storm.health.check.timeout.ms: 5000
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
同步配置到其它节点
- 拷贝apache-storm-1.2.1到agent1-3的“/usr/local”目录下。
1 2 3
scp -r /usr/local/apache-storm-1.2.1 root@agent1:/usr/local scp -r /usr/local/apache-storm-1.2.1 root@agent2:/usr/local scp -r /usr/local/apache-storm-1.2.1 root@agent3:/usr/local
- 登录到agent1-3节点,为apache-storm-1.2.1建立软链接。
1 2
cd /usr/local ln -s apache-storm-1.2.1 storm