(一)Kafka 多租户架构

目录

一. 前言

二. Kafka 多租架构(Multi-Tenancy)

2.1. 概览

2.2. 使用 Topic 命名为租户创建用户空间(命名空间)

2.3. 配置 Topic(Configuring Topics: Data Retention And More)


一. 前言

    Kafka 租户模式是一种多租户架构模式,用于在单个 Kafka 集群中支持多个不同的租户。这种模式可以提供更好的资源隔离和租户管理,同时减少硬件成本和管理复杂性。

二. Kafka 多租架构(Multi-Tenancy)

2.1. 概览

原文引用:As a highly scalable event streaming platform, Kafka is used by many users as their central nervous system, connecting in real-time a wide range of different systems and applications from various teams and lines of businesses. Such multi-tenant cluster environments command proper control and management to ensure the peaceful coexistence of these different needs. This section highlights features and best practices to set up such shared environments, which should help you operate clusters that meet SLAs/OLAs and that minimize potential collateral damage caused by "noisy neighbors".

    作为一个高度可扩展的事件流媒体平台,Kafka 被许多用户用作他们的中枢神经系统,实时连接来自不同团队和业务线的各种不同系统和应用程序。这种多租户集群环境需要适当的控制和管理,以确保这些不同需求可以和平共处。本节重点介绍了设置此类共享环境的功能和最佳实践,这些功能和实践将有助于您运营符合 SLAs/OLAs 的集群,并最大限度地减少“嘈杂邻居”造成的潜在附带损害。

原文引用:Multi-tenancy is a many-sided subject, including but not limited to:

  • Creating user spaces for tenants (sometimes called namespaces)
  • Configuring topics with data retention policies and more
  • Securing topics and clusters with encryption, authentication, and authorization
  • Isolating tenants with quotas and rate limits
  • Monitoring and metering
  • Inter-cluster data sharing (cf. geo-replication)

多租户是一个多方面的主题,包括但不限于:

  • 为租户创建用户空间(有时称为命名空间)。
  • 使用数据保留策略等配置 Topic。
  • 通过加密、身份验证和授权保护 Topic和集群。
  • 用配额和速率限制隔离租户。
  • 监测和计量。
  • 集群间数据共享(参见地理复制)。

2.2. 使用 Topic 命名为租户创建用户空间(命名空间)

原文引用:Kafka administrators operating a multi-tenant cluster typically need to define user spaces for each tenant. For the purpose of this section, "user spaces" are a collection of topics, which are grouped together under the management of a single entity or user.

    操作多租户集群的 Kafka 管理员通常需要为每个租户定义用户空间。就本节而言,“用户空间”是Topic 的集合,在单个实体或用户的管理下分组在一起。

原文引用:In Kafka, the main unit of data is the topic. Users can create and name each topic. They can also delete them, but it is not possible to rename a topic directly. Instead, to rename a topic, the user must create a new topic, move the messages from the original topic to the new, and then delete the original. With this in mind, it is recommended to define logical spaces, based on an hierarchical topic naming structure. This setup can then be combined with security features, such as prefixed ACLs, to isolate different spaces and tenants, while also minimizing the administrative overhead for securing the data in the cluster.

    在 Kafka 中,数据的主要单位是 Topic。用户可以创建并命名每个 Topic。他们也可以删除它们,但不能直接重命名 Topic。相反,要重命名 Topic,用户必须创建一个新 Topic,将消息从原始 Topic 移动到新 Topic,然后删除原始 Topic。考虑到这一点,建议基于分层 Topic 命名结构定义逻辑空间。然后,可以将此设置与安全功能(如带前缀的 ACLs)相结合,以隔离不同的空间和租户,同时最大限度地减少保护集群中数据的管理开销。

原文引用:These logical user spaces can be grouped in different ways, and the concrete choice depends on how your organization prefers to use your Kafka clusters. The most common groupings are as follows.

    这些逻辑用户空间可以以不同的方式分组,具体的选择取决于您的组织喜欢如何使用 Kafka 集群。最常见的分组如下。

