kafka connect 是一个可扩展的、可靠的在kafka和其他系统之间流传输的数据工具。而kafka-connect-ui实现kafka connect服务的可视化管理。本文主要介绍kafka connect服务启动和kafka-connect-ui安装部署。
1 . kafka connect服务启动
首先下载kafka软件,并启动kafka服务和kafka connect。按照quickstart介绍,启动kafka、zookeeper服务,然后启动kafka connect服务,本次采用本机单机部署,服务启动命令如下:
#分别启动zookeeper服务、kafka服务和kafka connect服务
[root@bogon kafka_2.12-2.2.1]# ./bin/zookeeper-server-start.sh config/zookeeper.properties
[root@bogon kafka_2.12-2.2.1]# bin/kafka-server-start.sh config/server.properties
[root@bogon kafka_2.12-2.2.1]# ./bin/connect-distributed.sh ./config/connect-distributed.properties
其中connect-distributed.properties配置文件,需要修改或者开启配置项bootstrap.server(kafka服务url)、rest.port(connct服务端口)、plugin.path(connect plugin路径),本次部署配置修改如下:
# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
bootstrap.servers=localhost:9092
# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests.
#rest.host.name=
rest.port=8083
# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers.
#rest.advertised.host.name=
rest.advertised.port=8083
plugin.path=/home/hadoop/kafka_2.12-2.2.1/connectors
通过访问http://localhost:8083证服务是否成功启动。
- kafka-connect-ui安装
(1)采用docker方式启动kafka-connect-ui服务,启动命令如下:
[root@localhost hadoop]# docker run --rm -it -p 8000:8000 -e "CONNECT_URL=http://192.168.43.10:8083" landoop/kafka-connect-ui
其中,192.168.43.10是本机ip,替换为操作系统实际ip。
通过访问http://localhost:8000/#/验证服务是否成功启动。
(2)若未安装docker,执行如下命令启动docker,部署采用的操作系统centos7.6。
yum install docker
systemctl start docker
- 注意:本次部署,需关闭防火墙。
网友评论