kafaka2.13-2.8.1集群安装

kafka镜像:https://dlcdn.apache.org/kafka/2.8.1/
kafka官网:http://kafka.apache.org/
kafka文档:

kafka实例:broker1,broker2,broker3.

环境:
kafka集群2.8.1+zookeeper3.62集群+JDK1.8
关闭:防火墙

kafka目录结构:

在这里插入图片描述

1.解压kafaka2.13-2.8.1并重命名kafka

tar -zxvf kafka_2.13-2.8.1.tgz
mv kafka_2.13-2.8.1 kafka

2.配置环境变量(可以省略)

echo "#kafka" >> /etc/profile
echo "KAFKA_HOME=/soft/kafka" >> /etc/profile
echo "PATH=$KAFKA_HOME/bin:$PATH" >> /etc/profile

3.kafka配置

新建消息文件夹
cd kafka
mkdir logs
cd kafka/conf
主要修改server.properties配置文件
#结点
broker.id=0
#服务监听地址
listeners=PLAINTEXT://192.168.189.9:9092
#可删除topic
delete.topic.enable=true
#存储数据位置
log.dirs=/soft/kafka/logs
#zookeeper集群位置
zookeeper.connect=master:2181,slave1:2181,slave2:2181
4.分发并更改结点
xsync /soft/kafka

#结点slave1
broker.id=1
...

#结点slave2
broker.id=2
...

5.启动 :每一台机器上启动master,slave1,slave2

cd /soft/kafka/bin
#启动 加&后台启动
./kafka-server-start.sh ../config/server.properties &
#停止
./kafka-server-stop.sh

成功状态在这里插入图片描述
监听状态
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
可以使用Alluxio提供的Java API来实现查看集群状态,以下是示例代码: ```java import alluxio.client.file.FileSystem; import alluxio.client.file.FileSystemContext; import alluxio.client.file.URIStatus; import alluxio.client.file.options.ListStatusOptions; import alluxio.conf.InstancedConfiguration; import alluxio.master.MasterClientConfig; import alluxio.master.MasterInquireClient; import alluxio.master.MasterInquireClient.Factory; import alluxio.wire.WorkerInfo; import java.net.InetSocketAddress; import java.util.List; public class AlluxioClusterStatus { public static void main(String[] args) throws Exception { // 配置Alluxio的Master地址 String alluxioMasterHostname = "localhost"; int alluxioMasterRpcPort = 19998; InetSocketAddress alluxioMasterAddress = new InetSocketAddress(alluxioMasterHostname, alluxioMasterRpcPort); // 创建Alluxio的FileSystem对象 InstancedConfiguration conf = new InstancedConfiguration(FileSystemContext.create(new MasterInquireClient.Factory().create(MasterClientConfig.defaults().withMasterInquireClient(Factory.LocalMasterInquireClient.create()).create()))); FileSystem fs = FileSystem.Factory.create(conf); // 获取Alluxio集群中的Worker节点信息 List<WorkerInfo> workerInfos = fs.getWorkerInfoList(); for (WorkerInfo workerInfo : workerInfos) { System.out.println(workerInfo); } // 获取Alluxio中的文件列表 ListStatusOptions options = ListStatusOptions.defaults(); List<URIStatus> statusList = fs.listStatus(fs.getUri(), options); for (URIStatus status : statusList) { System.out.println(status.getPath()); } } } ``` 在上述代码中,我们首先创建了一个包含Alluxio Master地址的`InetSocketAddress`对象,并使用该对象创建Alluxio的FileSystem对象。然后,我们使用FileSystem对象获取Alluxio集群中的Worker节点信息,并打印输出。最后,我们还获取了Alluxio中的文件列表,并打印输出。通过这些操作,我们就能够查看Alluxio集群的状态了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

superlliuchao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值