当前位置: 首页 > news >正文

做网站公司 备案seo信息优化

做网站公司 备案,seo信息优化,专业建站网站,wordpress怎么显示歌词一 ,多输出 1 ,要求 : 数据来源 : 文件监控数据去向 : hdfs 本地分配机制 : 复制 ( 两个目的地的数据完全一致 ) 2 ,架构图 : 3 ,思路 : flume1 &#x…

一 ,多输出

1 ,要求 :

  1. 数据来源 : 文件监控
  2. 数据去向 : hdfs + 本地
  3. 分配机制 : 复制 ( 两个目的地的数据完全一致 )

2 ,架构图 :

在这里插入图片描述
在这里插入图片描述

3 ,思路 :

  1. flume1 :接收文件变化
  2. flume2 :建数据下沉到 hdfs
  3. flume3 :将数据下沉到 本地

4 ,配置文件 :vim flume1.conf

  1. 目的 : 配置 1 个接收日志文件的 source 和 2 个 channel、两个 sink
  2. avro : 语言无关的数据序列化和 RPC 框架。
  3. RPC(Remote Procedure Call)—远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。
  4. avro : 简单地说,就是一种传输数据格式,让数据更快的传递。
  5. 配置 :
    cd /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf
    vim flume1.conf
#	名字
a1.sources = r1
a1.sinks = k1 k2
a1.channels = c1 c2
#	选择器:复制
a1.sources.r1.selector.type = replicating#	1 ,源:linux 脚本
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /tmp/root/hive.log
a1.sources.r1.shell = /bin/bash -c#	2 ,下沉:avro ( 为了传递数据,选择这种类型 ),选择将数据发送到哪里
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = node01
a1.sinks.k1.port = 4141a1.sinks.k2.type = avro
a1.sinks.k2.hostname = node01
a1.sinks.k2.port = 4142#	3 ,管道 ( 内存缓存数据,1000 个缓存,每个事物发送 100 条数据 )
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100a1.channels.c2.type = memory
a1.channels.c2.capacity = 1000
a1.channels.c2.transactionCapacity = 100#	关联管道与源,管道与出口
a1.sources.r1.channels = c1 c2
a1.sinks.k1.channel = c1
a1.sinks.k2.channel = c2

5 ,配置文件 :vim flume2.conf ( 下沉到 hdfs )

  1. 目的 : 配置上级 flume 输出的 source,输出是到 hdfs的 sink。
  2. 代码 : vim flume2.conf
# Name the components on this agent
a2.sources = r1
a2.sinks = k1
a2.channels = c1# Describe/configure the source
a2.sources.r1.type = avro
a2.sources.r1.bind = node01
a2.sources.r1.port = 4141# Describe the sink
a2.sinks.k1.type = hdfs
a2.sinks.k1.hdfs.path = hdfs://node01:8020/flume2/%Y%m%d/%H
#上传文件的前缀
a2.sinks.k1.hdfs.filePrefix = flume2-
#是否按照时间滚动文件夹
a2.sinks.k1.hdfs.round = true
#多少时间单位创建一个新的文件夹
a2.sinks.k1.hdfs.roundValue = 1
#重新定义时间单位
a2.sinks.k1.hdfs.roundUnit = hour
#是否使用本地时间戳
a2.sinks.k1.hdfs.useLocalTimeStamp = true
#积攒多少个Event才flush到HDFS一次
a2.sinks.k1.hdfs.batchSize = 100
#设置文件类型,可支持压缩
a2.sinks.k1.hdfs.fileType = DataStream
#多久生成一个新的文件
a2.sinks.k1.hdfs.rollInterval = 600
#设置每个文件的滚动大小大概是128M
a2.sinks.k1.hdfs.rollSize = 134217700
#文件的滚动与Event数量无关
a2.sinks.k1.hdfs.rollCount = 0
#最小冗余数
a2.sinks.k1.hdfs.minBlockReplicas = 1# Describe the channel
a2.channels.c1.type = memory
a2.channels.c1.capacity = 1000
a2.channels.c1.transactionCapacity = 100# Bind the source and sink to the channel
a2.sources.r1.channels = c1
a2.sinks.k1.channel = c1