原文引用:By team or organizational unit: Here, the team is the main aggregator. In an organization where teams are the main user of the Kafka infrastructure, this might be the best grouping.

    按团队或组织单位:在这里,团队是主要的聚合器。在一个团队是 Kafka 基础设施的主要用户的组织中,这可能是最好的分组。

原文引用:Example topic naming structure:

  • <organization>.<team>.<dataset>.<event-name> (e.g., "acme.infosec.telemetry.logins")

Topic 命名结构示例:

  • <organization>.<team>.<dataset>.<event-name>(例如,“acme.infosec.termetry.logins”)

原文引用:By project or product: Here, a team manages more than one project. Their credentials will be different for each project, so all the controls and settings will always be project related.

    按项目或产品:在这里,一个团队管理多个项目。每个项目的凭据都不同,因此所有控件和设置始终与项目相关。

原文引用:Example topic naming structure:

  • <project>.<product>.<event-name> (e.g., "mobility.payments.suspicious")

Topic 命名结构示例:

  • <project>.<product>.<event-name>(例如,“mobility.payments.suspicious”)

原文引用:Certain information should normally not be put in a topic name, such as information that is likely to change over time (e.g., the name of the intended consumer) or that is a technical detail or metadata that is available elsewhere (e.g., the topic's partition count and other configuration settings).

    某些信息通常不应放在 Topic 名称中,例如可能随时间变化的信息(例如,预期消费者的名称),或者是其他地方可用的技术细节或元数据(例如,Topic 的分区计数和其他配置设置)。

原文引用:To enforce a topic naming structure, several options are available:

  • Use prefix ACLs (cf. KIP-290) to enforce a common prefix for topic names. For example, team A may only be permitted to create topics whose names start with payments.teamA..
  • Define a custom CreateTopicPolicy (cf. KIP-108 and the setting create.topic.policy.class.name) to enforce strict naming patterns. These policies provide the most flexibility and can cover complex patterns and rules to match an organization's needs.
  • Disable topic creation for normal users by denying it with an ACL, and then rely on an external process to create topics on behalf of users (e.g., scripting or your favorite automation toolkit).
  • It may also be useful to disable the Kafka feature to auto-create topics on demand by setting auto.create.topics.enable=false in the broker configuration. Note that you should not rely solely on this option. 

要强制主题命名结构,有几个选项可用:

  • 使用前缀 ACLs(参见 KIP-290)为 Topic 名称强制使用通用前缀。例如,团队 A 可能只被允许创建名称以支付开头的 Topic。
  • 定义一个自定义的 CreateTopicPolicy(参见 KIP-108 和设置 create.topic.policy.class.name)以强制执行严格的命名模式。这些策略提供了最大的灵活性,可以覆盖复杂的模式和规则,以满足组织的需求。
  • 通过 ACL 拒绝为普通用户创建 Topic,然后依靠外部进程代表用户创建 Topic(例如,脚本或您喜欢的自动化工具包)。
  • 通过在 Broker 配置中设置 auto.create.topics.enable=false,禁用 Kafka 功能以根据需要自动创建 Topic 也可能很有用。请注意,您不应仅依赖此选项。

2.3. 配置 Topic(Configuring Topics: Data Retention And More)

原文引用:Kafka's configuration is very flexible due to its fine granularity, and it supports a plethora of per-topic configuration settings to help administrators set up multi-tenant clusters. For example, administrators often need to define data retention policies to control how much and/or for how long data will be stored in a topic, with settings such as retention.bytes (size) and retention.ms (time). This limits storage consumption within the cluster, and helps complying with legal requirements such as GDPR.

    Kafka 的配置由于其精细的粒度而非常灵活,并且它支持过多的每个 Topic 的配置设置,以帮助管理员设置多租户集群。例如,管理员通常需要定义数据保留策略,以控制主题中数据的存储量和/或存储时间,设置如 retention.bytes(大小)和 retention.ms(时间)。这限制了集群中的存储消耗,并有助于遵守 GDPR 等法律要求。

后续内容请参见《(二)Kafka 多租户架构》。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/801783.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

深入了解ConnMan:Linux下的网络管理精灵

在Linux生态系统中&#xff0c;网络配置和管理是任何用户或管理员日常任务的重要组成部分。随着移动计算设备的普及和物联网(IoT)的快速发展&#xff0c;对灵活、轻量级且功能强大的网络管理工具的需求日益增长。这就是ConnMan——Connection Manager的用武之地。 ConnMan简介…

fr中如果要调整FVS中的图表类组件的相关属性的研究摘要

每个FVS组件里外层套一个div duchamp-widget-view ,这个是在view/duchamp/resource?resource=/com/fr/plugin/wysiwyg/web/static/js/preview.f8c6df67.chunk.js中搜索关键字duchamp-widget-view可找到。基本每个组件都会走:{key: "setChartOptions",value: funct…

Zookeeper脑裂解决方案

Zookeeper脑裂原因&#xff1a; 主要原因是Zookeeper集群和Zookeeper client判断超时并不能做到完全同步&#xff0c;也就是说可能一前一后&#xff0c;如果是集群先于client发现&#xff0c;那就会出现上面的情况。同时&#xff0c;在发现并切换后通知各个客户端也有先后快慢…

python 08Pandas

1.基础概念 2.基本操作 &#xff08;1&#xff09;加载数据集 import pandas as pd #引入pandas包 打开csv文件 df pd.read_csv(./data/gapminder.tsv,sep\t) #\t制表符&#xff0c;即tab&#xff0c;缩进四个字符 \n表示回车换行 print(type(df)) print(df.head()) #…

DNS正反向解析实验

正向解析 服务端IP客户端IP网址192.168.48.130192.168.48.131www.openlab.com 准备工作 # 服务端及客户端都关闭安全软件 [rootserver ~]# setenforce 0[rootserver ~]# systemctl stop firewalld[rootserver ~]# yum install bind -y服务端配置静态IP [rootserver ~]#…

政安晨:【Keras机器学习实践要点】(二十二)—— 基于 TPU 的肺炎分类

目录 简述 介绍 / 布置 加载数据 可视化数据集 建立 CNN 纠正数据失衡 训练模型 拟合模型 可视化模型性能 ​编辑预测和评估结果 政安晨的个人主页&#xff1a;政安晨 欢迎 &#x1f44d;点赞✍评论⭐收藏 收录专栏: TensorFlow与Keras机器学习实战 希望政安晨的博客…

【数据结构】可持久化平衡树(单点+区间)(FHQ-Treap版)

和主席树类似&#xff0c;开一个 rot[N] 数组记录每个版本的根结点即可 int root, idx; // 分别表示根结点编号和当前用到哪个结点 int val[N * 70]; // 结点权值 int pri[N * 70]; // 结点优先级 int sz[N * 70]; // 结点子树大小 int ch[N * 70][2]; // 结点左右儿子 int ta…

你知道哪几种当前流行的lisp语言的方言?

估计很多人都看过《黑客与画家》这本书&#xff0c;这本书主要介绍黑客即优秀程序员的爱好和动机&#xff0c;讨论黑客成长、黑客对世界的贡献以及编程语言和黑客工作方法等所有对计算机时代感兴趣的人的一些话题。作者保罗格雷厄姆字里行间不经意间向大家推介Lisp是最好的编程…

RabbitMQ3.13.x之十一_RabbitMQ中修改用户密码及角色tags

RabbitMQ3.13.x之十一_RabbitMQ中修改用户密码及角色tgs 文章目录 RabbitMQ3.13.x之十一_RabbitMQ中修改用户密码及角色tgs1. 修改用户的密码1. 修改密码语法2. 修改案例 2.修改角色tags1. 修改标签(tags)语法2. 修改案例 可以使用 RabbitMQ 的命令行工具 rabbitmqctl 来修改用…

Laravel 项目如何运行

如有一个 Laravel 项目&#xff0c;在配置好 PHP 版本和运行环境后&#xff0c;可以直接在项目下直接运行&#xff1a; php artisan serve 来启动你的项目。 通过浏览器查看 当项目运行后&#xff0c;默认的启动端口为 8000&#xff0c;可以通过浏览器来进行查看运行的 Larav…

二维数组及其内存图解

二维数组 在一维数组的介绍当中曾说&#xff0c;数组中可以储存任何同类型的元素&#xff0c;那么这个元素是不是可以也是数组呢&#xff1f;答案是可以&#xff0c;即在数组之中储存数组元素。这种情况就是多维数组&#xff0c;当一个数组中的元素是数组时叫做二维数组&#x…

《系统架构设计师教程(第2版)》第8章-系统质量属性与架构评估-03-ATAM方法架构评估实践(下)

文章目录 3. 测试阶段3.1 头脑风暴和优先场景&#xff08;第7步&#xff09;3.1.1 理论部分3.1.2 示例 3.2 分析架构方法&#xff08;第8步&#xff09;3.2.1 调查架构方法1&#xff09;安全性2&#xff09;性能 3.2.2 创建分析问题3.2.3 分析问题的答案胡佛架构银行体系结构 3…

Spring 面试题(七)

1. Spring 是如何解决循环依赖的? Spring 通过一系列复杂的机制来解决循环依赖问题&#xff0c;特别是在单例作用域的 Bean 之间。以下是一些关键点和 Spring 如何处理它们&#xff1a; 构造函数循环依赖&#xff1a; Spring 容器无法解决构造函数注入导致的循环依赖。这是因…

222222222222222222222222

欢迎关注博主 Mindtechnist 或加入【Linux C/C/Python社区】一起学习和分享Linux、C、C、Python、Matlab&#xff0c;机器人运动控制、多机器人协作&#xff0c;智能优化算法&#xff0c;滤波估计、多传感器信息融合&#xff0c;机器学习&#xff0c;人工智能等相关领域的知识和…

2024年MathorCup+认证杯数模竞赛助攻规划+竞赛基本信息介绍

为了更好的帮助大家助攻未来几天的竞赛&#xff0c;除了给大家上次提供的2024年上半年数学建模竞赛一览表&#xff08;附赠12场竞赛的优秀论文格式要求&#xff09; 又为大家提供了本周末两场数模竞赛2023年的竞赛题目以及优秀论文&#xff0c;希望能对大家本周末的竞赛有所帮…

1087: 【C3】【高精度】计算2的N次方

题目描述 任意给定一个正整数N(N<100)&#xff0c;计算2的n次方的值。 输入 输入一个正整数N。 输出 输出2的N次方的值。 样例输入 5 样例输出 32 Code: xint(input()) print(pow(2,x)) 用C太长了&#xff0c;这里放Python代码。

Linux quotaon命令教程:如何在Linux中启用磁盘配额(附实例详解和注意事项)

Linux quotaon命令介绍 quotaon是一个用于在一个或多个文件系统上启用磁盘配额的命令。文件系统配额文件必须存在于指定文件系统的根目录中&#xff0c;并且命名为aquota.user&#xff08;用于版本2用户配额&#xff09;&#xff0c;quota.user&#xff08;用于版本1用户配额&…

《C语言深度解剖》(4):深入理解一维数组和二维数组

&#x1f921;博客主页&#xff1a;醉竺 &#x1f970;本文专栏&#xff1a;《C语言深度解剖》 &#x1f63b;欢迎关注&#xff1a;感谢大家的点赞评论关注&#xff0c;祝您学有所成&#xff01; ✨✨&#x1f49c;&#x1f49b;想要学习更多数据结构与算法点击专栏链接查看&am…

动态指定easyui的datagrid的url

动态指定easyui的datagrid的url 重新指定datagrid url的请求方法&#xff1a; $("#dg").datagrid("options").url"xxx"注意&#xff0c;如果直接使用 $(#btnq).bind(click, function(){ $(#dg).datagrid({ url: xxx });//重新指定url$(#dg)…

(delphi11最新学习资料) Object Pascal 学习笔记---第9章第1节(Try-Except块)

9.1 Try-Except块 ​ 让我从一个相当简单的 try-except 示例&#xff08;ExceptionsTest 示例的一部分&#xff09;开始&#xff0c;这个示例有一个通用的异常处理块&#xff1a; function DividePlusOne(A, B: Integer): Integer; begintry// 如果B等于0&#xff0c;则引发异…