Broker

Starting the Kafka broker

A Kafka cluster consists of one or more brokers (servers). Producers push the records to the topics within broker that stores them on disk keyed by unique offset. It allows consumers to fetch messages by topic, partition and offset.

The broker is a cluster level component and can be (re)started as follows:

Usage:

./axual.sh [start|restart] cluster broker

Adding or changing Broker configurations (Axual CLI)

As of broker release 6.0.0 it has become easier to override Kafka Configurations for the broker. For an overview of Kafka configurations, please check https://kafka.apache.org/26/documentation.html#brokerconfigs

To add new broker configuration, you have to make changes in Axual CLI on the server where you are starting the broker.

  • cd to the directory where Axual CLI is unpacked. This usually is something like ~/platform-deploy or ~/axual-cli.

  • Edit service/cluster-services.sh file and navigate to function start_service_broker_current.

  • Locate below code under same function.

    local BROKER_ARGS=$( (
        echo "BROKER_BROKER_ID=$NODE_ID"
        echo "BROKER_BROKER_RACK=rack-$RACK_ID"
        echo "NODE_HOSTNAME=$HOSTNAME"
        echo "BROKER_SSL_TRUSTSTORE_LOCATION=/security/$SERVER_TRUSTSTORE"
        echo "BROKER_SSL_KEYSTORE_LOCATION=/security/$SERVER_KEYSTORE"
        ...
        ...
        ...
    ) | as_docker_environment_variables )
    1. Add the new configuration under BROKER_ARGS variable (same like other configuration in the above code snippet) with prefix BROKER_ following the configuration name in capital letters.

      Example: Suppose you want to add new connections.max.idle.ms configuration, then you can add it as: echo "BROKER_CONNECTIONS_MAX_IDLE_MS=300000"

      This will look something like:

      local BROKER_ARGS=$( (
          echo "BROKER_BROKER_ID=$NODE_ID"
          echo "BROKER_BROKER_RACK=rack-$RACK_ID"
          echo "NODE_HOSTNAME=$HOSTNAME"
          echo "BROKER_SSL_TRUSTSTORE_LOCATION=/security/$SERVER_TRUSTSTORE"
          echo "BROKER_SSL_KEYSTORE_LOCATION=/security/$SERVER_KEYSTORE"
          ...
          ...
          ...
          echo "BROKER_CONNECTIONS_MAX_IDLE_MS=300000"
      ) | as_docker_environment_variables )
    2. After you have made the changes, restart the Axual Broker with the following command:

      ./axual.sh restart cluster broker