storm集群 安装笔记

015年03月19日 23:28:19

本文主要是参照strom的管网中的document中来进行安装,管网地址

1,首先需要安装zookeeper集群.可参考管网或网络上安装(很简单).

2,在storm的work机器上和nimbus机器上安装相关的依赖.即需安装jdk1.6+和python2.6+版本.

3,下载storm的二进制文件,我这里下载了0.93版本的.

4,解压storm的tar包到指定的目录(STORM_DIR).

5,将STORM_DIR配置到环境变量中.并在此目录下新建一个目录叫logs,这样storm的log的日志就会输出到这个logs目录下面.log日志的配置是在logback下面的cluster.xml里进行配置.

6,修改conf/storm.yaml文件.修改内容如下:

[html] view plain copy

storm.zookeeper.servers:  

     - "nacey-master"  

     - "nacey-node2"  

nimbus.host: "nacey-master"  

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

supervisor.slots.ports:  

     - 6700  

     - 6701  

     - 6702  

     - 6703  

ui.port: 8081   

注意这里每个键后面必须空格后才能加键的值.不然启动的时候会提示文件加载错误.

其实这个配置文件中的配置会覆盖到defaults.yaml这个文件.默认的配置如下:

[html] view plain copy

# Licensed to the Apache Software Foundation (ASF) under one  

# or more contributor license agreements.  See the NOTICE file  

# distributed with this work for additional information  

# regarding copyright ownership.  The ASF licenses this file  

# to you under the Apache License, Version 2.0 (the  

# "License"); you may not use this file except in compliance  

# with the License.  You may obtain a copy of the License at  

#  

# http://www.apache.org/licenses/LICENSE-2.0  

#  

# Unless required by applicable law or agreed to in writing, software  

# distributed under the License is distributed on an "AS IS" BASIS,  

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  

# See the License for the specific language governing permissions and  

# limitations under the License.  



########### These all have default values as shown  

########### Additional configuration goes into storm.yaml  


java.library.path: "/usr/local/lib:/opt/local/lib:/usr/lib"  


### storm.* configs are general configurations  

# the local dir is where jars are kept  

storm.local.dir: "storm-local"  

storm.zookeeper.servers:  

    - "localhost"  

storm.zookeeper.port: 2181  

storm.zookeeper.root: "/storm"  

storm.zookeeper.session.timeout: 20000  

storm.zookeeper.connection.timeout: 15000  

storm.zookeeper.retry.times: 5  

storm.zookeeper.retry.interval: 1000  

storm.zookeeper.retry.intervalceiling.millis: 30000  

storm.zookeeper.auth.user: null  

storm.zookeeper.auth.password: null  

storm.cluster.mode: "distributed" # can be distributed or local  

storm.local.mode.zmq: false  

storm.thrift.transport: "backtype.storm.security.auth.SimpleTransportPlugin"  

storm.principal.tolocal: "backtype.storm.security.auth.DefaultPrincipalToLocal"  

storm.group.mapping.service: "backtype.storm.security.auth.ShellBasedGroupsMapping"  

storm.messaging.transport: "backtype.storm.messaging.netty.Context"  

storm.nimbus.retry.times: 5  

storm.nimbus.retry.interval.millis: 2000  

storm.nimbus.retry.intervalceiling.millis: 60000  

storm.auth.simple-white-list.users: []  

storm.auth.simple-acl.users: []  

storm.auth.simple-acl.users.commands: []  

storm.auth.simple-acl.admins: []  

storm.meta.serialization.delegate: "backtype.storm.serialization.ThriftSerializationDelegate"  


### nimbus.* configs are for the master  

nimbus.host: "localhost"  

nimbus.thrift.port: 6627  

nimbus.thrift.threads: 64  

nimbus.thrift.max_buffer_size: 1048576  

nimbus.childopts: "-Xmx1024m"  

nimbus.task.timeout.secs: 30  

nimbus.supervisor.timeout.secs: 60  

nimbus.monitor.freq.secs: 10  

nimbus.cleanup.inbox.freq.secs: 600  

nimbus.inbox.jar.expiration.secs: 3600  

nimbus.task.launch.secs: 120  

nimbus.reassign: true  

nimbus.file.copy.expiration.secs: 600  

nimbus.topology.validator: "backtype.storm.nimbus.DefaultTopologyValidator"  

nimbus.credential.renewers.freq.secs: 600  


### ui.* configs are for the master  

ui.host: 0.0.0.0  

ui.port: 8080  

ui.childopts: "-Xmx768m"  

ui.actions.enabled: true  

