'zookeeper'에 해당되는 글 2건

  1. 2016.04.14 [Logstash] Kafka 연동 시 Producer에서 등록이 잘 안될 때 확인 사항 -1
  2. 2012.04.27 zookeeper 그게 뭔가요?

[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.


:

zookeeper 그게 뭔가요?

ITWeb/Hadoop일반 2012. 4. 27. 17:10

이제 Open Source Stack 중 zookeeper 에 대해서 학습을 해보려 합니다.
워낙에 잡식성이라서.. 새로운 기술에 대해서 공부하고 배우는걸 좋아라 하여.. ㅎㅎ
뭐 이 세계는 평생 공부해도 부족할 것 같긴하내요.

일단 zookeeper 를 이해하기 위해서 필요한 정보를 어디서 구해야 할지 정리해 봅니다.

정리라고 하기에는.. ㅋ 딸랑 두개.. 근데.. 저는 위 두군데 문서면.. 충분한것 같구요.
더 필요한 정보들은 커뮤니티등을 통해서.. 얻도록 하겠습니다.

이제 담주 부터.. 고고씽~

[원문]

http://zookeeper.apache.org/doc/trunk/zookeeperOver.html

ZooKeeper: A Distributed Coordination Service for Distributed Applications

ZooKeeper is a distributed, open-source coordination service for distributed applications. It exposes a simple set of primitives that distributed applications can build upon to implement higher level services for synchronization, configuration maintenance, and groups and naming. It is designed to be easy to program to, and uses a data model styled after the familiar directory tree structure of file systems. It runs in Java and has bindings for both Java and C.

Coordination services are notoriously hard to get right. They are especially prone to errors such as race conditions and deadlock. The motivation behind ZooKeeper is to relieve distributed applications the responsibility of implementing coordination services from scratch.

[구글번역]

ZooKeeper : 분산 어플 리케이션을위한 분산 조정 서비스
ZooKeeper 분산 애플 리케이션을위한 분산, 오픈 소스 협력 서비스입니다. 그것은분산 응용 프로그램이 더 높은 동기화를위한 수준의 서비스, 구성 유지 보수 및 그룹과 명명을 구현하는 구축할 수있는 기본형 단순한 집합을 제공합니다. 그것은 프로그램에 쉽게  수 있도록 설계, 및 파일 시스템의 익숙한 디렉토리 트리 구조  스타일을 데이터 모델을 사용합니다. 그것은 자바에서 실행 및 Java와 C 모두에 대해 바인딩을 가지고

조정 서비스를 바로 얻을 악명 어렵다. 그들은 이러한 경쟁 조건 교착 상태와 같은 오류 특히 경향이있다. ZooKeeper 뒤에 동기는 분산 응용 프로그램에게 처음부터조정 서비스를 구현의 책임을 완화하는 것입니다.


: