LogScale on Bare Metal - Deploying Amazon Managed Streaming for Apache Kafka (MSK)

Learn how to deploy LogScale with Amazon Managed Streaming for Apache Kafka (MSK) as an alternative to standard Apache Kafka within AWS environments. This page covers essential prerequisites, custom MSK configuration steps, cluster creation through the AWS Console, LogScale configuration requirements, and encryption setup between LogScale and Kafka brokers.

Learn how to deploy LogScale with Amazon Managed Streaming for Apache Kafka (MSK) as an alternative to standard Apache Kafka within AWS environments. This page covers essential prerequisites, custom MSK configuration steps, cluster creation through the AWS Console, LogScale configuration requirements, and encryption setup between LogScale and Kafka brokers.

As an alternative to using Apache Kafka, when deploying LogScale within Amazon Web Services (AWS), Amazon Managed Streaming for Apache Kafka (MSK) can be used instead.

See the Amazon AWS MSK documentation for more information on this Amazon service.

MSK Prerequisites

There are a couple of prerequisites to using Amazon MSK with LogScale. First, ensure that the AWS CLI tools are installed and configured. Also confirm the Access key and Secret key that will be used to connect, as these are required for applying custom configurations to your MSK instance.

A Virtual Private Cloud (VPC) must be configured set up for your Availability Zones on AWS, with a subnet for each Kafka broker. For more information, see Getting Started Using Amazon MSK.

Custom MSK Configuration

Read the documentation on how to add a custom configuration file to MSK. If no configuration file is supplied, MSK will change these configuration parameters from normal Kafka defaults. Because LogScale requires certain configuration parameters to be implemented for Kafka, a custom configuration file for MSK must be created.

  1. Create a file named kafka.properties and add the following values to it:

    ini
    replica.fetch.max.bytes=104857600
    message.max.bytes=104857600
    compression.type=producer
    unclean.leader.election.enable=false

    The full list of other MSK parameters that can be used can be found in AWS documentation.

  2. Create the configuration file for use within MSK. The name and description can be anything, but the name can't contain spaces. Specify a currently supported Kafka 3.x version that matches the version you intend to deploy:

    shell
    aws kafka create-configuration \
      --name "LogScale-MSK-Configuration" \
      --description "Custom LogScale configuration for MSK" \
      --kafka-versions "3.6.0" \
      --server-properties file://config-file-path
  3. A success message similar to this should be returned:

    json
    {
      "Arn": "arn:aws:kafka:us-east-1:123456789012:configuration/LogScale-MSK-Configuration/abcdabcd-abcd-1234-abcd-abcd123e8e8e-1",
      "CreationTime": "2024-01-01T00:54:23.591Z",
      "Description": "Custom LogScale Configuration for MSK",
      "KafkaVersions": ["3.6.0"],
      "LatestRevision": {
        "CreationTime": "2024-01-01T00:54:23.591Z",
        "Description": "Custom LogScale Configuration for MSK",
        "Revision": 1
      },
      "Name": "LogScale-MSK-Configuration"
    }

The MSK custom configuration should now be available for use later in the deployment process.

Creating MSK Cluster using AWS Console

Note

AWS Console UI screenshots are not included in this version of the documentation as the MSK console interface is subject to change. Refer to the current AWS MSK Console documentation for the latest UI guidance.

To create a cluster:

  1. Login to the console, go to AWS MSK Service and then click on Create Cluster.

  2. Give the Cluster any name. Pick the VPC created for this MSK Cluster. See the Amazon MSK page for setting up the VPC.

  3. Select the Kafka version. Kafka 3.6.0 or later is the minimum recommended version for LogScale. Where possible, select the latest available Kafka 3.x version supported by MSK. MSK now supports KRaft mode (ZooKeeper-less architecture) for Kafka 3.x clusters, which is the recommended deployment mode. ZooKeeper-based clusters are considered legacy and should be avoided for new deployments.

  4. Select the Availability Zones and a subnet for each one. The minimum number of Availability Zones recommended is three.

  5. Then add the custom configuration file (see Custom MSK Configuration). Select Use a Custom Configuration and select the name of the configuration file uploaded.

  6. Configure the brokers. Kafka brokers use m5, m6i, or m7i instance types. Current generation instances (m6i or m7i) are recommended for improved performance and cost efficiency. Specifications for these can be found on the AWS EC2 Instance Types page. Define the number of brokers for each Availability Zone.

  7. Optionally, add tags to identify the cluster. For more information on tagging, see AWS Tagging Strategy.

  8. Define how much Storage each broker will have. MSK uses AWS Elastic Block Storage. The amount of storage should correlate to how much data is going to be ingested. Storage cannot be decreased after the cluster has been created.

  9. Encryption is strongly recommended for all deployments, and is required for any production or multi-node cluster. Encryption between clients and brokers requires additional configuration steps — see Configuring Encryption. TLS brokers are accessible on port 9094. PLAINTEXT brokers on port 9092 should not be used in production environments.

  10. If TLS Client authentication is required, see Mutual TLS Authentication for more information.

  11. Basic monitoring is available for free, but the enhanced monitoring costs extra. More information can be found on the Monitoring an Amazon MSK Cluster.

  12. When selecting the security group, it's important to note that the LogScale instance must be able to connect to MSK. This can be either allowing inbound and outbound rules for the IP of the LogScale instance, or if LogScale is running on AWS, adding them to the same security group.

Once all steps have been completed, click the button to create the cluster.

Configuring LogScale for MSK

Once the MSK cluster has been created, deploy LogScale specifying the correct Kafka broker host information. To find the Kafka broker host information, navigate to the MSK cluster in the AWS Console and click View Client Information.

Note

If your MSK cluster is running in KRaft mode, ZooKeeper endpoints will not be present or required. Use only the Kafka broker endpoints provided.

TLS brokers will be on port 9094 and should be used for all production deployments. PLAINTEXT brokers on port 9092 should only be considered for isolated development or testing environments.

When running LogScale on AWS EC2 instances ensure that the security group rules allow LogScale to access MSK and vice versa, by adding both to the same security group. See the MSK documentation for more information.

The configuration information will need to be added to the LogScale server.conf configuration file. For example:

ini
KAFKA_SERVERS=b-1.test-msk-cluster.luq8jf.c3.kafka.us-east-2.amazonaws.com:9094,b-2.test-msk-cluster.luq8jf.c3.kafka.us-east-2.amazonaws.com:9094,b-3.test-msk-cluster.luq8jf.c3.kafka.us-east-2.amazonaws.com:9094

Note

The example above uses port 9094 for TLS-encrypted connections. Ensure your KAFKA_SERVERS value reflects the correct port for your broker configuration.

Configuring Encryption

Encrypted connections between LogScale and Kafka brokers are strongly recommended for all deployments and required for production environments.

To enable encryption, create a configuration file on each LogScale node containing the following parameter:

ini
security.protocol=SSL

Set configuration variables using KAFKA_COMMON_, or one of the other supported prefixes.

Ensure that the KAFKA_SERVERS LogScale parameter points to the Kafka brokers that are using TLS which should be on port 9094.

Once LogScale has been started, visit the administration dashboard to ensure the MSK Kafka Brokers nodes are visible.