Confluent Kafka安装步骤(单节点配置:本地模式)

目的可以用来描述一个人的行动或者计划的目标或意图。

在本文章中,我们将解释如何安装单节点配置的Confluent-Kafka。Confluent平台是由Confluent公司提供的以Apache Kafka为核心的平台。除了Apache Kafka之外,还包含了一些运维工具等等。

操作步骤

参照Confluent官方网站,对目标机器进行下载。由于此次投稿使用了AWS Linux 2,所以参考了RHEL的安装步骤。
Confluent的软件包中存在一个称为local模式的用于开发的独立运行模式。由于本次安装是为了进行功能验证,因此选择使用local模式进行建立。
有关local模式的详细信息,请参考Confluent官方网站。

安装Java。

yum install java-1.8.0-openjdk-devel

进行环境变量的设置。

echo "export JAVA_HOME=$(readlink -e $(which java)|sed 's:/bin/java::')" > /etc/profile.d/java.sh
echo "PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/profile.d/java.sh
source /etc/profile

安装Confluent平台的公钥。该公钥用于在YUM软件包库中签署软件包。

sudo rpm --import https://packages.confluent.io/rpm/5.3/archive.key

导航至 /etc/yum.repos.d/ 并创建一个名为 confluent.repo 的文件,内容如下。这将添加 Confluent 仓库。

zhì /etc/yum.repos.d/ yī gè confluent.repo de , 。zhè Confluent .)

[Confluent.dist]
name=Confluent repository (dist)
baseurl=https://packages.confluent.io/rpm/5.3/7
gpgcheck=1
gpgkey=https://packages.confluent.io/rpm/5.3/archive.key
enabled=1

[Confluent]
name=Confluent repository
baseurl=https://packages.confluent.io/rpm/5.3
gpgcheck=1
gpgkey=https://packages.confluent.io/rpm/5.3/archive.key
enabled=1

清除YUM缓存并安装Confluent平台。

sudo yum clean all && sudo yum install confluent-platform-2.12

为了在独立运行时使用confluent local命令,安装Confluent CLI。

curl -L https://cnfl.io/cli | sh -s -- -b /opt/confluent-5.3.1/bin

将Confluent bin目录的安装位置添加到PATH中。

echo "export PATH=/opt/confluent-5.3.1/bin:$PATH" >> /etc/profile.d/confluent.sh
source /etc/profile

使用Confluent local start命令启动Confluent平台。
此命令将启动所有Confluent平台的组件,包括Kafka、Kafka Connect、KSQL等。

confluent local start
    The local commands are intended for a single-node development environment
    only, NOT for production usage. https://docs.confluent.io/current/cli/index.html

Using CONFLUENT_CURRENT: /tmp/confluent.rrEB8cE3
Starting zookeeper
zookeeper is [UP]
Starting kafka
kafka is [UP]
Starting schema-registry
schema-registry is [UP]
Starting kafka-rest
kafka-rest is [UP]
Starting connect
connect is [UP]
Starting ksql-server
ksql-server is [UP]
Starting control-center
control-center is [UP]
bannerAds