天天看點

Linux系統運維之Hadoop、Hive、Flume資料處理

配置環境

主機名
           
IP 備注
Hadoop-Data01
           
192.168.0.194
           
Hadoop-Master                /Hive/Mysql/Flume-Agent      
Hadoop-Data02
           
192.168.0.195
           
Hadoop-Slave
           
CentOS release 6.6 (Final)
Hdk-8u131-linux-x64
Hadoop-2.7.3
Hive-2.1.1
Apache-flume-1.7.0-bin      
[[email protected] soft]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
[[email protected] soft]# wget http://apache.fayea.com/hadoop/common/hadoop-2.7.3/hadoop-2.7.3-src.tar.gz
[[email protected] soft]# wget http://apache.fayea.com/hive/hive-2.1.1/apache-hive-2.1.1-bin.tar.gz      

Hadoop部署

[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.194   Hadoop-Data01
192.168.0.195   Hadoop-Data02
192.168.0.196   Hadoop-Data03
注:Slave伺服器内容同上.      

  配置Hadoop-Master、Hadoop-Slave主機間的免key登入:

[[email protected] ~]# vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
注:這裡可以通過sed:sed -i '47,48s/^#//g' /etc/ssh/sshd_config
[[email protected]-Data01 ~]# ssh-keygen -t rsa
[[email protected]-Data01 .ssh]# cat authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2JGjCEwc+H3/5Y939DHSkhHYAO7qPjO86gyaqvlN2j1ZMUhdKhXUmTH0pBBwXIqp9jooTXxtIu55cuBvOeBD6eUKN5mH9rydRIXm8HEvb9nQzOvVghP1E9lBTGsGXkUWDo0KPkFYOhb2NguYibzVUgpUpAt0NY5iqdenXNqvDOWGhWqDsg/C6VnUzsxskiT9x2EROhddWQnYsObXxjOasgdGPngzZsJZPchRboS+HfvVF0uSyUjljtKsQqYOX2Nt0plO4t6VlcnZXvjDXKezJCNwGToFvvoiIHnjVu/akgtv/bpd8HZp1dZEj7cYnSFkqN5xdodg7TmtjAjobutU5Q== [email protected]Data01
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvQ3JZOtdfFvrsM/m6YwQQuGkOCpNt0+tw87tS4p1gB98ZAn+zaUnFMw5Gvo0i1KvHVaxmb0s1gqDjGDNVLQM5MB60emyVFHLs6DZBI5f4c0BiA17KfDRzlsfuTmuLdymmoj54OhPbEcH+mwo/N1UK9V0gqxAB9abC6UFT00MXXXJN1+qBkV9mUuFbXhn4m5/DCoEbIxvMlWghAsSrDtMaMtJYRumRvd7MLwwefdCYyQd8dZASE1Z8VP0K/BDRntWXCeKGCVMb4uJAnSdhN6ZcRme/Qlx0YCkPpQir3jgcblVW5RODNUyaIc+vUMp9UYagvK7nKKfWAGa/MPdyfu2nw== [email protected]Data02
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1pC5Py1aqbojVetakak3WmxJf4DgmTe1ci60tn9Hyq84kdAhw7z1lAQN544uPDDvl4XPki36Y13Hjl0P+S3g11iOi42FRugkBDmokqADZrUfp5tqWX8K9QvYMePoyiuQlnrGAyCpOiMmEAykBR6lVkNHgPAWThjU9eggt6dalMPiy/dDKZNemlWGHy8wdS5PyjVsIuDGgTtNLADn6OOaYcO/UWq78gqc1Nkq4mNxKSTYorh7taki9SKw4cq0NeggDFz7cZEewtgJdRla0W2ZKz8bgfuUSSntbN55/uCVUSgK+kurqRmklQ3sA3c9687BH1Lse5luDFJRaYo2wa5nlQ== [email protected]Data03
注:合并三台伺服器/root/.ssh/id_rsa.pub檔案到authorized_keys
[[email protected]-Data01 .ssh]# scp authorized_keys [email protected]192.168.0.195:/root/.ssh/
[[email protected]-Data01 .ssh]# scp authorized_keys [email protected]192.168.0.196:/root/.ssh/      

  在各個主機上安裝JDK

[[email protected] soft]# tar -xf jdk-8u131-linux-x64.tar.gz
[[email protected]-Data01 soft]# \cp -r jdk1.8.0_131 /usr/local/
[[email protected]-Data01 soft]# cd /usr/local/
[[email protected]-Data01 local]# ln -s jdk1.8.0_131 jdk
[[email protected]-Data01 ~]# vim /etc/profile
>>>>>
ulimit -n 10240
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
[[email protected]-Data01 ~]# source /etc/profile
[[email protected]-Data03 ~]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)      

 安裝hadoop

