Hostname | Private IP | CPU | Memory | OS | 패키지 버전 |
CY5 | 192.168.0.205 | Xeon(R)L5630 @ 2.13GH | 2G | Centos 6.8 64bit | td-agent-2.3.5-0.el6.x86_64 |
CY4 | 192.168.0.204 | Xeon(R)L5630 @ 2.13GH | 2G | Centos 6.8 64bit | kafka_2.12-0.11.0.1 |
# Kafka 로 output 하기 위해서는 별도로 ruby 스크립트를 이용 해야 하며, 인터넷이 되는 환경에서는 내장 되어 있는 gem install 로 쉽게 설치 가능
[root@CY5 ~]# /opt/td-agent/embedded/bin/gem install zookeeper[root@CY5 ~]# /opt/td-agent/embedded/bin/gem install fluent-plugin-kafka
# input 되는 부분은 curl 로 테스트 할 수 있도록 8989포트로 설정 하며, zookeeper와 broker 의 호스트 네임 ,포트를 등록, 해당 토픽도 추가 한다.
[root@CY5 ~]# vi /etc/td-agent/td-agent.conf<source>type httpport 8989</source><match **>@type kafkabrokers CY4:9092zookeeper CY4:2181default_topic cy2</match>
# curl 로 fluentd 8989 포트로 테스트 데이터를 확인 한다.
[root@CY5 ~]# $ curl -X POST -d 'json={"action":"login","user":2}' http://localhost:8989
# consumer node 에서 데이터 확인
[root@CY4 ~]# usr/local/kafka/bin/kafka-console-consumer.sh --zookeeper CY4 --topic cy2 --from-beginning{"action":"login","user":2}
반응형
'System > Fluentd' 카테고리의 다른 글
Fluent Bit -> Fluentd -> elasticsearch (1) | 2018.06.09 |
---|---|
Fluentd Overview/ Default install (0) | 2017.09.30 |