apache-storm分布式计算(drpc)开发心得

首先这东西是个拼凑出来的东西,啥zookeeper,nimbus,supervisor,drpc,一个服务不能少。对于我来说一开始不是部署集群还可以,大致步骤是先装zookeeper,这东西运行起来后,你才能跑nimbus,一开始单个,我就用apache-storm里的那个zookeeper,没问题。

但我开始部署集群的时候发现,如果我在主节点开一个zookeeper,子节点的supervisor这东西在管理界面看不到,

技术分享

怎刷新都只有一个supervisor,怪哉,我看了我的zookeeper集群是对的啊,后来我的也不知咋弄的,把主节点的zookeeper关了,弄到子节点了,这supervisor出来了,然后再加一台机器上zookeeper弄成集群后,终于出现2个supervisor了,还有一点注意的是,supervisor里的slots这里个数有多少个就得在配置文件里写多少个端口,默认是4个。如果少了slots那个work是不够用的

supervisor.slots.ports

启动命令:

setsid storm dev-zookeeper

setsid storm nimbus

setsid storm supervisor

setsid storm drpc

配置文件:

[root@iZ250epy36wZ conf]# vi storm.yaml 

storm.zookeeper.servers:

     - "10.171.112.224"

     - "10.171.115.20"

 storm.local.dir: "/data/storm/dir"

 nimbus.host: "10.173.0.31"

 dev.zookeeper.path: "/data/storm/tmp/zookeeper"

 topology.state.synchronization.timeout.secs: 10

supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703

 ui.port: "8089"

 drpc.servers:

     - "192.168.8.227"

     - "192.168.8.228"


部署worker:

storm jar storm-starter-0.9.2-incubating-full.jar storm.starter.BasicDRPCTopology basicdrcdpc

而最后提醒大家,zookeeper配置里有个啥日志输出的要配置啊,不然你一天的日志还是啥就是几个G,用不了几天你的空间就被占满了:就是autopurge.purgeInterval=1和

[root@iZ256vxb1a3Z conf]# vi 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=/data/storm/tmp/zookeeper

# 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

中途断了storm的话,注意先别启动,你打死启动不了的,先去清理supervisor  workers这两个目录吧,删干净了。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。