/usr/local/hadoop/etc/hadoop/core-site.xml配置檔案:
[[email protected]-Data01 soft]# tar -xf hadoop-2.7.3.tar.gz
[[email protected]-Data01 soft]# mv hadoop-2.7.3 /usr/local/
[[email protected]-Data01 soft]# cd /usr/local/
[[email protected]-Data01 local]# ln -s hadoop-2.7.3 hadoop
[[email protected]-Data01 hadoop]# vim core-site.xml
>>>>>
<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://192.168.0.194:9000</value>
    </property>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>file:/usr/local/hadoop/tmp</value>
    </property>
    <property>
        <name>io.file.buffer.size</name>
        <value>1024</value>
    </property>
</configuration>
注:
<fs.defaultFS>:預設檔案系統的名稱,URI形式,uri的scheme需要由(fs.SCHEME.impl)指定檔案系統實作類;uri的authority部分用來指定host、port等;預設是本地檔案系統。HA方式,這裡設定服務名,例如:hdfs:// 192.168.0.194:9000,HDFS的用戶端通路HDFS需要此參數;
<hadoop.tmp.dir>:Hadoop的臨時目錄,其它目錄會基于此路徑,本地目錄。隻可以設定一個值;建議設定到一個足夠空間的地方,而不是預設的/tmp下,服務端參數,修改需重新開機;
<io.file.buffer.size>:在讀寫檔案時使用的緩存大小,這個大小應該是記憶體Page的倍數,建議1M。

----------

/usr/local/hadoop/etc/hadoop/hdfs-site.xml配置檔案:
[[email protected]-Data01 hadoop]# vim hdfs-site.xml
>>>>>
<configuration>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>file:/usr/local/hadoop/dfs/name</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>file:/usr/local/hadoop/dfs/data</value>
    </property>
    <property>
        <name>dfs.replication</name>
        <value>2</value>
    </property>
    <property>
        <name>dfs.namenode.secondary.http-address</name>
        <value>192.168.0.194:9001</value>
    </property>
    <property>
        <name>dfs.webhdfs.enabled</name>
        <value>true</value>
    </property>
</configuration>
注:
<dfs.namenode.name.dir>:本地磁盤目錄,NN存儲fsimage檔案的地方;可以是按逗号分隔的目錄清單,fsimage檔案會存儲在全部目錄,備援安全;這裡多個目錄設定,最好在多個磁盤,另外,如果其中一個磁盤故障,不會導緻系統故障,會跳過壞磁盤。由于使用了HA,建議僅設定一個,如果特别在意安全,可以設定2個;
<dfs.datanode.data.dir>:本地磁盤目錄,HDFS資料應該存儲Block的地方。可以是逗号分隔的目錄清單(典型的,每個目錄在不同的磁盤),這些目錄被輪流使用,一個塊存儲在這個目錄,下一個塊存儲在下一個目錄,依次循環;每個塊在同一個機器上僅存儲一份,不存在的目錄被忽略;必須建立檔案夾,否則被視為不存在;
<dfs.replication>:資料塊副本數,此值可以在建立檔案是設定,用戶端可以隻有設定,也可以在指令行修改;不同檔案可以有不同的副本數,預設值用于未指定時。
<dfs.namenode.secondary.http-address>:SNN的http服務位址,如果是0,服務将随機選擇一個空閑端口,使用了HA後,就不再使用SNN;
<dfs.webhdfs.enabled>:在NN和DN上開啟WebHDFS (REST API)功能。

----------

/usr/local/hadoop/etc/hadoop/mapred-site.xml配置檔案:
[[email protected]-Data01 hadoop]# cp mapred-site.xml.template mapred-site.xml
[[email protected]-Data01 hadoop]# vim mapred-site.xml
>>>>>
<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
    <property>
        <name>mapreduce.jobhistory.address</name>
        <value>192.168.0.194:10020</value>
    </property>
    <property>
       <name>mapreduce.jobhistory.webapp.address</name>
        <value>192.168.0.194:19888</value>
    </property>
