1.永久关闭防火墙 systemctl disable firewalld.service
2.安装jdk8和zookeeper3.5.6
3.下载上传到/usr/local,
切换路径 cd /usr/local
解压tar -xzvf apache-storm-2.1.0.tar.gz
4.配置环境变量
echo "export STORM_PATH=/usr/local/apache-storm-2.1.0">>/etc/profile
source /etc/profile
echo "export PATH=$PATH:$STORM_PATH/bin">>/etc/profile
source /etc/profile
5.软件配置
cd apache-storm-2.1.0
新建data文件夹
mkdir data
在conf/storm.yarml添加以下配置,
storm.zookeeper.servers:
- "node1"
- "node2"
- "node3"
storm.zookeeper.port: 2181
storm.local.dir: "/home/apache-storm-2.1.0/data"
nimbus.seeds: ["node1"]
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
ui.port: 8082
注意:配置storm.zookeeper.servers前面有空格,等等细节很严格
使用命令添加
echo -e " storm.zookeeper.servers:\n - "node1"\n - "node2"\n - "node3"\n storm.zookeeper.port: 2181\n storm.local.dir: "/home/apache-storm-2.1.0/data"\n nimbus.seeds: ["node1"]\n supervisor.slots.ports:\n - 6700\n - 6701\n - 6702\n - 6703\n ui.port: 8082" >>conf/storm.yaml
6.把配置复制到其他两台机器
scp conf/storm.yaml node2:/usr/local/apache-storm-2.1.0/conf
scp conf/storm.yaml node3:/usr/local/apache-storm-2.1.0/conf
7.启动zookeeper
zkServer.sh start
8.启动strom
主节点numbus和ui启动
storm nimbus &
storm ui &
从节点后台启动
storm supervisor &
9.用jps和查看日志判断是否启动成功
jps