console icon indicating copy to clipboard operation
console copied to clipboard

YAML kafka.brokers config doesn't handle comma separated hostnames.

Open hcoyote opened this issue 2 years ago • 1 comments

Today, the console yaml config file expects kafka.brokers to be an array like the following:

kafka:
  #Brokers is a list of bootstrap servers with
  #port (for example "localhost:9092").
  brokers:
    - redpanda-0:9092
    - redpanda-1:9092
    - redpanda-2:9092

A user can also specify the broker list via an environment variable providing a comma separated list of broker hostnames and ports. In this form, console is doing some sort of string splitting to generate the broker list.

KAFKA_BROKERS=redpanda-0:9092,redpanda-1:9092,redpanda-2:9092

This difference has caused confusion for some users in that they also attempt to set the yaml file to look something like this (which doesn't appear to work)

kafka:
  brokers: "redpanda-0:9092,redpanda-1:9092,redpanda-2:9092"

When configured like the above, it seems like console attempts to connect to a host name "redpanda-0:9092,redpanda-1:9092,redpanda-2:9092"

I'm not sure if the right fix is to

  1. make console error startup when it encounters literal strings with comma separated values in settings like kafka.brokers (or other configs that can take an array of multiple hostnames)
  2. make console accept a string value for kafka.brokers and detect/split on comma to generate the array list on the user's behalf (similar to parsing KAFKA_BROKERS).

Fixing this will reduce configuration papercuts and support questions.

Related thread: https://redpandadata.slack.com/archives/C02RQPX6A1K/p1697641985342729

hcoyote avatar Oct 19 '23 17:10 hcoyote

Related: #762 ?

twmb avatar Nov 14 '23 03:11 twmb