티스토리 뷰

반응형

현재 개발되고 있는 환경은 윈도우에서 설치한 linux환경을 기준으로 설명을 하겠다. 리눅스 서버에 flume을 설치해보자. 기본적으로 자바 JDK가 설치가 되어 있어야 한다.

 

 

$ cd /usr/local/
$ mkdir applications
$ cd applications

user은 어플리케이션이나 라이브러리를 설치할 수 있는 디렉토리이다. 디렉토리에 들어가서 폴더를 하나 만들자. 여기에 apache flume을 설치할 것이다. 이제 홈페이지를 들어가자.

 

 

 

flume.apache.org/download.html

 

Download — Apache Flume

 

flume.apache.org

 위의 url에 들어가면 아래의 그림이 보일 것이다.

 binary에서 첫번째부분을 눌러준다. binary는 압축을 풀면, 설치 없이 바로 사용이 가능하다.

 

 

www.apache.org/dyn/closer.lua/flume/1.9.0/apache-flume-1.9.0-bin.tar.gz

 

Apache Download Mirrors

We suggest the following mirror site for your download: https://mirror.navercorp.com/apache/flume/1.9.0/apache-flume-1.9.0-bin.tar.gz Other mirror sites are suggested below. It is essential that you verify the integrity of the downloaded file using the PGP

www.apache.org

위의 url에 들어가면 아래의 그림이 보일 것이다.

 

이 부분을 우측 클릭해서 링크를 복사한다.

 

그리고 아래와 같이 wget을 적고 뒤에 shift+insert를 눌러서 아래와 같이 만든 후에 엔터를 친다.

$ wget https://mirror.navercorp.com/apache/flume/1.9.0/apache-flume-1.9.0-bin.tar.gz

 

 

다운 받은 위치에서 아래의 명령어를 통해 압축을 풀어준다.

$ tar xvf apache-flume-1.9.0-bin.tar.gz

 

압축을 푼 파일에 들어가서 실행파일인 flume-ng가 있는지 확인을 하자.

$ cd apache-flume-1.9.0-bin
$ cd bin
$ ll
// 녹색으로 된 flume-ng파일이 있으면 정상적으로 설치가 된것이다.

 

 

우리는 binary를 설치 했기 때문에 바로 설치가 완료된 것을 알 수 있다. 

 

 

실행법은 아래와 같다.

$ cd /usr/local/applications
$ mkdir weblog // 목적에 맞는 파일을 넣어준다. 웹로그 관련 conf를 우리는 넣어볼 것이다.
$ cd weblog
$ vi weblog.conf

 

편집기로 들어가면 아래의 코드를 넣어준다. (수정은 i을 누른 후에 shift+inset로 복사해 넣어준다)

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

 

넣어준 후에 :wq를 통해 나오면 된다.

 

 

마지막으로 아래의 코드를 넣어주면 실행이 된다.

 

$ cd /usr/local/applications/apache-flume-1.9.0-bin
$ $ bin/flume-ng agent --conf conf --conf-file ../weblog/weblog.conf --name a1 -Dflume.root.logger=INFO,console

 

 

이제 다른 서버를 열고 아래의 명령어로 통신 테스트를 하면 된다.

 

$ localhost 44444 // 통신프로그램이 열리고, 이제 통신을 테스트가 가능하다.
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함