apache-storm分布式计算(drpc)开发心得
2019獨角獸企業重金招聘Python工程師標準>>>
首先這東西是個拼湊出來的東西,啥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這兩個目錄吧,刪干凈了。
轉載于:https://my.oschina.net/u/2337008/blog/392788
新人創作打卡挑戰賽發博客就能抽獎!定制產品紅包拿不停!總結
以上是生活随笔為你收集整理的apache-storm分布式计算(drpc)开发心得的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android免费短信验证
- 下一篇: java开发中jdbc连接数据 库的操作