flume服务的搭建
搭建前先统一时间,关闭防火墙,使用的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服务的搭建的更多相关文章
- nginx服务傻瓜搭建
nginx服务傻瓜搭建 安装步骤: 一.先准备好相关源码包和程序包,如下图 所有包都在云服务器的/src目录下. 二.安装 1.安装nginx服务器,支持vod stream.fileupload c ...
- 基于SpringMVC下的Rest服务框架搭建【1、集成Swagger】
基于SpringMVC下的Rest服务框架搭建[1.集成Swagger] 1.需求背景 SpringMVC本身就可以开发出基于rest风格的服务,通过简单的配置,即可快速开发出一个可供客户端调用的re ...
- dubbo服务简单搭建
一.初识dubbo: 架构图: Provider: 暴露服务的服务提供方. Consumer: 调用远程服务的服务消费方. Registry: 服务注册与发现的注册中心. Monitor: 统计服务的 ...
- Centos 6.5 pptpd服务端搭建过程
首先检测有没有启用ppp和tun cat /dev/ppp cat /dev/net/tun 如果显示是这样的 cat: /dev/ppp: No such device or address cat ...
- [Visual Studio] SOA服务框架搭建
1.服务框架搭建 2.服务模板创建 3.Nuget引用 4.客户端调用 任务点: 1.分析SOA 2.修改SOA架构名称以及关键字 3.使用Nuget添加引用 4.选择服务模板进行创建 5.尝试调用 ...
- 【转载】Redis Sentinel 高可用服务架构搭建
作者:田园里的蟋蟀 出处:http://www.cnblogs.com/xishuai/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接. 阅读 ...
- springcloud微服务架构搭建
SpringCloud微服务框架搭建 一.微服务架构 1.1什么是分布式 不同模块部署在不同服务器上 作用:分布式解决网站高并发带来问题 1.2什么是集群 多台服务器部署相同应用构成一个集群 作用:通 ...
- ubuntu 16.04 nfs服务的搭建
nfs服务是实现Linux和Linux之间的文件共享,nfs服务的搭建比较简单. 现在介绍如何在ubuntu16.04系统中搭建nfs服务,ubuntu的搭建比红帽的还要简单. 1.安装nfs服务 s ...
- Red Hat 6.5 nfs服务的搭建
nfs服务是实现Linux和Linux之间的文件共享,nfs服务的搭建比较简单. 现在介绍如何在红帽6.5系统中搭建nfs服务. 1.关闭selinux服务 如果已经关闭该服务的可以直接跳过该步骤. ...
随机推荐
- css3太极图效果+自动旋转
主要使用border-radius属性实现圆,半圆,定位坐标覆盖部分模块. 半圆: width: 50%; height: 100%; border-radius:100% 0 0 100% /50% ...
- JQ方法大全
Dom:Attribute:$("p").addClass(css中定义的样式类型); 给某个元素添加样式$("img").attr({src:"te ...
- Live帐号登陆win8系统不用输密码的方法
win 8 系统旨在让大家日常的操作更加方便与快捷.因此,今天,小编将与大家分享的是如何利用Live帐号登陆win8系统,而不用输密码的方法.具体的步骤如下文所述. 按win+R打开运行输入cmd(在 ...
- initialize or clean up your unittest within .net unit test
// Use ClassInitialize to run code before running the first test in the class [ClassInitialize()] pu ...
- struts2 查 找总结
0:38 2013/5/25 查 找 * * |-_-查找全部 Action层的home方法中的查找方法创建时不需要带个查找对象的参数 service层不用组织条件 dao层一条查询所有的hql语句S ...
- ASP.NET 学习博客
ASP.NET MVC5 网站开发实践 http://www.cnblogs.com/mzwhj/p/3537145.html 基于MVC4+EasyUI的Web开发框架形成之旅 http://www ...
- About Interface
http://www.codeproject.com/Articles/18743/Interfaces-in-C-For-Beginners Interface can't have thi ...
- SGU481 Hero of Our Time
Description Saratov ACM ICPC teams have a tradition to come together on Halloween and recollect terr ...
- 浏览器因cookie设置HttpOnly标志引起的安全问题
1.简介 如果cookie设置了HttpOnly标志,可以在发生XSS时避免JavaScript读取cookie,这也是HttpOnly被引入的 原因.但这种方式能防住攻击者吗?HttpOnly标志可 ...
- 互联网科技今年九个兴奋点:O2O深耕细作,可穿戴设备分水岭
http://new.iheima.com/detail/2014/0204/58374.html i黑马观察到,2014年是O2O的深耕细作年,而线上和线下结合这一互联网化趋势,将会向更多产业扩散, ...