在 hortonworks 沙箱虚拟机中创建 flume 代理,用于将天气数据流式传输到 HDFS

creating flume agent in hortonworks sandbox vm for streaming weather data into HDFS

我正在配置 flume 以流式传输天气数据, 我写了 flume 代理,如下所示,

WeatherAgent.sources=天气

WeatherAgent.sinks = hdfs-写入

WeatherAgent.channels=内存通道

WeatherAgent.sources.Weather.type = 天气

WeatherAgent.sources.Weather.bind = api.openweathermap.org/data/2.5/forecast/city?id=524901&APPID=*********

WeatherAgent.sources.Weather.port = 11111

WeatherAgent.sinks.hdfs-write.type = hdfs

WeatherAgent.sinks.hdfs-write.hdfs.path = hdfs://localhost:8020/user/hadoop/flume

WeatherAgent.sinks.hdfs-write.rollInterval = 30

WeatherAgent.sinks.hdfs-write.hdfs.writeFormat=文本

WeatherAgent.sinks.hdfs-write.hdfs.fileType=DataStream

WeatherAgent.channels.memoryChannel.type = 内存

WeatherAgent.channels.memoryChannel.capacity=10000

WeatherAgent.sources.Weather.channels=memoryChannel

WeatherAgent.sinks.hdfs-write.channel=内存通道

我收到错误

weather agent does not contain any valid channels making it as invalid.

我是flume的新手,我不知道要在代理配置文件中添加哪些所有参数,我什至不知道编写的代理是正确的还是错误的,请帮我解决这个问题。 如果有任何帮助链接可以编写自定义或新代理,请post。

提前致谢

苏约格

 it is type mismatching. In your configuration file you mentioned  

    WeatherAgent.channels= memory-channel

  but you are using  memoryChannel instead of memory-channel

    WeatherAgent.channels.memoryChannel.type = memory

    WeatherAgent.channels.memoryChannel.capacity=10000

    WeatherAgent.sources.Weather.channels=memoryChannel