This topic describes how to purchase and deploy an ApsaraMQ for Kafka instance that can be accessed over the Internet and a virtual private cloud (VPC).

Prerequisites

Step 1: Purchase an ApsaraMQ for Kafka instance

  1. Log on to the ApsaraMQ for Kafka console. In the left-side navigation pane, click Instances.
  2. In the top navigation bar, select a region and click Buy Instance.
  3. In the Select Instance Billing Method panel, set the Billing Method parameter to Subscription or Pay-as-you-go. Then click OK.
  4. In the buy panel, configure the parameters based on your business requirements, click Buy Now, and then follow the on-screen instructions to complete the payment. The following table describes the parameters.
    ParameterExample
    Instance EditionStandard Edition (High Write)

    For information about differences between different editions, see Instance editions.

    Region and ZoneChina (Hangzhou)
    Network TypeInternet and VPC
    Traffic Specificationalikafka.hw.2xlarge

    For information about the peak traffic of elastic network interfaces (ENIs) in each traffic specification and the number of partitions provided free of charge by each traffic specification, see Billing rules.

    Partitions100

    This parameter specifies the number of partitions that you want to purchase. The total number of partitions in an instance is calculated based on the following formula: Total number of partitions = Number of partitions provided free of charge by the traffic specification + Number of partitions you purchase. For information about the number of partitions provided free of charge by each specification, see Billing rules.

    Disk TypeSSD

    An SSD delivers higher IOPS than an ultra disk. In scenarios in which the message throughput is high or a large number of messages are accumulated, we recommend that you select SSD for this parameter.

    Disk Capacity900 GB
    Resource GroupDefault Resource Group
    Note To prevent traffic throttling caused by insufficient bandwidth, ApsaraMQ for Kafka estimates the optimal bandwidth based on the instance type you selected. You can purchase the Internet traffic that meets your business requirements as prompted on the buy page.

Step 2: Obtain the VPC information

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click vSwitch. Then, select the region where the VPC is built in the top navigation bar.
  3. On the vSwitch page, view the IDs of your vSwitch and VPC.

Step 3: Deploy the ApsaraMQ for Kafka instance

  1. On the Instances page of the ApsaraMQ for Kafka console, find the created instance that is in the Not Deployed state, and click Deploy in the Actions column.
  2. In the Deploy Instance panel, configure the parameters and click OK. The following table describes the parameters.
    ParameterDescriptionExample
    VPC IDSelect the VPC ID that you obtained in Step 2: Obtain the VPC information. vpc-bp17fapfdj0dwzjkd****
    vSwitch IDSelect the vSwitch ID that you obtained in Step 2: Obtain the VPC information. vsw-bp1gbjhj53hdjdkg****
    Cross-zone DeploymentIf the instance is of Professional Edition, you can specify whether to deploy the instance across zones. Instances that are deployed across zones provide excellent disaster recovery capabilities and have a high tolerance for data center-level faults. Yes
    Candidate Zones of Primary ZoneAfter you select the vSwitch ID, the system automatically sets this parameter to the zone in which the vSwitch is deployed. You can also change the value of this parameter by selecting another zone or adding a zone. This parameter is required only if you set the Cross-zone Deployment parameter to Yes. Zone D
    Candidate Zones of Secondary ZoneWe recommend that you select a new zone as the secondary zone. In most cases, select a zone in reverse alphabetical order. The primary zone and the secondary zone must be different. This parameter is required only if you set the Cross-zone Deployment parameter to Yes. Zone H
    Force Deployment in the Selected ZoneSpecify whether to deploy the instance across the specified candidate zones. By default, No is selected. This parameter is required only if you set the Cross-zone Deployment parameter to Yes. No
    VersionThe version of the ApsaraMQ for Kafka instance that you want to deploy. The version number must be the same as the version number of the broker that the self-managed Apache Kafka cluster uses.
    • 2.6.2
    • 2.2.0
    2.2.0
    Message Retention PeriodSpecify the maximum retention period for messages. Unit: hours. 72
    Maximum Message SizeSpecify the maximum size of a message that can be received on the instance. Unit: MB. 1
    Consumer Offset Retention PeriodSpecify the maximum retention period for consumer offsets. Unit: minutes. 10080
    ACLSpecify whether to enable the access control list (ACL) feature. The ACL feature of ApsaraMQ for Kafka allows you to grant permissions to Simple Authentication and Security Layer (SASL) users to send and receive messages in ApsaraMQ for Kafka. Disable
    Custom Username and PasswordSpecify whether to use a custom username and a custom password. If you select No, the username and password that the system assigns to the instance are used. No
    Disk EncryptionSpecify whether to enable disk encryption for the instance. Enable
    Disk Encryption Key IDThe key ID for disk encryption in the region where the instance is deployed. Follow the on-screen instructions to specify a key ID. This parameter is required if you set the Disk Encryption parameter to Enable. 0d24xxxx-da7b-4786-b981-9a164dxxxxxx
    The instance enters the Deploying state. The instance deployment requires approximately 10 to 30 minutes to complete.
    Note You cannot change the VPC or vSwitch after the instance is deployed.

Step 4: View instance details

  1. In the left-side navigation pane of the ApsaraMQ for Kafka console, click Instances. On the page that appears, click the name of the instance whose details you want to view.
  2. On the Instance Details page, view the endpoints, username, and password of the instance.
    1. In the Endpoint Information section, view the endpoints of the instance. For information about how to select an endpoint, see Comparison among endpoints.
      • You can use the default endpoint and the SASL endpoint if you want to connect to the instance over a VPC.
      • You can use the SSL endpoint if you want to connect to the instance over the Internet.
    2. In the Configuration Information section, view the values of the Username and Password parameters.

Step 5: Configure the whitelist for an endpoint and check whether you can connect to the instance

  1. In the Endpoint Information section of the Instance Details page, find the endpoint for which you want to configure the whitelist and click Manage Whitelist in the Actions column.
  2. On the Whitelist Management page, click Create Whitelist, set the Name and IP addresses or CIDR blocks, and then click OK.
  3. Enable Telnet on your local client and run the telnet Domain name in an endpoint Port number command to check whether you can connect to ApsaraMQ for Kafka.
    For example, if you want to connect the client to the SSL endpoint of the ApsaraMQ for Kafka instance, run the telnet alikafka-pre-cn-zv**********-1.alikafka.aliyuncs.com 9093 command.
    If the Telnet command returns a success response, the client is connected to the ApsaraMQ for Kafka instance. test

    If the instance is running but the client fails to connect to the instance, use the self-check tool to perform a self-check. For more information, see Perform a health check on an instance.

What to do next

Create resources