Updated on 2023-03-30 GMT+08:00

Test Environment

Perform the following steps to set up the test environment.

Step 1: Buy a Kafka Instance

Buy a Kafka instance with the following configurations. For details about how to buy a Kafka instance, see Buying an Instance.

  • Region: EU-Dublin
  • Project: EU-Dublin
  • AZ: AZ1
  • Instance name: kafka-test
  • Enterprise project: default
  • Version: 2.3.0
  • Broker flavor: kafka.2u4g.cluster
  • Brokers: 3
  • Flavor: ultra-high I/O, 200 GB
  • Capacity threshold policy: automatically delete
  • VPC: If there is no available VPC, create one by referring to Preparing Required Resources.
  • Security group: Select a security group that meets the requirements specified in Preparing Required Resources.
  • Manager username: username used to log in to Kafka Manager
  • Password: password used to log in to Kafka Manager
  • Other settings: Do not enable public access, Kafka SASL_SSL, and automatic topic creation.

After the purchase is complete, obtain the address of the Kafka instance on the instance details page.

Step 2: Create Topics

Create the following three topics for the Kafka instance. For details about how to create a topic, see Creating a Topic.

  • Topic-01: 3 partitions, 1 replica, asynchronous replication
  • Topic-02: 3 partition, 3 replicas, asynchronous replication
  • Topic-03: 3 partition, 3 replicas, synchronous replication

Step 3: Obtain the Testing Tool

Download Kafka CLI v2.3.0.

Step 4: Buy ECSs

Buy two ECSs with the following configurations. For details about how to purchase an ECS, see Purchasing an ECS.

  • One ECS is 4 vCPUs | 8 GB, runs Linux, and is configured with the same region, AZ, VPC, subnet, and security group as the Kafka instance purchased in Step 1: Buy a Kafka Instance.
  • The other ECS is 4 vCPUs | 8 GB, runs Linux, and is configured with the same region, VPC, subnet, and security group but a different AZ as the Kafka instance purchased in Step 1: Buy a Kafka Instance.

Perform the following operations on the ECSs:

  • Install Java JDK and configure the environment variables JAVA_HOME and PATH.
    export JAVA_HOME=/root/jdk1.8.0_231 
    export PATH=$JAVA_HOME/bin:$PATH
  • Download Kafka CLI v2.3.0 and decompress it.
    tar -zxf kafka_2.11-2.3.0.tgz