栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

flume采集端口数据

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

flume采集端口数据

关于端口:需要下载telnet与xinetd可以看这个文章

(28条消息) CentOS7.6 开启 Telnet 服务_Showay518的博客-CSDN博客

先通过yum list |grep telnet | xinetd | telnet-server 查看版本,通过yum install 安装服务

启动这些服务

  • systemctl start telnet.socket
  • systemctl start xinetd.service

通过status查看服务状态

测试telnet连接(telnet默认23端口号):

  • telnet localhost         // telnet 客户端连接主机服务器(localhost)

centos默认不允许root登录,若要root登录 则需要在/etc/surectty中追加pts/1 2 3 4;即可使用telnet登录。

我的flume采集代码
a1.sources = r1
a1.channels = c1
a1.sinks = k1
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

#配置source
a1.sources.r1.type = netcat
a1.sources.r1.bind = 192.168.60.131
a1.sources.r1.port = 4444

#配置channel
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 1000

#配置sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = hdfs://master:50070/target_path
a1.sinks.k1.fileprefix = flume
a1.sinks.k1.filesufix = data
a1.sinks.k1.round = true
a1.sinks.k1.hdfs.value = 10
a1.sinks.ka.hdfs.unit = 10

将端口数据采集到hdfs上

使用 telnet 192.168.60.131 4444 ,即实时采集端口数据到hdfs上

注意:
  • 在这里必须先启动flume(bin/flume-ng agent --conf conf/ --name a1 --conf-file jobs/connectPort_to_kafka.conf -Dflume.root.logger=INFO,console)
  • 再启动telnet 192.168.60.131 4444

 否则会报错:地址正在使用

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/860133.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号