1.编辑host文件 vi /etc/hosts 三台主机同时修改
192.168.2.20 storm01 192.168.2.21 storm02 192.168.2.22 storm03
2.主节点上(storm)配置storm
(1)解压 apache-storm-1.0.3
(2)设置环境变量 : vi ~/.bash_profile
STORM_HOME=/usr/local/apps/apache-storm-1.0.3 export STORM_HOME PATH=$STORM_HOME/bin:$PATH export PATH
(3)source ~/.bash_profile
(4)创建tmp目录 : /usr/local/apps/apache-storm-1.0.3/tmp 保存storm的数据
(5)编辑storm.yaml : /usr/local/apps/apache-storm-1.0.3/conf
zookeeper主机
storm.zookeeper.servers: - "192.168.2.20" - "192.168.2.21" - "192.168.2.22"
配置nimbus主节点
nimbus.seeds: ["192.168.2.20"] ---["host1","host2","host3"] 多个主节点实现HA的功能
配置storm数据存储的目录:
storm.local.dir:"/usr/local/apps/apache-storm-1.0.3/tmp"
配置supervisor的worker端口数:
supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703
复制storm应用到21,22主机上
scp -r apache-storm-1.0.3/ [email protected]:/usr/local/apps
(6)启动storm顺序
1.启动主节点nimbus : storm01上启动 storm nimbus &
2.启动从节点supervisor:storm02,storm03 storm supervisor &
遇到的问题:启动不起来,报错:
could not found expected ‘:‘ in ‘reader‘, line 28, column 1: supervisor.slots.ports:
配置文件需要有空格:坑爹的地方
空格nimbus.host: "10.10.10.10" 空格storm.zookeeper.port: 2181 空格storm.local.dir:空格"date/storm-2.2.1/data" 空格supervisor.slots.ports:
最后jps查看进程
-- 主节点 [[email protected]-server-00 conf]# jps 7579 nimbus 6268 QuorumPeerMain 7678 Jps -- 从节点 [[email protected]-server-01 conf]# jps 5706 QuorumPeerMain 7076 Supervisor 7171 Jps
时间: 2024-11-10 22:32:59