当前位置: 首页 > news >正文

鲲鹏麒麟安装Kafka-v1.1.1

因项目需要在鲲鹏麒麟服务器上安装Kafka v1.1.1,因此这里将安装配置过程记录下来。

环境说明

# 查看系统相关详细信息
[root@test kafka_2.12-1.1.1]# uname -a
Linux test.novalocal 4.19.148+ #1 SMP Mon Oct 5 22:04:46 EDT 2020 aarch64 aarch64 aarch64 GNU/Linux
# 查看操作系统版本信息
[root@test kafka_2.12-1.1.1]# cat /etc/kylin-release 
Kylin Linux Advanced Server release V10 (Tercel)
# 查看逻辑CPU数量
[root@test kafka_2.12-1.1.1]# cat /proc/cpuinfo| grep "processor"| wc -l
32
# 查看CPU信息
[root@test kafka_2.12-1.1.1]# lscpu
Architecture:                    aarch64
CPU op-mode(s):                  64-bit
Byte Order:                      Little Endian
CPU(s):                          32
On-line CPU(s) list:             0-31
Thread(s) per core:              1
Core(s) per socket:              16
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       HiSilicon
Model:                           0
Model name:                      Kunpeng-920
Stepping:                        0x1
CPU max MHz:                     2400.0000
CPU min MHz:                     2400.0000
BogoMIPS:                        200.00
L1d cache:                       2 MiB
L1i cache:                       2 MiB
L2 cache:                        16 MiB
L3 cache:                        64 MiB
NUMA node0 CPU(s):               0-15
NUMA node1 CPU(s):               16-31
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
# 查看Java的版本信息
[root@test kafka_2.12-1.1.1]# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

下载

从apache官网下载相应的版本信息,地址:https://kafka.apache.org/downloads,找到1.1.1版本下载即可,这里下载kafka_2.12-1.1.1.tgz,下载地址:https://archive.apache.org/dist/kafka/1.1.1/kafka_2.12-1.1.1.tgz
这里的版本号有两段,前一段为Scala的版本号,后一段为Kafka的版本,现在最新版本已经到3.X,这里用1.1.1,主要是项目特殊需要,建议还是用高版本的。

Scala 2.11 和 Scala 2.12 是 Scala 编程语言的两个主要版本,它们之间存在一些关键的区别
1. 性能优化Scala 2.12 在性能方面做了很多优化,特别是在 JVM 上。它引入了值类(Value Classes)的改进,减少了运行时的开销。Scala 2.11 的性能相对较低,但它的优化主要集中在稳定性和兼容性上。
2. 字符串插值Scala 2.12 引入了新的字符串插值语法,使用 s 前缀,例如 s"Hello, $name"。Scala 2.11 使用的是旧的字符串插值语法,使用 #{},例如 "Hello, #{name}"。
3. 隐式转换Scala 2.12 对隐式转换进行了一些改进,使其更加安全和易于理解。Scala 2.11 的隐式转换机制相对较为复杂,容易引起混淆。
4. 模块化Scala 2.12 引入了模块化系统,允许开发者将代码分割成多个模块,便于管理和维护。Scala 2.11 没有模块化系统,所有代码都放在一个项目中。
5. 兼容性Scala 2.12 相对于 Scala 2.11 有一些不兼容的更改,特别是在 API 和库的使用上。因此,从 Scala 2.11 迁移到 Scala 2.12 可能需要一些工作。Scala 2.11 是一个长期支持(LTS)版本,这意味着它将获得更长时间的支持和维护。
6. 社区支持Scala 2.12 是目前的主流版本,得到了广泛的社区支持和库的更新。Scala 2.11 虽然仍然在使用,但社区支持逐渐减少。
总结如果你正在开发一个新的项目,建议使用 Scala 2.12 或更高版本,以获得更好的性能和更多的功能。如果你正在维护一个现有的 Scala 2.11 项目,可以考虑在适当的时候迁移到 Scala 2.12,但需要注意兼容性问题。

部署

