1. Download and upload the flume installation package to the virtual machine
Extraction code:bxi2
2. Unzip the flume installation package and rename it for easy use
tar -zxvf flume-ng-1.6.0-cdh5.14.0.tar.gz -C /opt
mv apache-flume-1.6.0-cdh5.14.0-bin flume
3. Modify the configuration file
- Enter the
/opt/flume/conf
directory - Copy the
flume-env.sh.template
file and rename it toflume-env.sh
- Modify
flume-env.sh
file
cd /opt/flume/conf
cp flume-env.sh.template flume-env.sh
vi flume-env.sh
- In the
flume-env.sh
Add the following files
export JAVA_HOME=/opt/jdk8
export JAVA_OPTS="-Xms2048m -Xmx2048m -Dcom.sun.management.jmxremote"
4. Create a flume working directory
- The working directory is recommended to be created under the
flume/conf
directory
mkdir -p /opt/flume/conf/job
5. Install NetCat server and telnet client
yum install -y nc
yum list telnet*
yum install -y telnet-server.x86_64
yum install -y telnet.x86_64
- When installing the client, first check the client list, as shown below
- Then install the two in the list in order
telnet-server.x86_64、telnet.x86_64
6. Test installation
1) Start the server
- 7777 is a custom port number, be careful not to conflict with other port numbers
nc -lk 7777
2) Start the client
- Start in another window
- 7777 is the port number
- localhost can change the host name of other nodes
telnet localhost 7777
3) Input synchronization test
- Enter content in one of the windows, and check whether the entered content appears in the other window simultaneously
- If synchronization occurs, flume is installed and configured
- The successful result is shown in the figure below