본문 바로가기

전체 글

Kafka #1 소개 #kafka란? https://kafka.apache.org LinkedIn 개발한 분산 메세징 시스템이다. kafka.apche.org 에서는 A dstributed Streaming platform 라고 설명하고 있다. 대용량 실시간 처리에 특화 되어 있다. #사용 목적 스트리밍 어플리케이션의 데이터 파이프 라인으로 사용 대용량으로 발생하는 데이터의 중간 버퍼로서 메세지 큐 시스템을 사용하는 곳에 사용될 수 있음 (예를 들어 ELK 스택에서 Logstahs -> Kafka -> Elasticsearch로 중간 메세지 버퍼 역할) #특징 클러스터로 구성 Zookeeper 로 분산처리 publish-subscribe 모델 #비교대상 Rabbit MQ Active MQ #현황 비교대상인 다른 시스템과 다르.. 더보기
geoip 데이터 지도에 표시하기 elasticsearch의 데이터 타입중 geoip가 있다. 이 데이터는 kibana에서 지도에서 표시가 가능하다. apache-access로그의 client IP를 통해 지도에 데이터를 표시하는 예제를 만들어 보자 121.160.132.126 - - [30/Jan/2017:14:24:02 +0530] "GET /index HTTP/1.1" 200 200 common 패턴의 apache access 로그이다. 여기에있는 client IP를 통해 geo_point 데이터를 추출해 Kibana를 통해 지도에 표시해보자 apache access 로그 설정은 아래 글을 참조하면 된다. http://gyrfalcon.tistory.com/entry/Apache-Tomcat-access-log-%EC%84%A4%E.. 더보기
Apache Tomcat access log 설정 Tomcat은 기본적으로 access log를 저장한다. /conf/server.xml에서 변경이 가능하다. 아래 패턴을 통해 조합이 가능하다. %a - Remote IP address%A - Local IP address%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent%B - Bytes sent, excluding HTTP headers%h - Remote host name (or IP address if enableLookups for the connector is false)%H - Request protocol%l - Remote logical username from identd (always returns '-')%m .. 더보기
Logstash(Shipper) 를 사용해 Kafka 메세지를 elasticsearch로 저장 1. download Logstash를 다운받아 압축을 푼다. https://www.elastic.co/kr/downloads/logstash 현재 최신 버전인 logstash-5.1.2 버전을 다운받는다. 보통 elasticsearch도 같은 버전으로 설치를 한다. 2. configuration logstash를 실행할때 지정한 config 파일에 따라 하나의 프로세스로 동작을 한다. 우리가 할껀 input을 kafka로 받아서 output을 elasticsearch로 보내는 것이 대한 config파일을 작성한다. logstash-metric.conf input { kafka { bootstrap_servers => "192.168.0.16:9092,192.168.0.18:9092" topics => .. 더보기
Mac OSX Brew 설치 & SBT 설치 1. Brew 설치 (http://brew.sh/index_ko.html)터미널에 아래 내용을 붙여넣기 하면 brew 가 설치 된다. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. SBT 설치 아래 명령어로 실행 끝brew install sbt 더보기
Flink 시작하기 #3 Word Count Sample (Scala) Flink를 사용해 가장 기본 예제가 되는 Word Count 를 만들어보자. Scala, SBT를 사용한 예제이다. 우선 Dependency 다음과 같다. libraryDependencies += "org.apache.flink" % "flink-streaming-scala_2.11" % "1.1.3" 그리고 코드를 작성 해 보자 import org.apache.flink.streaming.api.scala._ import org.apache.flink.streaming.api.windowing.time.Time object WordCount { def main(args: Array[String]): Unit = { val env = StreamExecutionEnvironment.getExecutio.. 더보기
Flink 시작하기 #4 Flink Cluster(Standalone) 설치 Flink Cluster(Standalone) 설치 1. Requirements Java 1.7 or higher SSH 각 노드마다 java 1.7 이상을 미리 설치해 둔다. 예제에서는 Mac OSX 두개로 Flink Cluster(Standalone)을 세팅 할 것이다. 2. SSH 설정 passwordless SSH 설정: https://opentutorials.org/module/432/3742 Flink는 다른노드들을 SSH로 컨트롤한다. 따라서 아래와 같이 세팅하라고 나온다. having passwordless SSH and the same directory structure on all your cluster nodes 즉 비밀번호 없이 SSH로 접속할 수 있도록 세팅하고, 모든 노드들의 f.. 더보기
Mac 에서 숨김 파일 보기 Mac에서 숨김파일 보이게 하기 #Finder에서 숨김 파일 보기defaults write com.apple.finder AppleShowAllFiles YES && killall Finder #Finder에서 숨김 파일 안 보이게 하기defaults write com.apple.finder AppleShowAllFiles NO && killall Finder 더보기