Error ERROR RollingFileManager (/tmp/flume/flume.log) java.io.FileNotFoundException: /tmp/flume/flume.log (Permission denied)

flume

#1

I am getting error when running flume-ng command below.
[altafraghu@gw02 strdeptcount]$ pwd
/home/altafraghu/strdeptcount
[altafraghu@gw02 strdeptcount]$ ls -ltr
total 8
drwxrwxrwx 2 altafraghu students 4096 Nov 18 02:40 logs
-rw-r–r-- 1 altafraghu students 1268 Nov 18 03:05 sdc.conf

sdc.conf is as follows:
#Describe/configure the source
sdc.sources.ws.type = exec
sdc.sources.ws.command = tail -F /opt/gen_logs/logs/access.log

#Describe the sink
sdc.sinks.hd.type = hdfs
sdc.sinks.hd.hdfs.path = hdfs://nn01.itversity.com:8020/user/altafraghu/flume_demo
sdc.sinks.hd.hdfs.filePrefix = FlumeDemo
sdc.sinks.hd.hdfs.fileSuffix = .txt
sdc.sinks.hd.hdfs.rollInterval = 120
sdc.sinks.hd.hdfs.rollSize = 1048576
sdc.sinks.hd.hdfs.rollCount = 100
sdc.sinks.hd.hdfs.fileType = DataStream
sdc.sinks.spark.type = org.apache.spark.streaming.flume.sink.SparkSink
sdc.sinks.spark.hostname = gw02.itversity.com
sdc.sinks.spark.port = 8123

#Use a channel which buffers events in memory
sdc.channels.hdmem.type = memory
sdc.channels.hdmen.capacity = 1000
sdc.channels.hdmem.transactionCapacity = 100

sdc.channels.sparkmem.type = memory
sdc.channels.sparkmen.capacity = 1000
sdc.channels.sparkmem.transactionCapacity = 100

#Bind the source and sink to the channel
sdc.sources.ws.channels = hdmem sparkmem
sdc.sinks.hd.channel = hdmem
sdc.sinks.spark.channel = sparkmem

[altafraghu@gw02 strdeptcount]$ flume-ng agent -n sdc -f sdc.conf
Iorg.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)

main ERROR RollingFileManager (/tmp/flume/flume.log) java.io.FileNotFoundException: /tmp/flume/flume.log (Permission denied) java.io.FileNotFoundException: /tmp/flume/flume.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)

Please help.


#2

@altafraghu

You can see the file is created or not in the hdfs location (hadoop fs -ls /user/altafraghu/flume_demo) as of now you can ignore the exception