Team1-TU-tech / semi_final

0 stars 0 forks source link

kafka yaml 파일 실행 시 오류 #10

Open hamsunwoo opened 4 days ago

hamsunwoo commented 4 days ago

오류메세지

kafka-producer  | Traceback (most recent call last):
kafka-producer  |   File "/app/pro.py", line 12, in <module>
kafka-producer  |     producer = KafkaProducer(
kafka-producer  |                ^^^^^^^^^^^^^^
kafka-producer  |   File "/usr/local/lib/python3.11/site-packages/kafka/producer/kafka.py", line 381, in __init__
kafka-producer  |     client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
kafka-producer  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kafka-producer  |   File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 244, in __init__
kafka-producer  |     self.config['api_version'] = self.check_version(timeout=check_timeout)
kafka-producer  |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kafka-producer  |   File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 900, in check_version
kafka-producer  |     raise Errors.NoBrokersAvailable()
kafka-producer  | kafka.errors.NoBrokersAvailable: NoBrokersAvailable
hamsunwoo commented 4 days ago
Traceback (most recent call last):
  File "/app/pro.py", line 12, in <module>
    producer = KafkaProducer(
               ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/producer/kafka.py", line 381, in __init__
    client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 244, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 900, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable
Traceback (most recent call last):
  File "/app/pro.py", line 12, in <module>
    producer = KafkaProducer(
               ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/producer/kafka.py", line 381, in __init__
    client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 244, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 900, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable
Traceback (most recent call last):
  File "/app/pro.py", line 12, in <module>
    producer = KafkaProducer(
               ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/producer/kafka.py", line 381, in __init__
    client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 244, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 900, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable
Traceback (most recent call last):
  File "/app/pro.py", line 12, in <module>
    producer = KafkaProducer(
               ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/producer/kafka.py", line 381, in __init__
    client = KafkaClient(metrics=self._metrics, metric_group_prefix='producer',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 244, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kafka/client_async.py", line 900, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable
[DONE]: 1.4495995044708252
hamsunwoo commented 4 days ago

브로커보다 프로듀서가 먼저 켜져서 생기는 오류... 프로듀서는 연결이 실패하면 restart하는 옵션 추가하여 다시 시도하였을 땐 오류가 없음

hamsunwoo commented 4 days ago

https://medium.com/sjk5766/kafka-broker-3%EA%B0%9C%EB%A5%BC-%EC%B6%94%EC%B2%9C%ED%95%98%EB%8A%94-%EC%9D%B4%EC%9C%A0-79c18dcafaeb

hamsunwoo commented 4 days ago
hamsunwoo commented 4 days ago

연결 실패할 경우,

스크린샷 2024-11-12 10 17 29