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

Buying a Kafka Instance

Kafka instances are tenant-exclusive, and physically isolated in deployment. You can customize the computing capabilities and storage space of a Kafka instance as required.

Preparing Instance Dependencies

Before creating a Kafka instance, prepare the resources listed in Table 1.

Table 1 Kafka resources

Resource

Requirement

Operations

VPC and subnet

You need to configure a VPC and subnet for the Kafka instance as required. You can use the current account's existing VPC and subnet, or create new ones.

Note: VPCs must be created in the same region as the Kafka instance.

For details on how to create a VPC and a subnet, see Creating a VPC. If you need to create and use a new subnet in an existing VPC, see Creating a Subnet for the VPC.

Security group

Different Kafka instances can use the same or different security groups.

Before accessing a Kafka instance, configure security groups based on the access mode. For details, see Table 2.

For details on how to create a security group, see Creating a Security Group. For details on how to add rules to a security group, see Adding a Security Group Rule.

EIP

To access a Kafka instance on a client over a public network, create EIPs in advance.

Note the following when creating EIPs:

  • The EIPs must be created in the same region as the Kafka instance.
  • The number of EIPs must be the same as the number of Kafka instance brokers.
  • The Kafka console cannot identify IPv6 EIPs.

For details about how to create an EIP, see Assigning an EIP.

Procedure

  1. Go to the Buy Instance page.
  2. Specify Billing Mode.
  3. Select a region.

    DMS for Kafka instances in different regions cannot communicate with each other over an intranet. Select a nearest location for low latency and fast access.

  4. Select a Project.

    Projects isolate compute, storage, and network resources across geographical regions. For each region, a preset project is available.

  5. Select an AZ.

    An AZ is a physical region where resources use independent power supply and networks. AZs are physically isolated but interconnected through an internal network.

    Select one, three, or more AZs as required. The AZs cannot be changed once the instance is created.

  6. Enter an Instance Name.

    You can customize a name that complies with the rules: 4–64 characters; starts with a letter; can contain only letters, digits, hyphens (-), and underscores (_).

  7. Select an Enterprise Project.

    This parameter is for enterprise users. An enterprise project manages cloud resources. The enterprise project management service unifies cloud resources in projects, and resources and members in a project. The default project is default.

  8. Configure the following instance specifications:

    Specifications: Select Default or Custom.

    • Default: Specify the version, broker flavor and quantity, disk type, and disk size to be supported by the Kafka instance as required.
      1. Version: 1.1.0, 2.3.0, 2.7, and 3.x are available. The version cannot be changed once the instance is created.
      2. Broker Flavor: Select a broker flavor that best fit your needs.

        Maximum number of partitions per broker x Number of brokers = Maximum number of partitions of an instance. If the total number of partitions of all topics exceeds the upper limit of partitions, topic creation fails.

      3. For Brokers, specify the broker quantity.
      4. Storage space per broker: Disk type and size for storing the instance data. The disk type cannot be changed once the Kafka instance is created.

        The storage space is consumed by message replicas, logs, and metadata. Specify the storage space based on the expected service message size, the number of replicas, and the reserved disk space. Each Kafka broker reserves 33 GB disk space for storing logs and metadata.

        Disks are formatted when an instance is created. As a result, the actual available disk space is 93% to 95% of the total disk space.

      5. Capacity Threshold Policy: Policy used when the disk usage reaches the threshold. The capacity threshold is 95%.
        • Automatically delete: Messages can be created and retrieved, but 10% of the earliest messages will be deleted to ensure sufficient disk space. This policy is suitable for scenarios where no service interruption can be tolerated. Data may be lost.
        • Stop production: New messages cannot be created, but existing messages can still be retrieved. This policy is suitable for scenarios where no data loss can be tolerated.
    • Custom: The system calculates Brokers and Storage Space per Broker, and provides Recommended Specifications based on your specified parameters: Peak Creation Traffic, Retrieval Traffic, Replicas per Topic, Total Partitions, and Messages Created During Retention Period. This function is unavailable for v3.x.

  9. Configure the instance network parameters.

    • Select a VPC and a subnet.

      A VPC provides an isolated virtual network for your Kafka instances. You can configure and manage the network as required.

      After the Kafka instance is created, its VPC and subnet cannot be changed.

    • Select a security group.

      A security group is a set of rules for accessing a Kafka instance. You can click Manage Security Group to view or create security groups on the network console.

      Before accessing a Kafka instance on the client, configure security group rules based on the access mode. For details about security group rules, see Table 2.

  10. Configure Kafka SASL_SSL.

    This parameter indicates whether to enable SASL authentication when a client connects to the instance. If you enable Kafka SASL_SSL, data will be encrypted for transmission to enhance security.

    This setting is enabled by default. It cannot be changed after the instance is created. If you want to use a different setting, you must create an instance.

    After Kafka SASL_SSL is enabled, you can determine whether to enable SASL/PLAIN. If SASL/PLAIN is disabled, the SCRAM-SHA-512 mechanism is used to transmit data. If SASL/PLAIN is enabled, both the SCRAM-SHA-512 and PLAIN mechanisms are supported. You can select either of them as required. The SASL/PLAIN setting cannot be changed once the instance is created.

    What are SCRAM-SHA-512 and PLAIN mechanisms?

    • SCRAM-SHA-512: uses the hash algorithm to generate credentials for usernames and passwords to verify identities. SCRAM-SHA-512 is more secure than PLAIN.
    • PLAIN: a simple username and password verification mechanism.

    If you enable Kafka SASL_SSL, you must also set the username and password for accessing the instance.

  11. Click Advanced Settings to configure more parameters.

    1. Configure public access.

      Public access is disabled by default. You can enable or disable it as required.

      After public access is enabled, configure an IPv4 EIP for each broker.

      After enabling Public Access, you can enable or disable Intra-VPC Plaintext Access. If it is enabled, data will be transmitted in plaintext when you connect to the instance through a private network, regardless of whether SASL_SSL is enabled. This setting cannot be changed after the instance is created. Exercise caution. If you want to use a different setting, you must create an instance.

    2. Configure Automatic Topic Creation.

      This setting is disabled by default. You can configure it as required.

      If this option is enabled, a topic will be automatically created when a message is produced in or consumed from a topic that does not exist. The default topic parameters are listed in Table 2.

      For cluster instances, after you change the value of the log.retention.hours (retention period), default.replication.factor (replica quantity), or num.partitions (partition quantity) parameter, the value will be used in later topics that are automatically created. For example, assume that num.partitions is changed to 5, an automatically created topic has parameters listed in Table 2.

      Table 2 Topic parameters

      Parameter

      Default Value

      Modified Value

      Partitions

      3

      5

      Replicas

      3

      3

      Aging Time (h)

      72

      72

      Synchronous Replication

      Disabled

      Disabled

      Synchronous Flushing

      Disabled

      Disabled

      Message Timestamp

      CreateTime

      CreateTime

      Max. Message Size (bytes)

      10,485,760

      10,485,760

    3. Specify Tags.

      Tags are used to identify cloud resources. When you have multiple cloud resources of the same type, you can use tags to classify them based on usage, owner, or environment.

      • If you have predefined tags, select a predefined pair of tag key and value. You can click View predefined tags to go to the Tag Management Service (TMS) console and view or create tags.
      • You can also create new tags by specifying Tag key and Tag value.

      Up to 20 tags can be added to each Kafka instance. For details about the requirements on tags, see Configuring Kafka Instance Tags.

    4. Enter a Description of the instance for 0–1024 characters.

  12. Click Buy.
  13. Confirm the instance information, read and agree to the HUAWEI CLOUD Customer Agreement, and click Submit.
  14. Return to the instance list and check whether the Kafka instance has been created.

    It takes 3 to 15 minutes to create an instance. During this period, the instance status is Creating.

    • If the instance is created successfully, its status changes to Running.
    • If the instance is in the Failed state, delete it by referring to Deleting Kafka Instances and try creating another one. If the instance creation fails again, contact customer service.

      Instances that fail to be created do not occupy other resources.