6 ,配置文件 :vim flume3.conf ( 下沉到本地 )

vim flume3.conf

# Name the components on this agent
a3.sources = r1
a3.sinks = k1
a3.channels = c2# Describe/configure the source
a3.sources.r1.type = avro
a3.sources.r1.bind = node01
a3.sources.r1.port = 4142#	下沉到文件
a3.sinks.k1.type = file_roll
a3.sinks.k1.sink.directory = /root/flumesink#	管道
a3.channels.c2.type = memory
a3.channels.c2.capacity = 1000
a3.channels.c2.transactionCapacity = 100# Bind the source and sink to the channel
a3.sources.r1.channels = c2
a3.sinks.k1.channel = c2

7 ,启动 :先启动下沉,再启动源

cd /export/servers/apache-flume-1.6.0-cdh5.14.0-bin
bin/flume-ng agent --conf conf/ --name a2 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/flume2.conf
bin/flume-ng agent --conf conf/ --name a3 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/flume3.conf
bin/flume-ng agent --conf conf/ --name a1 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/flume1.conf

8 ,测试 :

  1. 改变那个文件的内容 :
    cd /tmp/root
    echo 1111 >> hive.log
    echo 2222 >> hive.log
  2. 观察结果 :
    1 ,hdfs :
    在这里插入图片描述
    2 ,本地文件夹 :
    在这里插入图片描述

二 ,负载均衡 :

1 ,负载均衡 : 简介

  1. 目的 : 减轻任务的压力。
  2. 做法 : 把一个工作让很多人一起做。
  3. 应用场景 : 任务量太大的时候。

2 ,目的 :

  1. flume1 : 接收网络端口数据。
  2. flume2 : 打印到控制台。
  3. flume3 : 打印到控制台。

3 ,架构模型 :

在这里插入图片描述

4 ,注意 :

我们把数据打印到控制台,方便监控数据变化,就不把数据发送到 hdfs 了。

5 ,高可用配置 :

在这里插入图片描述

6 ,负载均衡配置 :

在这里插入图片描述

7 ,负载均衡的策略 :

  1. 目的 : 我干活的时候,你休息,你干活的时候,我休息。
  2. 策略 : 轮询 ,随机 。

8 ,vim flume1.conf :监听网络端口,发数据到 avro

#	名字
a1.sources = r1
a1.channels = c1
a1.sinkgroups = g1
a1.sinks = k1 k2#	监听端口,本机的 44444
a1.sources.r1.type = netcat
a1.sources.r1.bind = node01
a1.sources.r1.port = 44444#	负载均衡,失败后退,负载方式(轮询),10 秒没好,就回退
a1.sinkgroups.g1.processor.type = load_balance
a1.sinkgroups.g1.processor.backoff = true
a1.sinkgroups.g1.processor.selector = round_robin
a1.sinkgroups.g1.processor.selector.maxTimeOut=10000#	下沉
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = node01
a1.sinks.k1.port = 4141a1.sinks.k2.type = avro
a1.sinks.k2.hostname = node01
a1.sinks.k2.port = 4142#	管道
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100#	连接
a1.sources.r1.channels = c1
a1.sinkgroups.g1.sinks = k1 k2
a1.sinks.k1.channel = c1
a1.sinks.k2.channel = c1

9 ,vim flume2.conf : 从 avro 收数据,发到控制台

#	名字
a2.sources = r1
a2.sinks = k1
a2.channels = c1#	从 avro 接收数据
a2.sources.r1.type = avro
a2.sources.r1.bind = node01
a2.sources.r1.port = 4141#	下沉到 :控制台
a2.sinks.k1.type = logger# Describe the channel
a2.channels.c1.type = memory
a2.channels.c1.capacity = 1000
a2.channels.c1.transactionCapacity = 100# Bind the source and sink to the channel
a2.sources.r1.channels = c1
a2.sinks.k1.channel = c1

10 ,vim flume3.conf : 从 avro 接收数据,发到控制台

# Name the components on this agent
a3.sources = r1
a3.sinks = k1
a3.channels = c2# Describe/configure the source
a3.sources.r1.type = avro
a3.sources.r1.bind = node01
a3.sources.r1.port = 4142# Describe the sink
a3.sinks.k1.type = logger# Describe the channel
a3.channels.c2.type = memory
a3.channels.c2.capacity = 1000
a3.channels.c2.transactionCapacity = 100# Bind the source and sink to the channel
a3.sources.r1.channels = c2
a3.sinks.k1.channel = c2

11 ,执行 : ( 开三个控制台窗口 )

cd /export/servers/apache-flume-1.6.0-cdh5.14.0-bin
bin/flume-ng agent --conf conf/ --name a3 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/fzjh/flume3.conf -Dflume.root.logger=INFO,console
bin/flume-ng agent --conf conf/ --name a2 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/fzjh/flume2.conf -Dflume.root.logger=INFO,console
bin/flume-ng agent --conf conf/ --name a1 --conf-file /export/servers/apache-flume-1.6.0-cdh5.14.0-bin/conf/fzjh/flume1.conf

12 ,测试 :

  1. 在 node02 上,使用网络连接工具 : telnet node01 44444
  2. 在 node02 上,给 node01 发消息 : 发很多次

13 ,结果 :

在 flume1 上看到一些数据,在flume2 上,也看到一些数据。
在这里插入图片描述
在这里插入图片描述

http://www.lbrq.cn/news/2684827.html

相关文章:

  • 个体工商户未做年报会罚款吗郑州seo公司排名
  • 东营网站开发公司太原网站制作优化seo公司
  • 如何自己设计图片搜索引擎优化的方法和技巧
  • 注册个网站怎么注册网站整体优化
  • tp钱包下载优化大师免费安装下载
  • 做互助盘网站谷歌海外广告投放
  • 水泥网站营销方案怎么做手机google官网注册账号入口
  • 那个网站做拍手比较好seo优化快速排名技术
  • web开发前端框架优化大师apk
  • 企业网站建设admin外包公司的人好跳槽吗
  • 免费web服务器网站澳门长沙seo网络公司
  • 找深圳做网站的公司seo代运营
  • 织梦网站tel标签郑州网站推广培训
  • 松山湖做网站专业网站优化公司
  • 网站运维托管软件开发一般需要多少钱
  • 酒店品牌网站建设推广网站怎么注册
  • 网做英文网站链接制作
  • 什么网站可以做任务挣钱的青岛网站建设制作推广
  • 做网站建设需要多少钱搜索引擎推广的三种方式
  • 做网站注意事项北京全网营销推广公司
  • 自助业务网站系统seo收录查询工具
  • 免费网站模板 怎么用广东公共广告20120708
  • 政府网站建设程序的设计原则不包括百度快速收录提交工具
  • 免费建网站赚钱免费企业网站建设
  • 甘肃省今天疫情最新情况sem和seo是什么
  • 有关大学生做兼职的网站无锡营销型网站建设
  • 网站ipv6改造怎么做企拓客app骗局
  • 网站建设与维护手机app免费下载
  • 泰安公司网站建设沈阳seo
  • 什么网站专门做自由行的线上推广方式都有哪些
  • 医美产业科技成果展陈中心:连接微观肌肤世界与前沿科技的桥梁
  • 深入解析Linux poll()系统调用
  • 内网依赖管理新思路:Nexus与CPolar的协同实践
  • 【SpringBoot】持久层 sql 注入问题
  • 网络性能优化:Go编程视角 - 从理论到实践的性能提升之路
  • 深入理解 Gin 框架的路由机制:从基础使用到核心原理