El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Kafka/ Kafka O&M Management/ Using the Kafka Balancing Tool to Limit the Production and Consumption Speed

Using the Kafka Balancing Tool to Limit the Production and Consumption Speed

Updated on 2024-12-13 GMT+08:00

Scenario

Use the kafka-configs.sh command-line tool on the client side to adjust Kafka cluster settings in line with service demands. This tool also enables the regulation of Kafka message throughput at various scopes: topic, user, and client levels.

NOTE:

This function is available in MRS 3.3.1 and later versions.

Prerequisites

  • The MRS cluster administrator has learned service requirements. You have created a Kafka component service user that belongs to the kafkaadmin user group (this is not required for normal clusters).
  • The Kafka client has been installed in a directory, for example, /opt/client.

Procedure

  1. Log in as a client installation user to the node on which the Kafka client is installed.
  2. Switch to the Kafka client installation directory, for example, /opt/client.

    cd /opt/client

  3. Configure environment variables.

    source bigdata_env

  4. Authenticate the user (skip this step for normal clusters).

    kinit Component service user

  5. Switch to the Kafka client installation directory.

    cd Kafka/kafka

  6. Use kafka-configs.sh to manage Kafka traffic. Below are the commonly used commands.

    NOTE:

    The subsequent section details the retrieval process for certain command parameters. The actual parameter values should be used when available.

    • Service IP address of any ZooKeeper node: Log in to FusionInsight Manager, choose Cluster > Services > ZooKeeper and click Instance. You can choose the service IP address of any ZooKeeper instance, for example, 192.168.20.36.
    • clientPort: Log in to FusionInsight Manager, choose Cluster > Services > ZooKeeper, click Configurations, and click All Configurations. On the displayed page, search for and record the value of clientPort, for example, 24002.
    • Kafka cluster IP address: Log in to FusionInsight Manager, click Services, click Kafka, and click Instance. You can choose the service IP address of any Broker instance, for example, 192.168.20.36.
    • The IP port ID is 21007 for Kafka clusters with Kerberos authentication enabled. For normal Kafka clusters, the IP port ID is 9092.
    • Client ID: Log in to the Kafka client, run the following command to obtain the value of CLIENT-ID. For example, the obtained client ID is clientA.

      bin/kafka-consumer-groups.sh --describe --bootstrap-server Kafka cluster IP address:Port --all-groups --command-config config/consumer.properties

    • Topic-level production traffic limiting

      bin/kafka-configs.sh --zookeeper Service IP address of any ZooKeeper node:clientPort/kafka --alter --add-config 'producer_byte_rate=Production traffic limiting speed' --entity-type topics_limit --entity-name Topic name

      The following is an example:

      bin/kafka-configs.sh --zookeeper 192.168.20.36:24002/kafka --alter --add-config 'producer_byte_rate=10485760' --entity-type topics_limit --entity-name testTopic-01

    • Topic-level consumption rate limiting

      bin/kafka-configs.sh --zookeeper Service IP address of any ZooKeeper node:clientPort/kafka --alter --add-config 'consumer_byte_rate=Consumption traffic limiting speed' --entity-type topics_limit --entity-name Topic name

      The following is an example:

      bin/kafka-configs.sh --zookeeper 192.168.20.36:24002/kafka --alter --add-config 'consumer_byte_rate=1048576' --entity-type topics_limit --entity-name testTopic-01

    • User-level production traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --add-config 'producer_byte_rate=Production traffic limiting speed' --entity-type users --entity-name Component service user --command-config config/client.properties

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --add-config 'producer_byte_rate=10485760' --entity-type users --entity-name kafkauser --command-config config/client.properties

    • User-level consumption traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --add-config 'consumer_byte_rate=Consumption traffic limiting speed' --entity-type users --entity-name Component service user --command-config config/client.properties

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --add-config 'consumer_byte_rate=1048576' --entity-type users --entity-name kafkauser --command-config config/client.properties

    • Client-level production traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --add-config 'producer_byte_rate=Production traffic limiting speed' --entity-type clients --entity-name Client ID --command-config config/client.properties

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --add-config 'producer_byte_rate=10485760' --entity-type clients --entity-name clientA --command-config config/client.properties

    • Client-level consumption traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --add-config 'consumer_byte_rate=Consumption traffic limiting speed' --entity-type clients --entity-name Client ID --command-config config/client.properties

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --add-config 'consumer_byte_rate=1048576' --entity-type clients --entity-name clientA --command-config config/client.properties

    • Combined user and client production and consumption traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --add-config 'producer_byte_rate=Production traffic limiting speed,consumer_byte_rate=Consumption traffic limiting speed' --entity-type users --entity-name Component service user --entity-type clients --entity-name Client ID --command-config config/client.properties

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --add-config 'producer_byte_rate=1048576,consumer_byte_rate=1048576' --entity-type users --entity-name kafkauser --entity-type clients --entity-name clientD --command-config config/client.properties

    • Viewing traffic limiting information

      bin/kafka-configs.sh --describe --bootstrap-server Kafka cluster IP address:Port number --entity-type myType --entity-name myName --command-config config/client.properties

      NOTE:
      • The permissible values for myType are topics_limit, users, and clients, and those for myName are Topic name, Component service user, and Client ID.
      • producer_byte_rate and consumer_byte_rate indicate the production rate and consumption rate, respectively. The unit is byte/s.
      • If myType is set to topics_limit, change the command to the following:

        bin/kafka-configs.sh --describe --zookeeper Service IP address of any ZooKeeper node:clientPort/kafka --entity-type topics_limit --entity-name Topic name

      The following is an example:

      bin/kafka-configs.sh --describe --bootstrap-server 192.168.20.36:21007 --entity-type users --entity-name kafkauser --entity-type clients --entity-name clientD --command-config config/client.properties

    • Canceling traffic limiting

      bin/kafka-configs.sh --bootstrap-server Kafka cluster IP address:Port number --alter --delete-config 'producer_byte_rate,consumer_byte_rate' --entity-type myType --entity-name myName --command-config config/client.properties

      NOTE:
      • The permissible values for myType are topics_limit, users, and clients, and those for myName are Topic name, Component service user, and Client ID.
      • If myType is set to topics_limit, change the command to the following:

        bin/kafka-configs.sh --zookeeper Service IP address of any ZooKeeper node:clientPort/kafka --alter --delete-config 'producer_byte_rate,consumer_byte_rate' --entity-type topics_limit --entity-name Topic name

      The following is an example:

      bin/kafka-configs.sh --bootstrap-server 192.168.20.36:21007 --alter --delete-config 'producer_byte_rate,consumer_byte_rate' --entity-type users --entity-name kafkauser --entity-type clients --entity-name client --command-config config/client.properties

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback