搭建前先统一时间,关闭防火墙,使用的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. WPF 列表控件中的子控件上下文绑定

    <DataGrid Grid.ColumnSpan=" Height="Auto" SelectedItem="{Binding Path=SelectP ...

  2. MySQL中SQL语句的分类

    1:数据定义语言(DDL) :创建和删除数据库(CREATE DATABASE || DROP  DATABASE):2:创建.修改.重命名.删除表(CREATE  TABLE || ALTER TA ...

  3. 使用PHP导出Word文档的原理和实例

    PHP操作Word文档的方法有很多,这里再为大家提供一种方法. 原理   一般,有2种方法可以导出doc文档,一种是使用com,并且作为php的一个扩展库安装到服务器上,然后创建一个com,调用它的方 ...

  4. 【10】了解Bootstrap栅格系统基础案例(5)

    这次我们来说下列排序: 通过使用 .col-md-push-* 和 .col-md-pull-* 类就可以很容易的改变列(column)的顺序. <!DOCTYPE html> <h ...

  5. java 调用oracle 分页存储过程 返回游标数据集

    1.分页类 package org.zh.basic; /** * 页面类 * * @author keven * */ public class PageInfo { // 定义 private S ...

  6. building Utils {{ant+ivy}、{maven}}怎么样手动将下载下来的 JAR 包添加到 Maven、ivy 的本地仓库

    mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面 ...

  7. HBASE的安装

    HBASE的安装: 安装的软件版本:hbase-0.98.4-hadoop2.tar.gz 下载链接:http://www.apache.org/dist/hbase/hbase-0.98.4/ 1. ...

  8. 一步步学习NHibernate(1)——NHibernate介绍

    请注明转载地址:http://www.cnblogs.com/arhat 第十五章 从本章开始,老魏将给大家一起学习NHibernate这个流行的ORM框架,本来老魏想要和大家一起探讨微软的EF框架的 ...

  9. Vue + Webpack + Vue-loader 1

    Vue + Webpack + Vue-loader 原文地址:https://lvyongbo.gitbooks.io/vue-loader/content/ Vue-loader 是什么? vue ...

  10. js add media query

    var msViewportStyle = document.createElement("style"); msViewportStyle.appendChild( docume ...