Confluent本地安装和使用

本文详细介绍了如何在CentOS 7上安装Confluent 5.5.1商业版,并配置JDK 1.8环境。文章还提供了安装步骤、配置环境变量的方法以及如何上传和配置数据库驱动包来实现数据同步。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Confluent本地单节点安装

0.前言

【点击这里查看confluent建立连接器与KsqlDB的使用】

我的环境

名字版本
操作系统centos7
confluent5.5.1(商业版)
jdk1.8

1. 安装jdk【建议安装】

上传到linux的/usr/local/目录下解压

tar -zxvf  jdk1.8.0_144.tar.gz

配置环境变量,修改/etc/profile文件

vi /etc/profile

添加以下内容

#java
export JAVA_HOME=/usr/local/jdk1.8.0_144/
export PATH=$JAVA_HOME/bin:$PATH

使环境变量生效

source /etc/profile

输入java -version查看是否安装成功

[root@hadoop89]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

2. 下载confluent

点击这里查看官网

点击这里百度网盘下载V5.5.1商业版本, 提取码:6x48

点击这里下载各个版本

confluent社区版开源免费,商业版1个kafka broker免费,两个或两个以上kafka broker有30天试用期,试用期过后需要购买密钥,否则无法使用,这里我安装商业版单个broker。具体内容参考下图

3. 安装confluent

上传confluent-5.5.1-2.12.tar.gz/usr/local/目录下解压

tar -zxvf confluent-5.5.1-2.12.tar.gz

上传需要的mysql、sql server、oracle等的驱动包到解压后的confluent的/share/java/kafka-connect-jdbc目录下

配置环境变量,修改/etc/profile文件

vi /etc/profile

添加以下内容

#confluent
export CONFLUENT_HOME=/usr/local/confluent-5.5.1
export PATH=$CONFLUENT_HOME/bin:$PATH

使环境变量生效

source /etc/profile

输入confluent查看是否安装成功

4. 上传驱动包

confluent可以实时将不同数据库的数据同步到其他数据库, 需要上传相关数据库的驱动包

点击这里下载驱动包, 若失效请留言评论联系我获取

上传到$CONFLUENT_HOME/share/java/kafka-connect-jdbc目录下

cd $CONFLUENT_HOME/share/java/kafka-connect-jdbc

5. 启停confluent

启动confluent,一次无法全启动,建议多启动几次。

cofluent local start

关闭confluent

confluent local stop

查看confluent各个组件状态

confluent local status

启动后可能有一定延迟后浏览器才可以访问页面

ip:9021

查看日志,WGkeIh47为随机生成,哪儿个组件报错就查看哪儿个组件下的日志。

cd /tmp/confluent.WGkeIh47

#举例 如查看连接器报错日志
cd connect
cat connect.stdout

6. 设置日志不被清除

confluent启动和部分数据依赖于临时文件下的内容, 所以要设置/tmp下关于confluent的文件不被清理

vi /usr/lib/tmpfiles.d/tmp.conf

添加x /tmp/confluent*,如下

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d

# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp
x /tmp/confluent*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值