1、解压文件执行
tar -zxvf kafka_2.12-1.1.1.tgz
2、解压后路径为
[root@test kafka_2.12-1.1.1]# pwd
/data/public/kafka/kafka_2.12-1.1.1
3、修改config/server.properties,注意修改listeners和advertised.listeners即可

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.# see kafka.server.KafkaConfig for additional details and defaults############################# Server Basics ############################## The id of the broker. This must be set to a unique integer for each broker.
broker.id=0############################# Socket Server Settings ############################## The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://192.138.31.100:9092# Hostname and port the broker will advertise to producers and consumers. If not set, 
# it uses the value for "listeners" if configured.  Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
advertised.listeners=PLAINTEXT://192.138.31.100:9092# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL# The number of threads that the server uses for receiving requests from the network and sending responses to the network
num.network.threads=3# The number of threads that the server uses for processing requests, which may include disk I/O
num.io.threads=8# The send buffer (SO_SNDBUF) used by the socket server
socket.send.buffer.bytes=102400# The receive buffer (SO_RCVBUF) used by the socket server
socket.receive.buffer.bytes=102400# The maximum size of a request that the socket server will accept (protection against OOM)
socket.request.max.bytes=409600000############################# Log Basics ############################## A comma separated list of directories under which to store log files
log.dirs=/tmp/kafka-logs# The default number of log partitions per topic. More partitions allow greater
# parallelism for consumption, but this will also result in more files across
# the brokers.
num.partitions=1# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
# This value is recommended to be increased for installations with data dirs located in RAID array.
num.recovery.threads.per.data.dir=1############################# Internal Topic Settings  #############################
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
# For anything other than development testing, a value greater than 1 is recommended for to ensure availability such as 3.
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1############################# Log Flush Policy ############################## Messages are immediately written to the filesystem but by default we only fsync() to sync
# the OS cache lazily. The following configurations control the flush of data to disk.
# There are a few important trade-offs here:
#    1. Durability: Unflushed data may be lost if you are not using replication.
#    2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
#    3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks.
# The settings below allow one to configure the flush policy to flush data after a period of time or
# every N messages (or both). This can be done globally and overridden on a per-topic basis.# The number of messages to accept before forcing a flush of data to disk
#log.flush.interval.messages=10000# The maximum amount of time a message can sit in a log before we force a flush
#log.flush.interval.ms=1000############################# Log Retention Policy ############################## The following configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.# The minimum age of a log file to be eligible for deletion due to age
log.retention.hours=168# A size-based retention policy for logs. Segments are pruned from the log unless the remaining
# segments drop below log.retention.bytes. Functions independently of log.retention.hours.
#log.retention.bytes=1073741824# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=1073741824# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000############################# Zookeeper ############################## Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=localhost:2181# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=6000############################# Group Coordinator Settings ############################## The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance.
# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms.
# The default value for this is 3 seconds.
# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing.
# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup.
group.initial.rebalance.delay.ms=0

启动

1、先启动Zookeeper,执行
nohup /data/public/kafka/kafka_2.12-1.1.1/bin/zookeeper-server-start.sh /data/public/kafka/kafka_2.12-1.1.1/config/zookeeper.properties > /dev/null 2>&1 &

2、然后启动Kafka,执行
nohup /data/public/kafka/kafka_2.12-1.1.1/bin/kafka-server-start.sh /data/public/kafka/kafka_2.12-1.1.1/config/server.properties > /dev/null 2>&1 &

3、检查是否启动

[root@test kafka_2.12-1.1.1]# netstat -nltp | grep -E '(2181|9092)'
tcp6       0      0 192.168.31.100:9092     :::*                    LISTEN      970022/java         
tcp6       0      0 :::2181                 :::*                    LISTEN      966577/java

表明Kafka已经启动起来,其中2181为Zookeeper的端口,9092为Kafka的端口

开启客户端访问

firewall-cmd --zone=public --add-port=2181/tcp --permanent
firewall-cmd --zone=public --add-port=9092/tcp --permanent
firewall-cmd --reload

使用Offset Explorer 2.0访问

在这里插入图片描述
在这里插入图片描述
配置完成后,连接服务器,这时就可以使用Kafka进行生产和消费消息了。
在这里插入图片描述

相关文章:

鲲鹏麒麟安装Kafka-v1.1.1

