原创大约 2 分钟
常用Shell命令
查看文件列表。
> hdfs dfs -ls hdfs://172.16.185.176:9000/
# 或者
> hdfs dfs -ls /
> hdfs dfs -ls [-R] /
原创大约 2 分钟
上传本地文件
首先创建Flume的配置文件。
> cd /home/work/flume-1.11.0/conf
> vi upload-file-to-hdfs.conf
# 指定source和sink到channel
b1.sources = r1
b1.channels = c1
b1.sinks = k1
# 配置source
b1.sources.r1.type = spoolDir
b1.sources.r1.spoolDir = /home/work/flume-1.11.0/test
# 配置channel
b1.channels.c1.type = file
b1.channels.c1.checkpointDir = /home/work/flume-1.11.0/checkpoint
b1.channels.c1.dataDirs = /home/work/flume-1.11.0/data
# 配置sink
b1.sinks.k1.type = hdfs
b1.sinks.k1.hdfs.path = hdfs://hadoop:9000/flume/events
b1.sinks.k1.hdfs.filePrefix = fe-
b1.sinks.k1.hdfs.writeFormat = Text
b1.sinks.k1.hdfs.fileType = DataStream
b1.sinks.k1.hdfs.rollInterval = 3600
b1.sinks.k1.hdfs.rollSize = 134217728
b1.sinks.k1.hdfs.rollCount = 0
# 绑定source和sink到channel
b1.sources.r1.channels = c1
b1.sinks.k1.channel = c1
原创大约 3 分钟