</configuration>

/usr/local/hadoop/etc/hadoop/yarn-site.xml配置檔案:
[[email protected]-Data01 hadoop]# vim yarn-site.xml
>>>>>
<configuration>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>  
    <name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name>
        <value>org.apache.hadoop.mapred.ShuffleHandler</value>
    </property>
    <property>
        <name>yarn.resourcemanager.address</name>
        <value>192.168.0.194:8032</value>
    </property>
    <property>
        <name>yarn.resourcemanager.scheduler.address</name>
        <value>192.168.0.194:8030</value>
    </property>
    <property>
        <name>yarn.resourcemanager.resource-tracker.address</name>
        <value>192.168.0.194:8031</value>
    </property>
    <property>
        <name>yarn.resourcemanager.admin.address</name>
        <value>192.168.0.194:8033</value>
    </property>
    <property>
        <name>yarn.resourcemanager.webapp.address</name>
        <value>192.168.0.194:8088</value>
    </property>
    <property>
        <name>yarn.nodemanager.resource.memory-mb</name>
        <value>8192</value>
    </property>
</configuration>
注:
<mapreduce.framework.name>:MapReduce按照任務大小和設定的不同,提供了兩種任務模式:①本地模式(LocalJobRunner實作)mapreduce.framework.name設定為local,則不會使用YARN叢集來配置設定資源,在本地節點執行。在本地模式運作的任務,無法發揮叢集的優勢。在web UI是檢視不到本地模式運作的任務。②Yarn模式(YARNRunner實作)mapreduce.framework.name設定為yarn,當用戶端配置mapreduce.framework.name為yarn時, 用戶端會使用YARNRunner與服務端通信, 而YARNRunner真正的實作是通過ClientRMProtocol與RM互動, 包括送出Application, 查詢狀态等功能。
<mapreduce.jobhistory.address>和<mapreduce.jobhistory.webapp.address>:Hadoop自帶了一個曆史伺服器,可以通過曆史伺服器檢視已經運作完的Mapreduce作業記錄,比如用了多少個Map、用了多少個Reduce、作業送出時間、作業啟動時間、作業完成時間等資訊。

----------

配置hadoop環境變量:
[[email protected]-Data01 hadoop]# vim /etc/profile
>>>>>
export HADOOP_HOME=/usr/local/hadoop
export PATH=$HADOOP_HOME/bin:$PATH

[[email protected]-Data01 hadoop]# vim hadoop-env.sh
>>>>>
export JAVA_HOME=/usr/local/jdk

添加從節點IP到Slave檔案:
[[email protected]-Data01 hadoop]# echo > slave && echo 192.168.0.195 > slave

拷貝hadoop服務目錄到從主機:
[[email protected]-Data01 local]# \scp -r hadoop-2.7.3 [email protected]192.168.0.195:/usr/local/

進入Hadoop目錄,啟動Hadoop-Master主機上的服務:
①初始化:
[[email protected]-Data01 bin]# sh /usr/local/hadoop/bin/hdfs namenode -format
②啟動服務:
[[email protected]-Data01 sbin]# sh /usr/local/hadoop/sbin/start-all.sh
③關閉服務:
[[email protected]-Data01 sbin]# sh /usr/local/hadoop/sbin/stop-all.sh
④檢視元件:
[[email protected]-Data01 sbin]# jps
6517 SecondaryNameNode
6326 NameNode
6682 ResourceManager
6958 Jps      

 測試通路OK

浏覽器通路:http://192.168.0.194:8088/
      
Linux系統運維之Hadoop、Hive、Flume資料處理
浏覽器通路:http://192.168.0.194:50070/
      
Linux系統運維之Hadoop、Hive、Flume資料處理

部署Hive

 解壓部署、配置環境變量:

[[email protected] soft]# tar -xf  apache-hive-2.1.1-bin.tar.gz
[[email protected]-Data01 soft]# mv apache-hive-2.1.1-bin /usr/local/
[[email protected]-Data01 soft]# cd /usr/local/
[[email protected]-Data01 local]# ln -s apache-hive-2.1.1-bin hive
[[email protected]-Data01 conf]# cp hive-env.sh.template hive-env.sh
[[email protected]-Data01 conf]# vim hive-env.sh
>>>>>
HADOOP_HOME=/usr/local/hadoop
export HIVE_CONF_DIR=/usr/loca/hive/conf
export HIVE_AUX_JARS_PATH=/usr/loca/hive/lib      

 安裝部署mysql環境

