'Kafka'에 해당되는 글 4건

  1. 2016.04.14 [Logstash] Kafka 연동 시 Producer에서 등록이 잘 안될 때 확인 사항 -1
  2. 2016.04.14 [Logstash] Kafka 연동 시 쉽게 디버깅 하기.
  3. 2016.03.31 [Kafka] 재미로 본 Elastic Stack과 Kafka 매칭
  4. 2016.02.12 [Beats] redis/kafka outputs

[Logstash] Kafka 연동 시 Producer에서 등록이 잘 안될 때 확인 사항 -1

Elastic/Logstash 2016. 4. 14. 12:35

한 줄 정리)

문제는 Kafka version 과 logstash kafka plugin version 이 맞지 않아서 발생한 문제 입니다.

ㅡ.ㅡ;



-----------------------------------------------------------------


다 똑같지는 않겠지만 간혹 kafka + zk 실행 하고 producer 실행 및 consumer 실행을 했는데 데이터가 들어 가지도 않고 가져 오지도 못하는 문제를 겪는 경우가 있습니다.


일단 제가 경험한 메시지는 아래와 같습니다.


ERROR Error when sending message to topic test1 with key: null, value: 13 bytes with error: Batch Expired


이 메시지를 검색해 보면 그닥 쓸만한 내용이 나오지 않습니다.

그래서 검색어를 "kafka advertised host name"로 변경해서 찾아 보았습니다.


ec2에 올려 구성한 경우 위 검색어에 대한 문제로 kafka 와 zk 가 정상적으로 등록이 되지 않는 문제가 있는 것 같습니다.

실제 zk cli 로 들어가서 ls /brokers/ids/0 하면 아무런 정보가 나오지 않습니다. 

이것은 zk에 broker 가 정상적으로 등록이 되지 않았다는 의미 인데요.


https://cwiki.apache.org/confluence/display/KAFKA/FAQ


여기서 아래 내용 참고해서 설정 변경 하시고 broker가 zk 에 잘 등록되어 있는지 부터 확인 하시면 좋을 것 같습니다.


Why can't my consumers/producers connect to the brokers?

When a broker starts up, it registers its ip/port in ZK. You need to make sure the registered ip is consistent with what's listed in metadata.broker.list in the producer config. By default, the registered ip is given by InetAddress.getLocalHost.getHostAddress. Typically, this should return the real ip of the host. However, sometimes (e.g., in EC2), the returned ip is an internal one and can't be connected to from outside. The solution is to explicitly set the host ip to be registered in ZK by setting the "hostname" property in server.properties. In another rare case where the binding host/port is different from the host/port for client connection, you can set advertised.host.name and advertised.port for client connection.


:

[Logstash] Kafka 연동 시 쉽게 디버깅 하기.

Elastic/Logstash 2016. 4. 14. 11:26

그냥 들어가고 나오고가 잘되는지 보기 위한 logstash input/output config 입니다.

별것도 아니지만 늘 구글링 하기도 귀찮고 해서 기록해 봅니다.


참고문서)

https://www.elastic.co/blog/logstash-kafka-intro

https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html

https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html



Logstash Output Kafka - Producer)


$ bin/logstash -e "input { stdin {} } output { kafka { bootstrap_servers => '172.x.x.x:9024' topic_id => 'logstash_logs' } }"



Logstash Input Kafka - Consumer)


$ bin/logstash -e "input { kafka { zk_connect => '172.x.x.x:2181' topic_id => 'logstash_logs' } } output { stdout { codec => rubydebug } }"


:

[Kafka] 재미로 본 Elastic Stack과 Kafka 매칭

ITWeb/개발일반 2016. 3. 31. 18:16

그냥 재미로 한번 매칭해 봤습니다.

크게 의미는 없으니 재미로 봐주세요.


Kafka)


Elastic Stack)



 Elastic Stack

 Kafka

 logstash, beats

 producer

 elasticsearch cluster

 cluster (broker + zk)

 logstash

 consumer

 index

 topic 

 shard

 partition

 document id

 offset 

 index.number_of_replicas

 --replication-factors

 index.number_of_shards

 --partitions


저는 이해하기 쉬운데 저만 그런가요??


:

[Beats] redis/kafka outputs

Elastic/Beats 2016. 2. 12. 11:08

beats 1.1.0 이 릴리즈 되면서 공지된 내용입니다.


원본링크)


내용요약)

[ASIS]

Beats -> Logstash -> Redis -> Logstash -> Elasticsearch


[TOBE]

Beats -> Redis/Kafka -> Logstash -> Elasticsearch


beats 랑 logstash는 매우 비슷한 기능을 제공하고 있습니다.

아마도 elastic 내부에서도 고민이 될 것 같기도 한데요.

beats 와 logstash 를 다 사용해본 개인적 입장에서는 각각의 특성에 맞춰 사용하면 되지 싶습니다.

단순하게 비교하면 성능은 beats 가 좋은것 같고 다양성과 활용도 측면에서는 logstash가 좋은것 같습니다.


: