Получение ошибки "org.apache.commons.cli.MissingOptionException: отсутствует обязательная опция: n" при попытке запустить Flume Agent - PullRequest
0 голосов
/ 15 марта 2019
hdfs dfs -mkdir /user/saheli_flume
hdfs dfs -mkdir /user/saheli_flume/source
hdfs dfs -mkdir /user/saheli_flume/weblogs  
cd saheli_flume
vi spooldir.conf  

# spooldir.conf : A Spooling directory source

#Name the components on the Agent
agent1.sources=webserver-log-source                                                                                                                                                        
agent1.sinks=hdfs-sink                                                                                                                                                                     
agent1.channels = memory-channel                                                                                                                                                           

#Describe configure the source
agent1.sources.webserver-log-source.type=spooldir                                                                                                                                          
agent1.sources.webserver-log-source.spoolDir = /home/saheli/saheli_flume/source.log                                                                                             
agent1.sources.webserver-log-source.channels =memory-channel                                                                                                                               


#Describe the sink
agent1.sinks.hdfs-sink.type= hdfs                                                                                                                                                          
agent1.sinks.hdfs-sink.hdfs.path = /user/saheli/saheli_flume/weblogs                                                                                                            
agent1.sinks.hdfs-sink.channel = memory-channel                                                                                                                                            
agent1.sinks.hdfs-sink.hdfs.rollInterval=0                                                                                                                                                 
agent1.sinks.hdfs-sink.hdfs.rollSize=524288                                                                                                                                                
agent1.sinks.hdfs-sink.hdfs.rollCount = 0                                                                                                                                                  
agent1.sinks.hdfs-sink.hdfs.fileType = DataStream                                                                                                                                          

# Use a channel which buffers events in memory
agent1.channels.memory-channel.type=memory                                                                                                                                                 
agent1.channels.memory-channel.capacity=1000                                                                                                                                               
agent1.channels.memory-channel.transaction Capacity=10000  




flume-ng agent --conf ./saheli_flume/ -f spooldir.conf -Dflume.root.logger=DEBUG,console –n agent1

При выполнении этого кода я получаю сообщение об ошибке:

rg.apache.commons.cli.MissingOptionException: Missing required option: n                                                                                                                  
        at org.apache.commons.cli.Parser.checkRequiredOptions(Parser.java:299)                                                                                                             
        at org.apache.commons.cli.Parser.parse(Parser.java:231)                                                                                                                            
        at org.apache.commons.cli.Parser.parse(Parser.java:85)                                                                                                                             
        at org.apache.flume.node.Application.main(Application.java:263)  
...