因项目需要在鲲鹏麒麟服务器上安装Kafka v1.1.1,因此这里将安装配置过程记录下来。 环境说明 # 查看系统相关详细信息 [roottest kafka_2.12-1.1.1]# uname -a Linux test.novalocal 4.19.148 #1 SMP Mon Oct 5 22:04:46 EDT 2020 aarch64 aarch64 aarch64 GNU/Li…...

群控系统服务端开发模式-应用开发-操作记录功能开发

一、开放路由 在根目录下route文件夹下修改app.php文件,代码如下: // 操作日志Route::get(token/get_list,permission.Token/getList);// 获取操作日志列表Route::post(token/get_all,permission.Token/getAll);// 获取操作日志所有数据Route::post(toke…...

昇思25天学习打卡营第33天|共赴算力时代

文章目录 一、平台简介二、深度学习模型2.1 处理数据集2.2 模型训练2.3 加载模型 三、共赴算力时代 一、平台简介 昇思大模型平台,就像是AI学习者和开发者的超级基地,这里不仅提供丰富的项目、模型和大模型体验,还有一大堆经典数据集任你挑。…...

Vue 让视图区域滑到指定位置、回到顶部

滑倒指定位置&#xff1a;获取指定的dom&#xff0c;然后用scrollIntoView使dom出现在视图区域 回到顶部&#xff1a;操作父级dom的scrollTop 0&#xff0c;让该父级下的列表回到顶部 代码如下 <template><div class"testDemo"><div><el-bu…...

EasyGBS点对点穿透P2P远程访问技术在安防视频监控中的应用

随着信息技术的快速发展&#xff0c;安防视频监控系统在公共安全领域的应用变得越来越广泛。传统的视频监控系统多依赖于中心服务器进行视频流的集中处理和分发&#xff0c;这不仅增加了网络带宽的负担&#xff0c;还可能成为系统性能瓶颈。为了解决这些问题&#xff0c;P2P&am…...

Android 使用 Gson + OkHttp 实现 API 的常规使用(个人心得)

学习笔记 一、依赖和权限的添加 网络权限: 在 Android 中进行网络请求时,必须声明权限,确保应用具有访问互联网的能力。 <uses-permission android:name="android.permission.INTERNET"/> 依赖项: 确保在 build.gradle 中添加以下依赖: dependencies …...

WPF+MVVM案例实战与特效(三十九)- 深度剖析一个弧形进度条的实现

文章目录 1、使用 Path 结合 ArcSegment 绘制圆弧1、属性解读2、静态圆弧3、动态圆弧4、运行效果5、圆弧两端点的形状2、总结1、使用 Path 结合 ArcSegment 绘制圆弧 1、属性解读 Path 是 WPF 中的一个标记元素,用于绘制复杂的几何路径形状,而 ArcSegment 用于描述 Path 中…...

opencv——图片矫正

图像矫正 图像矫正的原理是透视变换&#xff0c;下面来介绍一下透视变换的概念。 听名字有点熟&#xff0c;我们在图像旋转里接触过仿射变换&#xff0c;知道仿射变换是把一个二维坐标系转换到另一个二维坐标系的过程&#xff0c;转换过程坐标点的相对位置和属性不发生变换&a…...

前端核心知识总结

‌前端架构知识总结‌主要包括以下几个方面&#xff1a; ‌HTML‌&#xff1a;HTML是构建网页的基础&#xff0c;使用各种标签定义网页的结构&#xff0c;如<html>、<head>、<body>等。HTML5引入了新的语义化标签&#xff0c;如<article>、<section…...

【C语言】五子棋(c语言实现)

这里写目录标题 一、最终效果二、菜单打印函数三、棋盘的初始化和打印四、 人人对战4.1 落子判空函数4.2 悔棋函数4.3 判胜负函数4.4 人人对战 五、人机对战5.1 是将直接调用rand生成随机值&#xff0c;这就不可控5.2 是根据棋子赢面来判断哪里落子最好 六、如果选择退出程序直…...

【数据结构——查找】顺序查找(头歌实践教学平台习题)【合集】

