-
[Kafka] Connection to node -1 (ip주소:9092) could not be established. Broker may not be available 에러공부/Kafka 2022. 5. 25. 23:16반응형
cd kafka_2.12-2.5.0
일단 자기 버전에 맞게 설치한 디렉토리에 들어간다.
vi config/server.properties
여기서는 카프카 브로커 옵션을 설정할 수 있다.
# The address the socket server listens on. It will get the value returned from # java.net.InetAddress.getCanonicalHostName() if not configured. # FORMAT: # listeners = listener_name://host_name:port # EXAMPLE: # listeners = PLAINTEXT://your.host.name:9092 #listeners=PLAINTEXT://:9092 # Hostname and port the broker will advertise to producers and consumers. If not set, # it uses the value for "listeners" if configured. Otherwise, it will use the value # returned from java.net.InetAddress.getCanonicalHostName(). advertised.listeners=PLAINTEXT://your.host.name:9092
이떄 listeners=PLAINTEXT://:9092를 주석해제 하는 것이 아니라 advertised.listeners=PLAINTEXT://your.host.name:9092를 주석해제하고, 내 IP 주소를 적어주면 된다.
주석 해제를 한 advertised.listeners의 역할은 카프카 클라이언트나 커맨드 라인 툴을 브로커와 연결할 때 쓰인다고 한다.
반응형'공부 > Kafka' 카테고리의 다른 글
[Kafka] 메시지 값 순서가 메시지를 넣은 순서와 다른 이유 (0) 2022.05.26 [AWS, Kafka] ec2 프리티어를 사용할 경우 생기는 에러 (0) 2022.05.21