数学之路-分布式计算-storm(3)

5、安装zookeeper

本博客全部内容是原创。假设转载请注明来源

http://blog.csdn.net/myhaspl/

[email protected]:~/jzmq-master$cd ..

[email protected]:~$wget http://apache.fayea.com/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz

[email protected]:~$tar -xzvf zookeeper-3.3.6.tar.gz

$cd zookeeper-3.3.6

[email protected]:~/zookeeper-3.3.6$ cp./conf/zoo_sample.cfg ./conf/zoo.cfg

[email protected]:~/zookeeper-3.3.6$bin/zkServer.sh start

JMX enabled by default

[email protected]:~/zookeeper-3.3.6$ sudobin/zkServer.sh start

JMX enabled by default

Using config:/home/myhaspl/zookeeper-3.3.6/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[email protected]:~/zookeeper-3.3.6$bin/zkCli.sh -server 127.0.0.1:2181

Connecting to 127.0.0.1:2181

2014-12-17 16:22:17,187 - INFO  [main:[email protected]] - Clientenvironment:zookeeper.version=3.3.6-1366786, built on 07/29/2012 06:22 GMT

2014-12-17 16:22:17,207 - INFO  [main:[email protected]] - Clientenvironment:host.name=aaayun

2014-12-17 16:22:17,208 - INFO  [main:[email protected]] - Clientenvironment:java.version=1.7.0_71

2014-12-17 16:22:17,209 - INFO  [main:[email protected]] - Clientenvironment:java.vendor=Oracle Corporation

2014-12-17 16:22:17,210 - INFO  [main:[email protected]] - Clientenvironment:java.home=/usr/lib/java/jre

2014-12-17 16:22:17,212 - INFO  [main:[email protected]] - Clientenvironment:java.class.path=/home/myhaspl/zookeeper-3.3.6/bin/../build/classes:/home/myhaspl/zookeeper-3.3.6/bin/../build/lib/*.jar:/home/myhaspl/zookeeper-3.3.6/bin/../zookeeper-3.3.6.jar:/home/myhaspl/zookeeper-3.3.6/bin/../lib/log4j-1.2.15.jar:/home/myhaspl/zookeeper-3.3.6/bin/../lib/jline-0.9.94.jar:/home/myhaspl/zookeeper-3.3.6/bin/../src/java/lib/*.jar:/home/myhaspl/zookeeper-3.3.6/bin/../conf:.:/usr/lib/java/lib:/usr/lib/java/jre/lib

2014-12-17 16:22:17,213 - INFO  [main:[email protected]] - Clientenvironment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

2014-12-17 16:22:17,276 - INFO  [main:[email protected]] - Clientenvironment:java.io.tmpdir=/tmp

2014-12-17 16:22:17,277 - INFO  [main:[email protected]] - Clientenvironment:java.compiler=<NA>

2014-12-17 16:22:17,278 - INFO  [main:[email protected]] - Clientenvironment:os.name=Linux

2014-12-17 16:22:17,278 - INFO  [main:[email protected]] - Clientenvironment:os.arch=amd64

2014-12-17 16:22:17,279 - INFO  [main:[email protected]] - Clientenvironment:os.version=3.2.0-53-generic

2014-12-17 16:22:17,279 - INFO  [main:[email protected]] - Clientenvironment:user.name=myhaspl

2014-12-17 16:22:17,280 - INFO  [main:[email protected]] - Clientenvironment:user.home=/home/myhaspl

2014-12-17 16:22:17,281 - INFO  [main:[email protected]] - Clientenvironment:user.dir=/home/myhaspl/zookeeper-3.3.6

2014-12-17 16:22:17,286 - INFO  [main:[email protected]] - Initiating clientconnection, connectString=127.0.0.1:2181 sessionTi[email protected]6c0dc01

2014-12-17 16:22:17,408 - INFO [main-SendThread():[email protected]] - Opening socketconnection to server /127.0.0.1:2181

Welcome to ZooKeeper!

2014-12-17 16:22:17,796 - INFO [main-SendThread(localhost:2181):[email protected]] - Socketconnection established to localhost/127.0.0.1:2181, initiating session

JLine support is enabled

2014-12-17 16:22:18,204 - INFO [main-SendThread(localhost:2181):[email protected]] - Sessionestablishment complete on server localhost/127.0.0.1:2181, sessionid =0x14a575462220000, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:Nonepath:null

[zk: 127.0.0.1:2181(CONNECTED) 0] ls /

[zookeeper]

[zk: 127.0.0.1:2181(CONNECTED) 1] quit

6、storm安装

[email protected]:~/zookeeper-3.3.6$ cd ..

[email protected]:~$ wget http://mirrors.cnnic.cn/apache/storm/apache-storm-0.9.3/apache-storm-0.9.3.tar.gz

[email protected]:~$ tar -xzvf  apache-storm-0.9.3.tar.gz

启动storm

[email protected]:~/apache-storm-0.9.3$ sudo  ./bin/storm nimbus&

[1] 25871

[email protected]:~/apache-storm-0.9.3$ sudo  ./bin/storm supervisor&

[2] 25882

编辑參数配置

[email protected]:~/apache-storm-0.9.3$

[email protected]:~/apache-storm-0.9.3$ cdconf

[email protected]:~/apache-storm-0.9.3/conf$ls

默认配置例如以下:

# Licensed to the Apache SoftwareFoundation (ASF) under one

# or more contributor licenseagreements.  See the NOTICE file

# distributed with this work for additionalinformation

# regarding copyright ownership.  The ASF licenses this file

# to you under the Apache License, Version2.0 (the

# "License"); you may not usethis 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 oragreed to in writing, software

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

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

# See the License for the specific languagegoverning permissions and

# limitations under the License.

########### These all have default valuesas shown

########### Additional configuration goesinto storm.yaml

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

### storm.* configs are generalconfigurations

# 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.cluster.mode: "distributed"# can be distributed or local

storm.local.mode.zmq: false

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

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

### nimbus.* configs are for the master

nimbus.host: "localhost"

nimbus.thrift.port: 6627

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"

### ui.* configs are for the master

ui.port: 8080

ui.childopts: "-Xmx768m"

logviewer.port: 8000

logviewer.childopts: "-Xmx128m"

logviewer.appender.name: "A1"

drpc.port: 3772

drpc.worker.threads: 64

drpc.queue.size: 128

drpc.invocations.port: 3773

drpc.request.timeout.secs: 600

drpc.childopts: "-Xmx768m"

transactional.zookeeper.root:"/transactional"

transactional.zookeeper.servers: null

transactional.zookeeper.port: null

### supervisor.* configs are for nodesupervisors

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

supervisor.slots.ports:

-6700

-6701

-6702

-6703

supervisor.childopts: "-Xmx256m"

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

supervisor.worker.start.timeout.secs: 120

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

supervisor.worker.timeout.secs: 30

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

supervisor.monitor.frequency.secs: 3

#how frequently the supervisor heartbeatsto the cluster state (for nimbus)

supervisor.heartbeat.frequency.secs: 5

supervisor.enable: true

### worker.* configs are for task workers

worker.childopts: "-Xmx768m"

worker.heartbeat.frequency.secs: 1

task.heartbeat.frequency.secs: 3

task.refresh.poll.secs: 10

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

storm.messaging.netty.max_retries: 30

storm.messaging.netty.max_wait_ms: 1000

storm.messaging.netty.min_wait_ms: 100

### topology.* configs are for specificexecuting storms

topology.enable.message.timeouts: true

topology.debug: false

topology.optimize: true

topology.workers: 1

topology.acker.executors: null

topology.tasks: null

# maximum amount of time a message has tocomplete before it‘s considered failed

topology.message.timeout.secs: 30

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 # settingit too high causes a lot of problems (heartbeat thread gets starved, throughputplummets)

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

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

Storm发行版本号解压文件夹下有一个conf/storm.yaml文件。用于配置Storm。默认配置在defaults.yaml能够查看。conf/storm.yaml中的配置选项将覆盖defaults.yaml中的默认配置。

启动后台ui

[email protected]:~/apache-storm-0.9.3$ sudo ./bin/stormui&

[3] 25893

时间: 2024-10-07 23:21:34

数学之路-分布式计算-storm(3)的相关文章

数学之路-分布式计算-linux/unix技术基础(4)

pwd显示当前文件夹,ls查看文件夹下的文件,cd 进入文件夹 -bash-4.2$ pwd /home/myhaspl-bash-4.2$ lsabc        hadoop-2.4.1             mydoclist  mypylst   mypylsts  numpyabd        hadoop-2.4.1-src.tar.gz  myl2       mypylst1  myrun     pypy-2.3.1-srcerror.log  hadoop-2.4.1.

数学之路-分布式计算-disco(1)

Disco是一个轻量级的.开源的基于mapreduce模型计算的框架,Disco强大且易于使用,这都要归功于python,Disco分发且复制数据,可高效安排作业.Disco甚至拥有能对数以亿计的数据点进行索引以及实时查询的工具.Disco于2008年在Nokia研究中心诞生,解决了在大量数据处理方面的挑战. Disco支持大数据集的并行计算,在不可靠的计算机集群中,Disco是一个完美的分析和处理大数据的工具,无需考虑因为分布式带来的技术困难,比如通信协议.负载均衡.锁.作业规划.故障容忍.

数学之路-分布式计算-disco(4)

第一个参数iter是一个迭代器,涉及被map函数产生的键和值,它们是reduce实例. 在本例中,单词随机被委托给不同的reduce实例,然后,要单词相同,处理它的reduce也相同,可确保最终合计是正确的. 第二个参数params与map函数中一致,在此,仅简单使用disco.util.kvgroup()来提取每个单词统计计数,累计计数,yield(产生)结果. 运行作业 下面开始运行作业,可使用大量参数定制作业,但通常来说,对于简单的任务来说 ,仅使用其中3个即可.除了启动作业之外,我们还需

数学之路-分布式计算-hdfs(3)

可通过部署一对主/备NameNode实现NameNode高可用性(HA),主/备NN都能访问edits的WAL,因此将edtis放置在共享存储设备上,使用NFS实现这种共享存储. 主/备NN可配置为手动或自动故障切换模式,默认为手动故障切换模式.通常来说,次NN会同时承担备NN的角色, 由于NN在内存中的元数据大小限制,可以使用NN联盟,由一组各自独立的NN组成,每个NN负责管理目录结构的不同部分,NN联盟管理的集群中每个DN可以给多个NN存储数据块,每个DN为每个名字傲之最维护一个数据块池,每

数学之路-分布式计算-linux/unix技术基础(3)

目录: ~表示当前用户的主目录 .表示当前目录 ..表示上级目录 链接文件 可用不同的文件名引用同一个数据或程序,为硬链接 在同一物理文件系统中,创建硬链接 -bash-4.2$ find ~ -name "*.py">mypylist ls -la 表示以长格式的形式查看当前目录下所有文件,包括隐藏文件,各字段含义如下: 7个段分别是: 文件属性:drwxr-xr-x 文件硬链接数或目录子目录数:3 (一个空目录的该字段是2,表示该目录下有两个子目录,因为每一个目录都有一个指向

数学之路-分布式计算-linux/unix技术基础(1)

以centos为例 1.当前用户 $表示普通用户状态,#表示超级用户状态 -bash-4.2$ -bash-4.2$ su密码:[[email protected] myhaspl]# 2.命令基础 命令名 [命令选项] [命令参数] 系统信息命令 说明# arch 显示机器的处理器架构(1)   [man]# cal 2007 显示2007年的日历表   [man]# cat /proc/cpuinfo 显示CPU info的信息   [man]# cat /proc/interrupts 显

数学之路-分布式计算-disco(2)

Disco旨在较大的应用程序轻松集成,比如web服务,那样要求计算的任务可以委托给独立于核心应用程序的集群去执行.Disco提供了一个非常紧凑的Python API--通常只需要两个函数,以及一个rest样式的Web API的工作控制和简单易用的状态监控Web界面.此外,Disco还拥有了一个简单的工作协议,允许作业以任何语言编写,实现协议. Disco对LINUX商业服务器集群非常友好,新节点可以通过单击Web界面动态地添加到系统.如果服务器崩溃,能够自动将失败的任务重新分配,这样就没有任何中

数学之路-分布式计算-linux/unix技术基础(5)

shell的命令行参数 -bash-4.2$ cat test1.sh#!/bin/shecho "$0  "echo "$1  "echo "$2  " -bash-4.2$ ./test1.sh a b c./test1.sh  a  b  -bash-4.2$ 本博客所有内容是原创,如果转载请注明来源 http://blog.csdn.net/myhaspl/ 显示所有命令行参数 -bash-4.2$ cat test1.sh#!/bin/

数学之路-分布式计算-hdfs(2)

1.DataNode为每个数据复制数据副本,保存在其它DataNode中.2.NameNode文件系统的元数据全保存在RAM中,DataNode初始化以及每隔1小时,向NameNode发送块报告,以便NameNode掌握各个DataNode的运行状态,并进行DataNode的映射.3.预写日志.通过在edits中顺序增加的方式减少I/O操作.4.fsimage:NameNode启动后,加载fsimage到RAM,引入edits变化.5.Hadoop的新版本已经实现周期性更换edits文件,提供事