Updated on 2024-07-31 GMT+08:00

Upgrading the Kafka Instance Kernel

Upgrade your Kafka instance kernel to use the latest kernel version. A kernel upgrade adds certain new features and resolves certain earlier issues. For example, new features may include consumer group creation on the console and topic details viewing.

Kafka instance kernel upgrades have no impact on the Kafka version. For example, if you use Kafka 2.7, you will still be using it after a kernel upgrade.

Impact of Kernel Upgrades

  • Single-replica topics do not support message production and consumption during an upgrade, which will cause service interruptions.
  • If a topic has multiple replicas, such upgrades will not interrupt services, but may cause disorder of partition messages. Evaluate this impact and avoid peak hours.
  • During an upgrade, broker restarts will cause partition leader switches, interrupting connections in seconds. The switch takes less than a minute when networks are stable. For multi-replica topics, configure retries on the producer client. To do so:
    • Open-source Kafka client: Set the retries parameter to 3, 4, or 5.
    • Flink: Configure the retry policy by referring to the following code:
      StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
      env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, Time.seconds(20)));

Prerequisites

  • The instance must be in the Running state.
  • Upgrade is displayed on the console only if the instance is using an earlier kernel.

Procedure

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your instance is in.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Choose More > Upgrade in the row containing the desired instance.

    Upgrade is not displayed when instances have been using the latest kernel.

  5. Set Execute to Now or As scheduled.

    If you select As scheduled, specify date and time.

  6. In the Risk Check area, check whether the items are normal.

    If any risk is found, handle it as prompted and click Recheck. If the risk does not need to be handled, select I understand the risks.

  7. Click OK.

    The method of checking the upgrade result depends on when the upgrade is executed.

    Table 1 Checking the upgrade result

    Execution

    Check Method

    Now

    1. Click an instance name to go to the instance details page.
    2. Choose Background Tasks in the navigation pane.
    3. Check the upgrade task status on the Background tasks tab page.
      • The upgrade is complete when the task is in the Successful state.
      • The upgrade failed when the task is in the Failed state. Contact customer service.

    As scheduled

    1. Click an instance name to go to the instance details page.
    2. Choose Background Tasks in the navigation pane.
    3. On the Scheduled tasks tab page, check whether the upgrade task is started.
      • The task has not been started when it is in the Pending state.
      • The task has been started when it is in the Successful state.
    4. Check the upgrade task status on the Background tasks tab page.
      • The upgrade is complete when the task is in the Successful state.
      • The upgrade failed when the task is in the Failed state. Contact customer service.

Modifying Scheduled Upgrade Tasks

  1. Go to the Scheduled tasks tab page on the Background Tasks page, click the drop-down box in the upper left corner and select a period. Enter "upgrade" in the search box and press Enter.
  2. Click Modify in the row containing the desired task.
  3. In the Change Schedule dialog box, reschedule or cancel the task.

    • To reschedule: Specify a new time and click OK.
    • To cancel: Select Cancel and click OK.