一、环境搭建
1. 下载
http://www.apache.org/dyn/closer.lua/storm/apache-storm-0.9.6/apache-storm-0.9.6.tar.gz
2. 解压
tar -zxvf apache-storm-0.9.6.tar.gz -C /opt/modules/
3. 修改配置
1)创建目录
mkdir -p /opt/modules/apache-storm-0.9.6/workspace
2)修改storm_env.ini
# The java implementation to use. If JAVA_HOME is not found we expect java to be in path JAVA_HOME:/opt/modules/jdk1.7.0_67 # JVM options to be used in "storm jar" commad #STORM_JAR_JVM_OPTS:
3)修改storm.yaml
########### These MUST be filled in for a storm configuration storm.zookeeper.servers: - "beifeng-hadoop-02" # - "server2" # storm.zookeeper.port: 2181 nimbus.host: "beifeng-hadoop-02" storm.local.dir: "/opt/modules/apache-storm-0.9.6/workspace" supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703 - 6704 - 6705 - 6706 - 6707 ui.port: 8081
4. 启动服务
nohup bin/storm nimbus >~/storm-nimbus-start.log 2>&1 & nohup bin/storm supervisor >~/storm-supervisor-start.log 2>&1 & nohup bin/storm ui >~/storm-ui-start.log 2>&1 & nohup bin/storm logviewer >~/storm-logviewer-start.log 2>&1 &
5. 打开UI界面
http://beifeng-hadoop-02:8081/
6. 验证安装结果
bin/storm jar examples/storm-starter/storm-starter-topologies-0.9.6.jar storm.starter.WordCountTopology wordcount