Flume으로 입력을 받아서 Elasticsearch에 저장

1. Flume설치 

참고사이트 ( https://flume.apache.org/index.html )

  1. Download
    1. wget http://apache.tt.co.kr/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
  2. untar
    1. tar -zxvf apache-flume-1.6.0-bin.tar.gz
  3. Source, Sink 유형별 참고
    1. https://flume.apache.org/FlumeUserGuide.html
  4. 진행해본 Example

    1. 간단한 seq발생source로 elasticsearch 적재 (conf/example.conf)

    2. 특정 디렉토리를spooling하고, kafka channel을 사용해서 elasticsearch에 적재하는 잡을 구성해봄! (conf/test.conf)

  5. 환경설정
    1. conf/flume-env.sh : export JAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote"
  6. flume 실행 ex)bin/flume-ng agent -n a1 -c conf -f conf/test.conf


참고 : flume에서 사용해야 하는 3rd party lib은 plugins.d 디렉토리 하나만들어서 넣어주면 custom 별로 정리

  (https://flume.apache.org/FlumeUserGuide.html#installing-third-party-plugins

  • eleasticsearch사용시 관련 external jar 추가해야함!


2. kafka 설치

참고사이트 ( http://kafka.apache.org/ )

  1. Download
    1. wget http://apache.mirror.cdnetworks.com/kafka/0.9.0.1/kafka_2.10-0.9.0.1.tgz
  2. unzip
    1. tar -zxvf kafka_2.10-0.9.0.1.tgz
  3.  기동 및 테스트
    1. bin/zookeeper-server-start.sh config/zookeeper.properties
    2. bin/kafka-server-start.sh config/server.properties


3. elasticsearch 설치

참고사이트 ( https://www.elastic.co/ )

  1. Download
    1. wget  https://www.elastic.co/downloads/past-releases/elasticsearch-1-7-5
  2. unzip
    1. unzip elasticsearch-1.7.5.zip
  3. 편리성을 위한 plugin 설치
    1. head(인덱스 및 데이터조회)
      1. bin/plugin -install mobz/elasticsearch-head
    2. bigdesk(노드 및 클러스터 모니터링)
      1. bin/plugin -install lukas-vlcek/bigdesk
  4. 환경설정
    1. config/elasticsearch.yml
      1. cluster.name: elasticsearch
      2. node.name: host01
  5.  기동 및 테스트
    1. bin/elasticsearch
    2. curl -X GET http://localhost:9200/
  6. plugin을 통한확인

    1. head : http://localhost:9200/_plugin/head/
    2. bigdesk : http://localhost:9200/_plugin/bigdesk/
  7. curl을 이용한 데이터 조회방법
    1. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
버전 호환성의 문제로 1.7.5로 진행함. 현재 2.2까지 Release


'BigData' 카테고리의 다른 글

Hadoop Securiy for Multi tenant #2  (0) 2017.01.20
Hadoop Securiy for Multi tenant #1  (0) 2017.01.17
Storm특징 및 Spark와의 차이점  (0) 2014.12.12
CAP 정리  (0) 2014.11.28
NoSQL  (0) 2014.11.28

+ Recent posts