目录&#x1f60b; 任务描述 相关知识 测试说明 我的通关代码: 测试结果&#xff1a; 任务描述 本关任务&#xff1a;实现顺序查找的算法。 相关知识 为了完成本关任务&#xff0c;你需要掌握&#xff1a;1.根据输入数据建立顺序表&#xff0c;2.顺序表的输出&#xff0c;…...

Python的3D可视化库【vedo】2-1 (plotter模块) 绘制器的使用

文章目录 1 相关用语及其关系2 Plotter类的基本使用3 Plotter类具体的初始化设置3.1 全部初始化参数3.2 使用不同的axes vedo是Python实现的一个用于辅助科学研究的3D可视化库。 vedo的plotter模块封装了绘制器类Plotter。 Plotter实例可以用于显示3D图形对象、控制渲染器行为、…...

6.1 初探MapReduce

MapReduce是一种分布式计算框架&#xff0c;用于处理大规模数据集。其核心思想是“分而治之”&#xff0c;通过Map阶段将任务分解为多个简单任务并行处理&#xff0c;然后在Reduce阶段汇总结果。MapReduce编程模型包括Map和Reduce两个阶段&#xff0c;数据来源和结果存储通常在…...

【数模学习笔记】模糊综合评价

声明&#xff1a;以下笔记中的图片均来自“数学建模学习交流”清风老师的课程ppt&#xff0c;仅用作学习交流使用 模糊综合评价 文章目录 模糊综合评价模糊数学经典集合和模糊集合的基本概念经典集合和特征函数模糊集合和隶属函数模糊集合的分类 隶属函数的确定方法方法一 模糊…...

【C语言】库函数常见的陷阱与缺陷(四):内存内容操作函数[1]--memcmp

目录 一、功能与用法 1.1. 功能 1.2. 场景用法 二、陷阱与缺陷 2.1. 比较范围限制问题 2.2. 数据类型兼容性隐患 2.3. 其它 三、安全使用建议 四、代码示例 在 C 语言编程的世界里,内存内容操作函数宛如精密的工具,肩负着操控内存数据的重任。它们能灵活地复制、移动…...

jmeter CLI Mode 传参实现动态设置用户数

一.需求 CLI 运行模式下每次运行想要传入不同的用户数&#xff0c;比如寻找瓶颈值的场景&#xff0c;需要运行多次设置不同的用户数。 二.解决思路 查看官方API Apache JMeter - Users Manual: Getting Started api CLI Mode 一节中提到可以使用如下参数做属性的替换&#…...

数据库和SQL的基本概念

目录 定义数据分类非结构化数据&#xff1a;半结构化数据 :​ 结构化数据 : SQL(Structured Query Language)概念分类 数据库管理概念理解 定义 数据库(Database)是按照数据结构来组织、存储和管理数据的建立在计算机存储设备上的仓库。 数据库是长期储存在计算机内、有组织的…...

CSS系列(9)-- Transform 变换详解

前端技术探索系列&#xff1a;CSS Transform 变换详解 &#x1f504; 致读者&#xff1a;探索 CSS 变换的魔力 &#x1f44b; 前端开发者们&#xff0c; 今天我们将深入探讨 CSS Transform&#xff0c;学习如何创建引人注目的 2D 和 3D 变换效果。 2D 变换基础 &#x1f68…...

一些浅显易懂的IP小定义

IP归属地&#xff08;也叫IP地址&#xff0c;IP属地&#xff09; 互联网协议地址&#xff0c;每个设备上的唯一的网络身份证明。用于确保网络数据能够精准传送到你的设备上。 基于IP数据云全球IP归属地解析&#xff0c;示例Python代码 curl -X POST https://route.showapi.co…...

C 语言动态爱心代码

C 语言动态爱心代码 代码 #include <stdio.h> #include <math.h> #include <windows.h> #include <tchar.h> float f(float x, float y, float z) {float a x * x 9.0f / 4.0f * y * y z * z - 1;return a * a * a - x * x * z * z * z - 9.0f / …...

卡诺图简化逻辑函数详解

你提供的图片是数字逻辑电路教材中关于**卡诺图&#xff08;Karnaugh Map&#xff09;**的内容&#xff0c;主要讲解如何用卡诺图表示和化简逻辑函数。下面我为你逐部分解释&#xff1a;&#x1f4cc; 一、核心概念&#xff1a;什么是卡诺图&#xff1f;卡诺图是一种图形化工具…...

