搭建前先统一时间,关闭防火墙,使用的jar包版本是1.6.0的

服务配置有两种方式

第一种:具体步骤如下:

1.将jar包传至node1上,解压至根目录

2.更改目录名,使用如下命令:mv apache-flume-1.6.0-bin /home/install/flume-1.6

3.进入flume-1.6目录后,vi test1,创建test1文件,打开

https://flume.apache.org/FlumeUserGuide.html链接,复制关于source、channel和sink的那一段代码

  将其中的localhost改为node1

4.运行flume

5.打开node2,输入命令:telnet node1 44444

任意字符如hello,看node1有没有收到hello字符

Ctrl+】,quit退出,Ctrl+c终止

第二种方式:具体步骤如下:

1.先启动zookeeper服务:zkServer.sh start,再启动dfs:start-dfs.sh

2.vi test2

具体代码:

[root@node1 flume-1.6]# vi test2

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type =spooldir
a1.sources.r1.spoolDir=/opt/flume

# Describe the sink
a1.sinks.k1.type =avro
a1.sinks.k1.hostname=node2
a1.sinks.k1.port=55555

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100000
a1.channels.c1.transactionCapacity = 1000

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

在node2(相当于服务器)上

具体代码:
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type =avro
a1.sources.r1.bind=node2
a1.sources.r1.port=55555

# Describe the sink
a1.sinks.k1.type =hdfs
a1.sinks.k1.hdfs.path=hdfs://xiaotian/flume/%Y-%m-%d/
a1.sinks.k1.hdfs.filePrefix=%H%M
a1.sinks.k1.hdfs.rollSize=0
a1.sinks.k1.hdfs.rollCount=0
a1.sinks.k1.hdfs.rollInterval=60
a1.sinks.k1.hdfs.idleTimeout=1
a1.sinks.k1.hdfs.fileType=DataStream
a1.sinks.k1.hdfs.round=true
a1.sinks.k1.hdfs.roundValue=1
a1.sinks.k1.hdfs.roundUnit=minute
a1.sinks.k1.hdfs.useLocalTimeStamp=true

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100000
a1.channels.c1.transactionCapacity = 1000

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
~

3.进入flume-1.6里的conf目录

  mv flume-env.sh.template flume-env.sh

vi flume-env.sh

添加一句话:JAVA_OPTS="-Xms100m -Xmx300m"

4.新建一个/opt/flume目录,然后再启动flume,启动时先启动node2(改变source的),再启动node1

bin/flume-ng agent --conf conf --conf-file test2 --name a1 -Dflume.root.logger=INFO,console

启动node1后可先在node上查看进程,看是否启动成功:netstat -ntpl

flume服务的搭建的更多相关文章

  1. nginx服务傻瓜搭建

    nginx服务傻瓜搭建 安装步骤: 一.先准备好相关源码包和程序包,如下图 所有包都在云服务器的/src目录下. 二.安装 1.安装nginx服务器,支持vod stream.fileupload c ...

  2. 基于SpringMVC下的Rest服务框架搭建【1、集成Swagger】

    基于SpringMVC下的Rest服务框架搭建[1.集成Swagger] 1.需求背景 SpringMVC本身就可以开发出基于rest风格的服务,通过简单的配置,即可快速开发出一个可供客户端调用的re ...

  3. dubbo服务简单搭建

    一.初识dubbo: 架构图: Provider: 暴露服务的服务提供方. Consumer: 调用远程服务的服务消费方. Registry: 服务注册与发现的注册中心. Monitor: 统计服务的 ...

  4. Centos 6.5 pptpd服务端搭建过程

    首先检测有没有启用ppp和tun cat /dev/ppp cat /dev/net/tun 如果显示是这样的 cat: /dev/ppp: No such device or address cat ...

  5. [Visual Studio] SOA服务框架搭建

    1.服务框架搭建 2.服务模板创建 3.Nuget引用 4.客户端调用 任务点: 1.分析SOA 2.修改SOA架构名称以及关键字 3.使用Nuget添加引用 4.选择服务模板进行创建 5.尝试调用 ...

  6. 【转载】Redis Sentinel 高可用服务架构搭建

    作者:田园里的蟋蟀 出处:http://www.cnblogs.com/xishuai/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接. 阅读 ...

  7. springcloud微服务架构搭建

    SpringCloud微服务框架搭建 一.微服务架构 1.1什么是分布式 不同模块部署在不同服务器上 作用:分布式解决网站高并发带来问题 1.2什么是集群 多台服务器部署相同应用构成一个集群 作用:通 ...

  8. ubuntu 16.04 nfs服务的搭建

    nfs服务是实现Linux和Linux之间的文件共享,nfs服务的搭建比较简单. 现在介绍如何在ubuntu16.04系统中搭建nfs服务,ubuntu的搭建比红帽的还要简单. 1.安装nfs服务 s ...

  9. Red Hat 6.5 nfs服务的搭建

    nfs服务是实现Linux和Linux之间的文件共享,nfs服务的搭建比较简单. 现在介绍如何在红帽6.5系统中搭建nfs服务. 1.关闭selinux服务 如果已经关闭该服务的可以直接跳过该步骤. ...

随机推荐

  1. 通过LDF文件实现日志回滚将数据恢复(转)

    该方法数据库恢复(www.db-recovery.com)思路 1. 创建数据TEST 2. 创建表TEMP_01 3. 在表TEMP_01中插入100条数据 4. 备份现有的数据库 5. 再次向表T ...

  2. spring data mongodb中,如果对象中的属性不想加入到数据库字段中

    spring data mongodb中,如果对象中的属性不想加入到数据库字段中,可加@Transient注解,声明为透明属性 spring data mongodb 官网帮助文档 http://ww ...

  3. 【4】创建一个自己的Bootstrap模板

    什么也不说了,直接贴上代码吧,哈哈 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta ch ...

  4. web2py--------------用web2py写 django的例子 --------建立一个投票应用(2)

    建立模型 我们在models下及那里polls.py 文件内容如下 # -*- coding: utf-8 -*- pollsdb=DAL(uri='sqlite://polls.db') polls ...

  5. GCC交叉编译链命名

    命名格式: arch[-vendor][-os]-abi arch:CPU的架构 vendor:工具链的供应商 os: 目标上运行的操作系统,不同的操作系统对应着不同的C库,例如 newlib.gli ...

  6. OpenGL ES 3.0 基础知识

    首先要了解OpenGL的图形管线有哪些内容,再分别去了解其中的相关的关系: 管线分别包括了顶点缓冲区/数组对象,定点着色器,纹理,片段着色器,变换反馈,图元装配,光栅化,逐片段操作,帧缓冲区.其中顶点 ...

  7. .net 访问远程的MSSQL报System.AccessViolationException错误的解决方法

    访问远程的数据库时 报错,本地数据库正常 netsh winsock reset   --运行此命令,解决. netsh winsock reset命令,作用是重置 Winsock 目录.如果一台机器 ...

  8. mongodb 全文检索

    MongoDB 全文检索 全文检索对每一个词建立一个索引,指明该词在文章中出现的次数和位置,当用户查询时,检索程序就根据事先建立的索引进行查找,并将查找的结果反馈给用户的检索方式. 这个过程类似于通过 ...

  9. 实时动态更新曲线图,x轴时间s随数据的变化而变化

    $(function () {    $(document).ready(function () {        Highcharts.setOptions({            global: ...

  10. Firefly 性能测试 报告

    原地址:http://bbs.gameres.com/thread_223724.html Firefly 性能测试 主要考虑点 网络IO的并发 进程间通信压力 数据读写压力 测试机配置: 操作系统 ...