Storm实战之环境搭建

  去年研究过一段时间的Storm,当时环境搭建和start的代码看了一些,但是由于其他项目原因,没有时间继续,这段时间正好新公司这边需要Storm的应用,所以继续...


  环境搭建,网上已经有很多帖子,去年我也贴了,这次安装有些不同,主要是参考官方的文档,在官方的文档中,没有ZeroMQ和JZMQ的安装,所以这次我也没有安装,暂时没有发现问题。下面将安装步骤记录下来。



1.CenOS6.5安装,3台虚拟机

2.JDK1.7

3.Zookeeper安装

zoo.cfg的配置如下

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
#dataDir=/tmp/zookeeper
dataDir=/data/zookeeper/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

server.1=192.168.56.31:2881:3881
server.2=192.168.56.32:2881:3881
server.3=192.168.56.33:2881:3881

4.Storm的当前版本是0.9.2,但是官网上下载失败,所以找出去年的0.8.1和0.8.2,安装的是0.8.2

storm.yaml的配置如下

########### These MUST be filled in for a storm configuration
# storm.zookeeper.servers:
#     - "server1"
#     - "server2"
#
# nimbus.host: "nimbus"
#
#
# ##### These may optionally be filled in:
#   
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"

 storm.zookeeper.servers:
     - "192.168.56.31"
     - "192.168.56.32"
     - "192.168.56.33"

 nimbus.host: "192.168.56.31"

#storm.zookeeper.servers:
#      - "192.168.56.31"
#      - "192.168.56.32"
#      - "192.168.56.33"
#  nimbus.host: "192.168.56.31"
 storm.local.dir: "/data/storm/workdir"
 ui.port: "18080"
 supervisor.slots.ports:
  - 6700
  - 6701
  - 6702
  - 6703


5.Storm启动

关闭防火墙

各机器启动zookeeper:bin/zkSever.sh start

Nimbus机器启动:

bin/storm nimbus&

bin/storm ui&

Supervisor各机器启动:

bin/storm supervisor&


6.启动后将jar包传到storm/tools下,运行

storm jar tools/Storm2.jar helloworld.SimpleTopology

前提:将storm加入到环境变量中

/etc/profile

JAVA_HOME=/data/jdk
export STORM_HOME=/data/storm
PATH=$JAVA_HOME/bin:$STORM_HOME/bin:$PATH
export JAVA_HOME PATH


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值