STM8 Bootloader设计与CAN总线固件升级实践

1. 项目概述在嵌入式产品开发中&#xff0c;经常会遇到设备出厂后需要远程升级固件的需求。特别是当设备已经封装完成&#xff0c;无法通过常规编程接口&#xff08;如SWIM、JTAG&#xff09;进行烧录时&#xff0c;Bootloader技术就成为了解决问题的关键方案。这次出差经历让我…...

Phi-4-mini-reasoning实操手册:Web界面响应延迟高?GPU显存占用诊断方法

Phi-4-mini-reasoning实操手册&#xff1a;Web界面响应延迟高&#xff1f;GPU显存占用诊断方法 1. 问题背景与现象分析 当使用Phi-4-mini-reasoning进行推理任务时&#xff0c;Web界面响应延迟高是一个常见问题。这种情况通常表现为&#xff1a; 点击"开始生成"按…...

文字的编码方式————不同UTF之间的区别

目录 1. 编码与字体 A. ASCII&#xff08;American Standard Code for Information Interchange&#xff09; B. ANSI C. UNICODE 2 . UNICODE 编码实现 &#xff08;1&#xff09;UTF-16 a. UTF-16 LE b. UTF-16 BE &#xff08;2&#xff09;UTF-8 &#xff08;3&#xff…...

实战演练:基于快马AI快速构建竞品价格监控爬虫系统

今天想和大家分享一个非常实用的爬虫实战项目——竞品价格监控系统。这个系统可以帮助我们实时跟踪不同电商平台上同类产品的价格变化&#xff0c;对于市场调研、价格策略制定都很有帮助。下面我会详细介绍整个实现过程&#xff0c;以及我在使用InsCode(快马)平台时的一些体验。…...

零基础入门机器人抓取:在快马平台轻松搞定龙虾openclaw安装与第一个程序

最近在学习机器人抓取相关的知识&#xff0c;发现龙虾openclaw是个不错的入门工具。作为一个完全零基础的小白&#xff0c;我在安装和配置环境时遇到了不少困难。好在发现了InsCode(快马)平台&#xff0c;它帮我轻松解决了这些问题。下面分享一下我的学习过程。 了解openclaw …...

Hunyuan翻译模型部署慢?一键镜像提速90%实战验证

Hunyuan翻译模型部署慢&#xff1f;一键镜像提速90%实战验证 还在为Hunyuan翻译模型部署耗时过长而烦恼吗&#xff1f;本文将为你展示如何通过CSDN星图镜像实现90%的部署速度提升&#xff0c;让你快速体验高性能翻译服务。 1. 从零开始&#xff1a;传统部署的痛点与挑战 部署A…...

基于STM32的充电桩控制器设计(有完整资料)

资料查找方式&#xff1a;特纳斯电子&#xff08;电子校园网&#xff09;&#xff1a;搜索下面编号即可编号&#xff1a;T4532205M设计简介&#xff1a;本设计是基于单片机的充电桩控制器设计&#xff0c;主要实现以下功能&#xff1a;1、RFID可以注册卡以及删除卡&#xff0c;…...

Phi-4-mini-reasoning效果展示:高精度数学题求解与逻辑推导实测

Phi-4-mini-reasoning效果展示&#xff1a;高精度数学题求解与逻辑推导实测 1. 模型核心能力概览 Phi-4-mini-reasoning是一款专注于推理任务的文本生成模型&#xff0c;在数学解题和逻辑分析方面展现出惊人的能力。与通用聊天模型不同&#xff0c;它专为多步推理和精确结论而…...

思源宋体专业应用全攻略:从零开始掌握开源中文字体开发

思源宋体专业应用全攻略&#xff1a;从零开始掌握开源中文字体开发 【免费下载链接】source-han-serif-ttf Source Han Serif TTF 项目地址: https://gitcode.com/gh_mirrors/so/source-han-serif-ttf 还在为商业项目寻找高质量中文字体而烦恼&#xff1f;思源宋体作为A…...