Flume collecting tomcat logs to a local directory

Source: Internet
Author: User

Download Flume and JDK

Flume

wget https://mirrors.cnnic.cn/apache/flume/1.6.0/ apache-flume-1.6.0-src.tar.gz

650) this.width=650; "title=" Jdk.png "alt=" wkiol1kc_w2h9yy3aaaxrrwqx9s510.png-wh_50 "src=" https://s5.51cto.com/ Wyfs02/m02/92/ca/wkiol1kc_w2h9yy3aaaxrrwqx9s510.png-wh_500x0-wm_3-wmp_4-s_2373369697.png "/>


Unzip the file

Tar zxvf apache-flume-1.6.0-src.tar.gz

Move the specified directory

MV apache-flume-1.6.0-src.tar.gz /usr/local


Go to/ETC/PROFILE.D directory, add java.sh file, add environment variable

Java_home=/usr/local/java
Java_bin=/usr/local/java/bin
Jre_home=/usr/local/java/jre
Flume_home=/usr/local/flume
Catalina_home=/usr/local/tomcat
Class_path= "$JAVA _home/lib: $JRE _home/lib: $JRE _home/lib/charsets.jar"
Export path= $PATH: $JAVA _home/bin: $CATALINA _home/bin: $FLUME _home/bin


Make environment variables effective

Source/etc/profile


Create vim/usr/local/flume/conf/tomcat.conf

A1.sources = S1

A1.sources.s1.type = Exec

A1.sources.s1.command = Tail-f/usr/local/tomcat/logs/catalina.out

A1.sources.s1.channels = M1

A1.channels = M1

A1.channels.m1.type = Memory

a1.channels.m1.capacity = 1000

a1.channels.m1.transactionCapacity = 100

A1.sinks = Localout

A1.sinks.LocalOut.type = File_roll

A1.sinks.LocalOut.sink.directory =/opt/data

A1.sinks.LocalOut.sink.rollInterval = 0

A1.sinks.LocalOut.channel = M1


Enter the Flume directory

Cd/usr/local/flume/conf

Perform

Flume-ng agent-c. -f/usr/local/flume/conf/exec_tail.conf-n A1-dflume.root.logger=info,console



View saved directories, saved

Ll/opt/data

650) this.width=650; "title=" Opt.png "src=" https://s4.51cto.com/wyfs02/M01/92/CC/ Wkiom1kdastsl0fbaaaj2nsukxg349.png-wh_500x0-wm_3-wmp_4-s_3680644488.png "alt=" Wkiom1kdastsl0fbaaaj2nsukxg349.png-wh_50 "/>

Flume collecting tomcat logs to a local directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.