데이터 엔지니어 기술 블로그

[🧙Kafka] 카프카 구축 (5) - 카프카 UI 간단하게 구성하기 본문

데이터 엔지니어링

[🧙Kafka] 카프카 구축 (5) - 카프카 UI 간단하게 구성하기

jun_yeong_park 2021. 4. 8. 01:02
반응형

About

카프카를 GUI로 보기 위해서 kafdrop 이라는 라이브러리를 사용하려고 한다. docker로 미리 만들어진 이미지가 있어서 정말 간단하게 사용할 수 있다.

 

 

Tutorial & Example

1. 작업할 폴더를 생성한다.

2. docker-compose.yml 파일을 생성하고 아래처럼 입력한다.

   - KAFKA_BROKERCONNECT에 기존에 생성했던 카프카 브로커를 입력해주었다.

version: "3.8"
services:
  kafdrop:
    image: obsidiandynamics/kafdrop
    restart: "always"
    ports:
      - "9000:9000"
    environment:
      KAFKA_BROKERCONNECT: "pipeline-kafka-1:9092,pipeline-kafka-2:9092,pipeline-kafka-3:9092,pipeline-kafka-4:9092,pipeline-kafka-5:9092"
      JVM_OPTS: "-Xms32M -Xmx64M"

networks:
    default:
        external:
            name: zoo

3. docker-compose up 명령어를 입력한다. 아래처럼 결과를 확인할 수 있다.

kafdrop_1  |
kafdrop_1  | :::    :::     :::     :::::::::: :::::::::  :::::::::   ::::::::  :::::::::        ::::::::
kafdrop_1  | :+:   :+:    :+: :+:   :+:        :+:    :+: :+:    :+: :+:    :+: :+:    :+:      :+:    :+:
kafdrop_1  | +:+  +:+    +:+   +:+  +:+        +:+    +:+ +:+    +:+ +:+    +:+ +:+    +:+             +:+
kafdrop_1  | +#++:++    +#++:++#++: :#::+::#   +#+    +:+ +#++:++#:  +#+    +:+ +#++:++#+           +#++:
kafdrop_1  | +#+  +#+   +#+     +#+ +#+        +#+    +#+ +#+    +#+ +#+    +#+ +#+                    +#+
kafdrop_1  | #+#   #+#  #+#     #+# #+#        #+#    #+# #+#    #+# #+#    #+# #+#             #+#    #+#
kafdrop_1  | ###    ### ###     ### ###        #########  ###    ###  ########  ###              ########
kafdrop_1  |
kafdrop_1  | 2021-04-07 03:59:27.002  INFO ${sys:PID} [           main] k.Kafdrop$EnvironmentSetupListener       : Initializing JAAS config
kafdrop_1  | 2021-04-07 03:59:27.016  INFO ${sys:PID} [           main] k.Kafdrop$EnvironmentSetupListener       : env: null .isSecured kafka: false
kafdrop_1  | 2021-04-07 03:59:27.017  INFO ${sys:PID} [           main] k.Kafdrop$EnvironmentSetupListener       : Env: null
kafdrop_1  | 2021-04-07 03:59:27.360  INFO 1 [           main] o.s.b.StartupInfoLogger                  : Starting application on a73acf9b9b80 with PID 1 (started by root in /)
kafdrop_1  | 2021-04-07 03:59:27.362  INFO 1 [           main] o.s.b.SpringApplication                  : No active profile set, falling back to default profiles: default
kafdrop_1  | 2021-04-07 03:59:31.124  INFO 1 [           main] i.u.s.s.ServletContextImpl               : Initializing Spring embedded WebApplicationContext
kafdrop_1  | 2021-04-07 03:59:31.124  INFO 1 [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3677 ms
kafdrop_1  | 2021-04-07 03:59:32.087  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking truststore file kafka.truststore.jks
kafdrop_1  | 2021-04-07 03:59:32.088  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking keystore file kafka.keystore.jks
kafdrop_1  | 2021-04-07 03:59:32.089  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking properties file kafka.properties
kafdrop_1  | 2021-04-07 03:59:32.258  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking truststore file kafka.truststore.jks
kafdrop_1  | 2021-04-07 03:59:32.259  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking keystore file kafka.keystore.jks
kafdrop_1  | 2021-04-07 03:59:32.260  INFO 1 [           main] k.c.KafkaConfiguration                   : Checking properties file kafka.properties
kafdrop_1  | 2021-04-07 03:59:32.320  INFO 1 [           main] k.s.BuildInfo                            : Kafdrop version: 3.27.0, build time: 2020-06-21T23:16:06.428Z
kafdrop_1  | 2021-04-07 03:59:33.186  INFO 1 [           main] o.s.b.a.e.w.EndpointLinksResolver        : Exposing 15 endpoint(s) beneath base path '/actuator'
kafdrop_1  | 2021-04-07 03:59:33.353  INFO 1 [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
kafdrop_1  | 2021-04-07 03:59:33.638  INFO 1 [           main] o.s.s.c.ExecutorConfigurationSupport     : Initializing ExecutorService 'applicationTaskExecutor'
kafdrop_1  | 2021-04-07 03:59:34.367  INFO 1 [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
kafdrop_1  | 2021-04-07 03:59:34.395  INFO 1 [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
kafdrop_1  | 2021-04-07 03:59:34.490  INFO 1 [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
kafdrop_1  | 2021-04-07 03:59:34.743  INFO 1 [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: brokerDetailsJsonUsingGET_1
kafdrop_1  | 2021-04-07 03:59:34.877  INFO 1 [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: getAllTopicsUsingGET_1
kafdrop_1  | 2021-04-07 03:59:34.979  INFO 1 [           main] o.x.Xnio                                 : XNIO version 3.3.8.Final
kafdrop_1  | 2021-04-07 03:59:35.007  INFO 1 [           main] o.x.n.NioXnio                            : XNIO NIO Implementation Version 3.3.8.Final
kafdrop_1  | 2021-04-07 03:59:35.107  INFO 1 [           main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 9000 (http) with context path ''
kafdrop_1  | 2021-04-07 03:59:35.114  INFO 1 [           main] o.s.b.StartupInfoLogger                  : Started application in 8.548 seconds (JVM running for 9.982)
kafdrop_1  | 2021-04-07 04:00:12.841  INFO 1 [  XNIO-1 task-1] i.u.s.s.ServletContextImpl               : Initializing Spring DispatcherServlet 'dispatcherServlet'
kafdrop_1  | 2021-04-07 04:00:12.842  INFO 1 [  XNIO-1 task-1] o.s.w.s.FrameworkServlet                 : Initializing Servlet 'dispatcherServlet'
kafdrop_1  | 2021-04-07 04:00:12.859  INFO 1 [  XNIO-1 task-1] o.s.w.s.FrameworkServlet                 : Completed initialization in 16 ms

4. <서버 주소 또는 로컬호스트>:9000 으로 들어가면 생성했던 GUI로 카프카를 확인할 수 있다.

 

Kafdrop 메인 화면

5. broekr id를 클릭해보면 브로커에 대한 자세한 정보를 확인할 수 있다.

브로커 UI

6. 토픽을 클릭하면 토픽에 대한 자세한 정보를 확인할 수 있다.

토픽 UI

 

반응형
Comments