apache-storm分佈式計算(drpc)開發心得

首先這東西是個拼湊出來的東西,啥zookeeper,nimbus,supervisor,drpc,一個服務不能少。對於我來講一開始不是部署集羣還能夠,大體步驟是先裝zookeeper,這東西運行起來後,你才能跑nimbus,一開始單個,我就用apache-storm裏的那個zookeeper,沒問題。html

但我開始部署集羣的時候發現,若是我在主節點開一個zookeeper,子節點的supervisor這東西在管理界面看不到,apache

怎刷新都只有一個supervisor,怪哉,我看了個人zookeeper集羣是對的啊,後來個人也不知咋弄的,把主節點的zookeeper關了,弄到子節點了,這supervisor出來了,而後再加一臺機器上zookeeper弄成集羣后,終於出現2個supervisor了,還有一點注意的是,supervisor裏的slots這裏個數有多少個就得在配置文件裏寫多少個端口,默認是4個。若是少了slots那個work是不夠用的ide

supervisor.slots.portsui

啓動命令:this

setsid storm dev-zookeeperspa

setsid storm nimbus日誌

setsid storm supervisororm

setsid storm drpcserver

配置文件:htm

[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這兩個目錄吧,刪乾淨了。

相關文章
相關標籤/搜索