《Hadoop生态系统及开发 实训手册 实训13 Flume的安装与部署.docx》由会员分享,可在线阅读,更多相关《Hadoop生态系统及开发 实训手册 实训13 Flume的安装与部署.docx(5页珍藏版)》请在第一文库网上搜索。
1、实训6.1 Flume的安装与部署L实训目的通过本实训理解Fkime的概念、理解FkIme的特点与结构、认识并了解 Telnet的用途。2 .实训内容通过本实训,学会安装FkIme和TeInet的安装与部署。3 .实训要求以小组为单元进行实训,每小组5人,小组自协商选一位组长,由组长安排 和分配实训任务,具体参考实训操作环节。小组成员较简单,不需要特殊的要求, 确保JDK安装完成与有简单的Linux基础就行。4 .准备知识(1) Telnet 简介是TCP/IP协议族中的一员,属于应用层协议,是Internet远程登录服务器 的标准协议和主要方式。Telnet服务属于典型的客户机/服务器模型,
2、当用Telnet登录远程计算机的 时候,实际上启动了两个程序:运行在本地计算机的Telnet客户端程序;运行 在登录的远程计算机上的Telnet服务程序。(2) Telnet的意义建立与远程主机的TCP连接。默认端口为23号端口,如果远程主机上的 Telnet服务器软件一直在这个端口上侦听到连接请求,则这个连接便会建立起 来。以终端方式为用户提供人机界面。将用户输入的信息通过Telnet协议传送给远程主机。接受远程主机发送来的信息,并经过适当的转换显示在用户计算机的屏 幕上。5 .实训步骤(1)安装和配置FlUme安装包准备将 apache-flume-1.10.1 -bin.tar.gz 压
3、缩包上传至 master 节点的/root/PaCkage 目 录下。 JE apache-flume-1.10.1 -bin.tar.gz,这里解压到optsoftware 目录下:Cd ZrootZpackagetar -zxvf apache-flume-1.10.1 -bin.tar.gz -C optsoftware配置Flume配置环境变量:vim etcprofile添加以T内容:export FLUME_H0ME=/OPtzSoftWare/apache-flume-L10.1 -binexport PATH=$PATHSFLUMEJ4OMEbin使用赃效;source Zet
4、cZprofile 修改 Flume 的配置文件($FLUME_HOME/conf):cd optsoftwareapache-flume-l. 10.1 -bin/confcp flume-env.sh.template flume-env.sh vim flume-env.sh添加JAVA_HOME的配置。如图6-17所吞export J AV A_HOME=/opt/software/jdk 1.8.0-161 Enviroment variables can be set here.L export JAVA HOME=usrlibjvmjava-8-oracIe export JAV
5、AHoME=optsoftwarejdkl.8.0_161| # Give Flume more memory and pre-allocate, enable remote monitoring via JMX # export JAVA_OPTS=* -Xmslm -Xmx20m -Dcom. sun .management. jmxremote,校验Flumeflume-ng version可以查看到Flume的版本,则表示Flume已经安装成功。结果如图6-18所示。rootnaster conf# flume-ng version Flume 1.1,1Source code rep
6、ository: https;git.dpache.org/repos/asf/flume,gitRevision: 47516d4bd5574c3e67a5d98ca2cfe025886df7cCompiled by rgoers on Sat Aug 13 11:16:08 MST 222 From source with checksum delcf990338c759d311522e65597e457图6-18查看Flume版本号(2)安装 Telnet安装准备 新建文件夹telnet并上传三?文件mkdir -p rootpac kage/te InetA.xinetd-2.3.14
7、-39.el6_4.x86_64.rpmB.telnet-0.17-47.el6.x86_64.rpmC. tel net-server-0.17-47.el6.x86_64.rpm按顺序依次进行安装 安装 xinetd-2.3.14-39.el6_4.x86_64.rpm:cd rootpackagetelnetrpm -ivh xinetd-2.3.14-39.el6_4.x86_64.rpm 安装 telnet-0.17-47.el6.x86_64.rpm:rpm -ivh telnet-0.17-47.el6.x86_64.rpm安装 telnet-server-0.17-47.el6
8、.x86_64.rpm:rpm -ivh telnet-server-0.17-47.el6.x86_64.rpm安装结果如图6-19所示。root颔aster telnet# rpm -ivh xinetd-2.3.14-39.el6_4.x86_64.rpmwarning: xinetd-2.3.14-39.e16_4.x8664.rpm: Header V3 RSASHA1 Signature, key ID C105b9de: NOKEYPreparing.# 100%Updating / installing. l:xinetd-2:2.3.14-39.el64# 10%rootna
9、ster telnet# rpm -ivh telnet -0.17-47.e16.x86 64.rpm warning: telnet -.17-47.el6,x86_64,rpm: Header V3 RSASHA256 Signature, key ID f d431d51: NOKEYPreparing.# 10%Updating / installing. 1:telnet-1:0.17-47.e16# 1O%root(ftnaster telnet# rpm -ivh telnet -se rve r-.17-47.e16.x86 64.rpm warning: telnet -s
10、e rve r-0.17-47,el6,x86 64.rpm: Header V4 DSASHA1 Signature, key ID 192a7d7d: NOKEYPreparing.Updating / installing.1:telnet-server-1:0.17-47.e16# 1O%# 10%图6-19安装结果显示示意图查看是否安装rpm -q telnetrpm -q telnet-server显示已经安装。如图6-20所示。root领aster telnet# rpm -q telnettelnet-.17-47.el6,x86_64root领aster telnet# rp
11、m -q telnet-servertelnet-server-0.17-47,el6.x86 64图6-20查看安装结果配置Telnet 将disable项的yes修改为no。如图6-21所示。vim etcxinetd.dtelnet# default: on# description: The telnet server serves telnet sessions; it uses it unencrypted username/password pairs for authentication. service telnetflags SoCket_type waituserserv
12、erlog_on_failure disable=REUSE=stream=no=root=usrsbinin.telnetd+= USERID=Z3图6-21修改参数# 重启服务Systemctl restart xinetd测试Telnet此时在$FLUME_HOME/conf目录下编写一个Flume配置文件,cd optsoftwareapache-flume-1.10.1 -bin/confvim example.conf避加内容如下:a !.sources = rla !.sinks = kla !.channels = clal.sources.rl.type = netcatal
13、.sources.rl.bind = localhostal.sources.rl.port = 44444al.sinks.k 1 .type = loggeral.channels.cl.type = memoryal .sources.rl .channels = clal.sinks.k 1 .channel = cl使用以下命令运行一个agent实例:flume-ng agent conf $FLUME_HOME/conf -conf-file $FLUME_HOME/conf7example.confname al -Dflume.root.logger=INFO,console此
14、agent篓例启动后将会监听44444端口。显示效果,如图6-22所示。2022-11-10T12:57:19,266 INFO dCounterGroup: Component type:2022-11-10T12:57:19,764 INFO2022-11-10T12:57:19,765 INFO2022-11-10T12:57:19,766 INFO rce starting2022-11-10T12:57:19,778 INFO1ifecycleSupervisor-l- instrumentation.Monitore CHANNEL, name: cl startedmain node.Application: Starting Sink klmain node.Application: Starting Source rlIifecycleSupervisor-1-3 source.NetcatSource: Souated serverSocket:sun.nio.ch.ServerSocRetChannelImpl/127,1:44444lifecycleSuper