1.telnet localhost 44444 2.#前面编辑 conf 文件的端口名 然后我们可以在终端下输入任何字符,第一个终端的日志控制台也会有相应的显示,如 我们输入”hello,world”,得出 第一个终端的日志控制台显示: netcatsource 运行成功! 这里补充一点,flume 只能传递英文和字符,不能用中文,我们先可以在第二个终端输 入“中国”两个字

⑴配置 Flume 数据源 请登录 Linux 系统,打开一个终端,执行如下命令新建一个 Flume 配置文件 flume-to-spark.conf: 1.cd /usr/local/flume 2.cd conf 3.vim flume-to-spark.conf flume-to-spark.conf 文件中写入如下内容: #flume-to-spark.conf: A single-node Flume configuration # Name the components on this agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1.sources.r1.type = netcat a1.sources.r1.bind = localhost a1.sources.r1.port = 33333 # Describe the sink a1.sinks.k1.type = avro a1.sinks.k1.hostname = localhost a1.sinks.k1.port =44444 # Use a channel which buffers events in memory a1.channels.c1.type = memory