[[email protected] conf]# yum install httpd php mysql mysql-server php-mysql -y
[[email protected]-Data01 conf]# /usr/bin/mysqladmin -u root password 'hadoopmysql'
[[email protected]-Data01 conf]# /usr/bin/mysqladmin -u root -h192.168.0.194 password 'hadoopmysql'
[[email protected]-Data01 conf]# mysql -uroot -phadoopmysql
mysql> create user 'hive' identified by 'hive';
mysql> grant all privileges on *.* to 'hive'@'localhost' identified by 'hive';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to 'hive'@'%' identified by 'hiveycfw';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> create database hive;
Query OK, 1 row affected (0.00 sec)      

 修改HIVE配置檔案:

[[email protected] conf]# vim hive-site.xml
44行:>>>>>
<name>hive.exec.local.scratchdir</name>
<value>/usr/local/hive/iotmp</value>
批量替換::%s/${system:java.io.tmpdir}/\/usr\/local\/hive\/iotmp/g
486行:>>>>>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
501行:>>>>>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
686行:>>>>>
<name>hive.metastore.schema.verification</name>
<value>false</value>
933行:>>>>>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
957行:>>>>>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>

拷貝JDBC驅動到lib目錄下:
[[email protected]-Data01 mysql-connector-java-5.1.42]# cp mysql-connector-java-5.1.42-bin.jar  /usr/local/hive/lib/

精簡版hive-site.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>     #資料庫連接配接串
        <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>  #JDBC驅動
        <value>com.mysql.jdbc.Driver</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionUserName</name>    #資料庫賬号
        <value>hive</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>    #資料庫密碼
        <value>hive</value>
    </property>
    <property>
        <name>hive.metastore.warehouse.dir</name>       #該參數指定了 Hive 的資料存儲目錄,預設位置在 HDFS 上面的 /user/hive/warehouse 路徑下
        <value>/user/hive/warehouse</value>
    </property>
    <property>
        <name>hive.exec.scratchdir</name>       #該參數指定了 Hive 的資料臨時檔案目錄,預設位置為 HDFS 上面的 /tmp/hive 路徑下
        <value>/tmp/hive</value>
    </property>
</configuration>      

 初始化Mysql