ui.filter: null  

ui.filter.params: null  

ui.users: null  

ui.header.buffer.bytes: 4096  

ui.http.creds.plugin: backtype.storm.security.auth.DefaultHttpCredentialsPlugin  


logviewer.port: 8000  

logviewer.childopts: "-Xmx128m"  

logviewer.cleanup.age.mins: 10080  

logviewer.appender.name: "A1"  


logs.users: null  


drpc.port: 3772  

drpc.worker.threads: 64  

drpc.max_buffer_size: 1048576  

drpc.queue.size: 128  

drpc.invocations.port: 3773  

drpc.invocations.threads: 64  

drpc.request.timeout.secs: 600  

drpc.childopts: "-Xmx768m"  

drpc.http.port: 3774  

drpc.https.port: -1  

drpc.https.keystore.password: ""  

drpc.https.keystore.type: "JKS"  

drpc.http.creds.plugin: backtype.storm.security.auth.DefaultHttpCredentialsPlugin  

drpc.authorizer.acl.filename: "drpc-auth-acl.yaml"  

drpc.authorizer.acl.strict: false  


transactional.zookeeper.root: "/transactional"  

transactional.zookeeper.servers: null  

transactional.zookeeper.port: null  


### supervisor.* configs are for node supervisors  

# Define the amount of workers that can be run on this machine. Each worker is assigned a port to use for communication  

supervisor.slots.ports:  

    - 6700  

    - 6701  

    - 6702  

    - 6703  

supervisor.childopts: "-Xmx256m"  

supervisor.run.worker.as.user: false  

#how long supervisor will wait to ensure that a worker process is started  

supervisor.worker.start.timeout.secs: 120  

#how long between heartbeats until supervisor considers that worker dead and tries to restart it  

supervisor.worker.timeout.secs: 30  

#how many seconds to sleep for before shutting down threads on worker  

supervisor.worker.shutdown.sleep.secs: 1  

#how frequently the supervisor checks on the status of the processes it's monitoring and restarts if necessary  

supervisor.monitor.frequency.secs: 3  

#how frequently the supervisor heartbeats to the cluster state (for nimbus)  

supervisor.heartbeat.frequency.secs: 5  

supervisor.enable: true  

supervisor.supervisors: []  

supervisor.supervisors.commands: []  



### worker.* configs are for task workers  

worker.childopts: "-Xmx768m"  

worker.gc.childopts: ""  

worker.heartbeat.frequency.secs: 1  


# control how many worker receiver threads we need per worker  

topology.worker.receiver.thread.count: 1  


task.heartbeat.frequency.secs: 3  

task.refresh.poll.secs: 10  

task.credentials.poll.secs: 30  


zmq.threads: 1  

zmq.linger.millis: 5000  

zmq.hwm: 0  



storm.messaging.netty.server_worker_threads: 1  

storm.messaging.netty.client_worker_threads: 1  

storm.messaging.netty.buffer_size: 5242880 #5MB buffer  

# Since nimbus.task.launch.secs and supervisor.worker.start.timeout.secs are 120, other workers should also wait at least that long before giving up on connecting to the other worker. The reconnection period need also be bigger than storm.zookeeper.session.timeout(default is 20s), so that we can abort the reconnection when the target worker is dead.  

storm.messaging.netty.max_retries: 300  

storm.messaging.netty.max_wait_ms: 1000  

storm.messaging.netty.min_wait_ms: 100  


# If the Netty messaging layer is busy(netty internal buffer not writable), the Netty client will try to batch message as more as possible up to the size of storm.messaging.netty.transfer.batch.size bytes, otherwise it will try to flush message as soon as possible to reduce latency.  

storm.messaging.netty.transfer.batch.size: 262144  

# Sets the backlog value to specify when the channel binds to a local address  

storm.messaging.netty.socket.backlog: 500  

# We check with this interval that whether the Netty channel is writable and try to write pending messages if it is.  

storm.messaging.netty.flush.check.interval.ms: 10  


# By default, the Netty SASL authentication is set to false.  Users can override and set it true for a specific topology.  

storm.messaging.netty.authentication: false  


# default number of seconds group mapping service will cache user group  

storm.group.mapping.service.cache.duration.secs: 120  


### topology.* configs are for specific executing storms  

topology.enable.message.timeouts: true  

topology.debug: false  

topology.workers: 1  

topology.acker.executors: null  

topology.tasks: null  

# maximum amount of time a message has to complete before it's considered failed  

topology.message.timeout.secs: 30  

topology.multilang.serializer: "backtype.storm.multilang.JsonSerializer"  

