<< Prev Question Next Question >>

Question 44/50

CORRECT TEXT
Problem Scenario 21 : You have been given log generating service as below.
startjogs (It will generate continuous logs)
tailjogs (You can check , what logs are being generated)
stopjogs (It will stop the log service)
Path where logs are generated using above service : /opt/gen_logs/logs/access.log
Now write a flume configuration file named flumel.conf , using that configuration file dumps logs in HDFS file system in a directory called flumel. Flume channel should have following property as well. After every 100 message it should be committed, use non-durable/faster channel and it should be able to hold maximum 1000 events
Solution :
Step 1 : Create flume configuration file, with below configuration for source, sink and channel.
#Define source , sink , channel and agent,
agent1 .sources = source1
agent1 .sinks = sink1
agent1.channels = channel1
# Describe/configure source1
agent1 .sources.source1.type = exec
agent1.sources.source1.command = tail -F /opt/gen logs/logs/access.log
## Describe sinkl
agentl .sinks.sinkl.channel = memory-channel
agentl .sinks.sinkl .type = hdfs
agentl .sinks.sink1.hdfs.path = flumel
agentl .sinks.sinkl.hdfs.fileType = Data Stream
# Now we need to define channell property.
agent1.channels.channel1.type = memory
agent1.channels.channell.capacity = 1000
agent1.channels.channell.transactionCapacity = 100
# Bind the source and sink to the channel
agent1.sources.source1.channels = channel1
agent1.sinks.sink1.channel = channel1
Step 2 : Run below command which will use this configuration file and append data in hdfs.
Start log service using : startjogs
Start flume service:
flume-ng agent -conf /home/cloudera/flumeconf -conf-file
/home/cloudera/flumeconf/flumel.conf-Dflume.root.logger=DEBUG,INFO,console
Wait for few mins and than stop log service.
Stop_logs

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (50q)
Question 1: CORRECT TEXT Problem Scenario 12 : You have been given follo...
Question 2: CORRECT TEXT Problem Scenario 92 : You have been given a spa...
Question 3: CORRECT TEXT Problem Scenario 20 : You have been given MySQL...
Question 4: CORRECT TEXT Problem Scenario 33 : You have given a files as...
Question 5: CORRECT TEXT Problem Scenario 88 : You have been given below...
Question 6: CORRECT TEXT Problem Scenario GG : You have been given below...
Question 7: CORRECT TEXT Problem Scenario 2 : There is a parent organiza...
Question 8: CORRECT TEXT Problem Scenario 45 : You have been given 2 fil...
Question 9: CORRECT TEXT Problem Scenario 50 : You have been given below...
Question 10: CORRECT TEXT Problem Scenario 6 : You have been given follow...
Question 11: CORRECT TEXT Problem Scenario 75 : You have been given MySQL...
Question 12: CORRECT TEXT Problem Scenario 73 : You have been given data ...
Question 13: CORRECT TEXT Problem Scenario 9 : You have been given follow...
Question 14: CORRECT TEXT Problem Scenario 27 : You need to implement nea...
Question 15: CORRECT TEXT Problem Scenario 14 : You have been given follo...
Question 16: CORRECT TEXT Problem Scenario 86 : In Continuation of previo...
Question 17: CORRECT TEXT Problem Scenario 51 : You have been given below...
Question 18: CORRECT TEXT Problem Scenario 19 : You have been given follo...
Question 19: CORRECT TEXT Problem Scenario 23 : You have been given log g...
Question 20: CORRECT TEXT Problem Scenario 42 : You have been given a fil...
Question 21: CORRECT TEXT Problem Scenario 29 : Please accomplish the fol...
Question 22: CORRECT TEXT Problem Scenario 22 : You have been given below...
Question 23: CORRECT TEXT Problem Scenario 24 : You have been given below...
Question 24: CORRECT TEXT Problem Scenario 82 : You have been given table...
Question 25: CORRECT TEXT Problem Scenario 89 : You have been given below...
Question 26: CORRECT TEXT Problem Scenario 11 : You have been given follo...
Question 27: CORRECT TEXT Problem Scenario 87 : You have been given below...
Question 28: CORRECT TEXT Problem Scenario 58 : You have been given below...
Question 29: CORRECT TEXT Problem Scenario 28 : You need to implement nea...
Question 30: CORRECT TEXT Problem Scenario 56 : You have been given below...
Question 31: CORRECT TEXT Problem Scenario 53 : You have been given below...
Question 32: CORRECT TEXT Problem Scenario 5 : You have been given follow...
Question 33: CORRECT TEXT Problem Scenario 16 : You have been given follo...
Question 34: CORRECT TEXT Problem Scenario 41 : You have been given below...
Question 35: CORRECT TEXT Problem Scenario 15 : You have been given follo...
Question 36: CORRECT TEXT Problem Scenario 30 : You have been given three...
Question 37: CORRECT TEXT Problem Scenario 43 : You have been given follo...
Question 38: CORRECT TEXT Problem Scenario 34 : You have given a file nam...
Question 39: CORRECT TEXT Problem Scenario 95 : You have to run your Spar...
Question 40: CORRECT TEXT Problem Scenario 83 : In Continuation of previo...
Question 41: CORRECT TEXT Problem Scenario 60 : You have been given below...
Question 42: CORRECT TEXT Problem Scenario 10 : You have been given follo...
Question 43: CORRECT TEXT Problem Scenario 65 : You have been given below...
Question 44: CORRECT TEXT Problem Scenario 21 : You have been given log g...
Question 45: CORRECT TEXT Problem Scenario 18 : You have been given follo...
Question 46: CORRECT TEXT Problem Scenario 3: You have been given MySQL D...
1 commentQuestion 47: CORRECT TEXT Problem Scenario 77 : You have been given MySQL...
Question 48: CORRECT TEXT Problem Scenario 40 : You have been given sampl...
Question 49: CORRECT TEXT Problem Scenario 85 : In Continuation of previo...
Question 50: CORRECT TEXT Problem Scenario 7 : You have been given follow...