[[email protected] bin]# schematool -initSchema -dbType mysql      #初始化完成後,mysql資料庫中會增加hive庫
which: no hbase in (/usr/local/hive/bin:/usr/local/hive/conf:/usr/local/hadoop/bin:/usr/local/jdk//bin:/usr/local/jdk//jre/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:    jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
Starting metastore schema initialization to 2.1.0
Initialization script hive-schema-2.1.0.mysql.sql
Initialization script completed
schemaTool completed      

 啟動Hive

[[email protected] bin]# ./hive
Logging initialized using configuration in jar:file:/usr/local/apache-hive-1.2.2-bin/lib/hive-common-1.2.2.jar!/hive-log4j.properties
hive>
hive> show functions;   #檢視hive函數;
hive> desc function day;    #檢視day函數詳細資訊;
OK
day(param) - Returns the day of the month of date/timestamp, or day component of interval
Time taken: 0.039 seconds, Fetched: 1 row(s)      

部署Flume

一、簡介

  1. flume是分布式的日志收集系統,把收集來的資料傳送到目的地去。
  2. flume裡面有個核心概念,叫做agent。agent是一個java程序,運作在日志收集節點。
  3. agent裡面包含3個核心元件:source、channel、sink。 source元件是專用于收集日志的,可以處理各種類型各種格式的日志資料,包括avro、thrift、exec、jms、spooling directory、netcat、sequence generator、syslog、http、legacy、自定義。 source元件把資料收集來以後,臨時存放在channel中。 channel元件是在agent中專用于臨時存儲資料的,可以存放在memory、jdbc、file、自定義。 channel中的資料隻有在sink發送成功之後才會被删除。 sink元件是用于把資料發送到目的地的元件,目的地包括hdfs、logger、avro、thrift、ipc、file、null、hbase、solr、自定義。
  4. 在整個資料傳輸過程中,流動的是event。事務保證是在event級别。
  5. flume可以支援多級flume的agent,支援扇入(fan-in)、扇出(fan-out)。

二、安裝

 解壓flume檔案,傳輸到/usr/local/下(安裝到hadoop伺服器):

[[email protected] soft]# \cp -r apache-flume-1.7.0-bin /usr/local/
[[email protected]-Data01 soft]# cd /usr/local/
[[email protected]-Data01 local]# ln -s apache-flume-1.7.0-bin flume
[[email protected]-Data01 conf]# cp flume-env.sh.template flume-env.sh
[[email protected]-Data01 conf]# vim flume-env.sh
>>>>:
export JAVA_HOME=/usr/local/jdk
[[email protected]-Data01 bin]# ./flume-ng version
Flume 1.7.0
Source code repository: https://git-wip-us.apache.org/repos/asf/flume.git
Revision: 511d868555dd4d16e6ce4fedc72c2d1454546707
Compiled by bessbd on Wed Oct 12 20:51:10 CEST 2016
From source with checksum 0d21b3ffdc55a07e1d08875872c00523      

 下載下傳flume服務到需要采集的伺服器,這裡是windows,然後配置/conf/flume-conf.properties:

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

# Describe/configure the source
a1.sources.r1.type = spooldir
a1.sources.r1.channels = c1
a1.sources.r1.spoolDir = D:\\flume\\log     #收集這個目錄下的檔案
a1.sources.r1.fileHeader = true
a1.sources.r1.basenameHeader = true
a1.sources.r1.basenameHeaderKey = fileName
a1.sources.r1.ignorePattern = ^(.)*\\.tmp$
a1.sources.r1.interceptors = i1
a1.sources.r1.interceptors.i1.type = timestamp

a1.sinks.k1.type = avro
a1.sinks.k1.hostname = 192.168.0.194        #接受agent端位址
a1.sinks.k1.port = 19949

# Use a channel which buffers events in memory
a1.channels.c1.type=memory  
a1.channels.c1.capacity=10000  
a1.channels.c1.transactionCapacity=1000  
a1.channels.c1.keep-alive=30  

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

 啟動采集端服務,windows端:

D:\apache-flume-1.7.0-bin\bin>flume-ng.cmd agent --conf ..\conf --conf-file ..\conf\flume-conf.properties --name a1      

 配置Linux端,agent配置/conf/flume-conf.properties:

tier1.sources=source1
tier1.channels=channel1
tier1.sinks=sink1

tier1.sources.source1.type=avro
tier1.sources.source1.bind=192.168.0.194    #flume接收端位址
tier1.sources.source1.port=19949
tier1.sources.source1.channels=channel1


tier1.channels.channel1.type=memory
tier1.channels.channel1.capacity=10000
tier1.channels.channel1.transactionCapacity=1000
tier1.channels.channel1.keep-alive=30

tier1.sinks.sink1.channel=channel1

tier1.sources.source1.interceptors=e1 e2
tier1.sources.source1.interceptors.e1.type=com.huawei.flume.InterceptorsCommons$Builder
tier1.sources.source1.interceptors.e2.type=com.huawei.flume.InterceptorsFlows$Builder

tier1.sinks.sink1.type = hdfs
tier1.sinks.sink1.hdfs.path=hdfs://192.168.0.194:9000/user/hive/warehouse/%{table_name}/inputdate=%Y-%m-%d      #flume接受端agent,hive表名
tier1.sinks.sink1.hdfs.writeFormat = Text
tier1.sinks.sink1.hdfs.fileType = DataStream
tier1.sinks.sink1.hdfs.fileSuffix = .log
tier1.sinks.sink1.hdfs.rollInterval = 0
tier1.sinks.sink1.hdfs.rollSize = 0
tier1.sinks.sink1.hdfs.rollCount = 0
tier1.sinks.sink1.hdfs.useLocalTimeStamp = true
tier1.sinks.sink1.hdfs.idleTimeout = 60
tier1.sinks.sink1.hdfs.rollSize = 125829120
tier1.sinks.sink1.hdfs.minBlockReplicas = 1      

 啟動Linux端,agent服務:

[[email protected] conf]# flume-ng agent -c /usr/local/flume/conf/ -f /usr/local/flume/conf/flume-conf.properties -n tier1 -Dflume.root.logger=DEBUG,console      

轉載于:https://www.cnblogs.com/zzlain/p/6895346.html