topology.skip.missing.kryo.registrations: false  

topology.max.task.parallelism: null  

topology.max.spout.pending: null  

topology.state.synchronization.timeout.secs: 60  

topology.stats.sample.rate: 0.05  

topology.builtin.metrics.bucket.size.secs: 60  

topology.fall.back.on.java.serialization: true  

topology.worker.childopts: null  

topology.executor.receive.buffer.size: 1024 #batched  

topology.executor.send.buffer.size: 1024 #individual messages  

topology.receiver.buffer.size: 8 # setting it too high causes a lot of problems (heartbeat thread gets starved, throughput plummets)  

topology.transfer.buffer.size: 1024 # batched  

topology.tick.tuple.freq.secs: null  

topology.worker.shared.thread.pool.size: 4  

topology.disruptor.wait.strategy: "com.lmax.disruptor.BlockingWaitStrategy"  

topology.spout.wait.strategy: "backtype.storm.spout.SleepSpoutWaitStrategy"  

topology.sleep.spout.wait.strategy.time.ms: 1  

topology.error.throttle.interval.secs: 10  

topology.max.error.report.per.interval: 5  

topology.kryo.factory: "backtype.storm.serialization.DefaultKryoFactory"  

topology.tuple.serializer: "backtype.storm.serialization.types.ListDelegateSerializer"  

topology.trident.batch.emit.interval.millis: 500  

topology.testing.always.try.serialize: false  

topology.classpath: null  

topology.environment: null  

topology.bolts.outgoing.overflow.buffer.enable: false  


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

备注:如果你的机器的网络地址存在ipv6的地址,storm启动的时候默认是启用ipv6的地址,但实际上storm是不能使用ipv6的地址,故需在启动脚本中(storm)增加-Djava.net.preferIPv4Stack=true.如果使用了ipv6有可能进程启动是正常的,但是在访问stormui的时候,页面会提示如下错误:

Storm UI getting Internal Server Error :org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused

按照如上的修改后.即可解决如上错误.

7,启动.

  storm nimbus &

  storm supervisor &

  storm ui &

8,测试 ,通过浏览器访问http://{nimbus host}:8080.能够正常访问stormui.且响应了

Storm UI

Cluster Summary

VersionNimbus uptimeSupervisorsUsed slotsFree slotsTotal slotsExecutorsTasks

0.9.31m 45s104400

Topology summary

Supervisor summary

IdHostUptimeSlotsUsed slots

cbe9e1bd-5e43-4749-b187-c9a2c89081banacey-master1m 18s40

Nimbus Configuration

KeyValue

dev.zookeeper.path/tmp/dev-storm-zookeeper

drpc.childopts-Xmx768m

drpc.invocations.port3773

drpc.port3772

drpc.queue.size128

drpc.request.timeout.secs600

drpc.worker.threads64

java.library.path/usr/local/lib:/opt/local/lib:/usr/lib

logviewer.appender.nameA1

logviewer.childopts-Xmx128m

logviewer.port8000

nimbus.childopts-Xmx1024m

nimbus.cleanup.inbox.freq.secs

然后可将此storm打包发布到集群中的其他机器即可.

在其他机器上执行storm supervisor即可.

http://blog.csdn.net/nacey5201/article/details/44467755

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 200,738评论 5 472
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,377评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 147,774评论 0 333
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,032评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,015评论 5 361
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,239评论 1 278
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,724评论 3 393
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,374评论 0 255
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,508评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,410评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,457评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,132评论 3 316
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,733评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,804评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,022评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,515评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,116评论 2 341

推荐阅读更多精彩内容

  • Strom集群结构是有一个主节点(nimbus)和多个工作节点(supervisor)组成的主从结构,主节点通过配...
    看山远兮阅读 2,800评论 0 7
  • 目录 场景假设 调优步骤和方法 Storm 的部分特性 Storm 并行度 Storm 消息机制 Storm UI...
    mtide阅读 16,999评论 30 60
  • Date: Nov 17-24, 2017 1. 目的 积累Storm为主的流式大数据处理平台对实时数据处理的相关...
    一只很努力爬树的猫阅读 2,150评论 0 4
  • 1. Storm介绍: Storm是实时流计算框架。企业中典型实时分析框架搭建模式: Flume + Kafka ...
    奉先阅读 1,638评论 0 3
  • 办公室的人都在寂静着,只有空调发出的声音,在安静的环境里,声音便显的很大,我抬起头,看见外面的天气灰蒙蒙的,...
    风雪楼阅读 192评论 0 0