From fefcaa361772ff82508992a18d8d2cd6f450dac6 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Fri, 12 Nov 2021 11:11:06 +0800 Subject: [PATCH 1/3] [Docs] multiple listeners for KoP 2.9.0 --- docs/configuration.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index fb1e33ef1c..8de94c1e58 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -4,33 +4,29 @@ | Name | Description | | ------------------------ | ------------------------------------------------------------ | -| kafkaListeners | Comma-separated list of URIs that we will listen on and the listener names.
e.g. PLAINTEXT://localhost:9092,SSL://localhost:9093.
If the hostname is not set, the default interface is used. | +| kafkaListeners | Comma-separated list of URIs that we will listen on and the listener names.
e.g. PLAINTEXT://localhost:9092,SSL://localhost:9093.
Each URI's scheme represents a listener name if `kafkaProtocolMap` is configured.
Otherwise, the scheme must be a valid protocol in [PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL].
If hostname is not set, bind to the default interface. | | kafkaProtocolMap | Comma-separated map of listener name and protocol.
e.g. PRIVATE:PLAINTEXT,PRIVATE_SSL:SSL,PUBLIC:PLAINTEXT,PUBLIC_SSL:SSL. | -| listeners | Deprecated. `kafkaListeners` is used. | -| kafkaAdvertisedListeners | Deprecated. Use kafkaProtocolMap, kafkaListeners and advertisedAddress instead. | +| listeners | Deprecated. `kafkaListeners` is used. | +| kafkaAdvertisedListeners | Listeners to publish to ZooKeeper for clients to use.
The format is the same as `kafkaListeners`. | > **NOTE** > > Among all configurations, only `kafkaListeners` or `listeners` (deprecated) is required. -To support multiple listeners, you need to specify different listener names in [`advertisedListeners`](https://pulsar.apache.org/docs/en/concepts-multiple-advertised-listeners/#use-multiple-advertised-listeners). Then map the listener name to the proper protocol in `kafkaProtocolMap`. +To support multiple listeners before, you need to specify different listener names in [`advertisedListeners`](https://pulsar.apache.org/docs/en/concepts-multiple-advertised-listeners/#use-multiple-advertised-listeners). Then map the listener name to the proper protocol in `kafkaProtocolMap`. For example, assuming you need to listen on port 9092 and 19092 with the `PLAINTEXT` protocol, the associated names are `kafka_internal` and `kafka_external`. Then you need to add the following configurations: ```properties -kafkaListeners=kafka_internal://localhost:9092,kafka_external://localhost:19092 +kafkaListeners=kafka_internal://0.0.0.0:9092,kafka_external://0.0.0.0:19092 kafkaProtocolMap=kafka_internal:PLAINTEXT,kafka_external:PLAINTEXT -advertisedListeners=pulsar:pulsar://localhost:6650,kafka_internal:pulsar://localhost:9092,kafka_external:pulsar://localhost:19092 +kafkaAdvertisedListeners=kafka_internal://localhost:9092,kafka_external://localhost:19092 ``` In the above example, - `kafkaListener` is split into multiple tokens by a comma (`,`), the format of each token format is `://:`. - `kafkaProtocolMap` is split into multiple tokens by a comma (`,`), the format of each token format is `:`. -- `advertisedListeners` is split into multiple tokens by a comma(`,`), the format of each token format is `:://:`. - -> **NOTE** -> -> In Pulsar, the `scheme` part could be `pulsar` or `pulsar+ssl`, but in KoP, the `scheme` part must be `pulsar`. +- `kafkaAdvertisedListeners` is split into multiple tokens by a comma(`,`), the format of each token format is `:://:`. ## Logger From 6b5dba756b26adeb905fb0cf69a52427363d783b Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Fri, 12 Nov 2021 11:13:51 +0800 Subject: [PATCH 2/3] Fix docs --- docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index 8de94c1e58..21840d2035 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -13,7 +13,7 @@ > > Among all configurations, only `kafkaListeners` or `listeners` (deprecated) is required. -To support multiple listeners before, you need to specify different listener names in [`advertisedListeners`](https://pulsar.apache.org/docs/en/concepts-multiple-advertised-listeners/#use-multiple-advertised-listeners). Then map the listener name to the proper protocol in `kafkaProtocolMap`. +To support multiple listeners, you need to specify different listener names in `kafkaListeners` and `kafkaAdvertisedListeners`. Then map the listener name to the proper protocol in `kafkaProtocolMap`. For example, assuming you need to listen on port 9092 and 19092 with the `PLAINTEXT` protocol, the associated names are `kafka_internal` and `kafka_external`. Then you need to add the following configurations: From c079c0518013940396879499559b78609a46da41 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Fri, 12 Nov 2021 19:32:19 +0800 Subject: [PATCH 3/3] Address comments --- docs/configuration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 21840d2035..5851bc8f85 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -4,7 +4,7 @@ | Name | Description | | ------------------------ | ------------------------------------------------------------ | -| kafkaListeners | Comma-separated list of URIs that we will listen on and the listener names.
e.g. PLAINTEXT://localhost:9092,SSL://localhost:9093.
Each URI's scheme represents a listener name if `kafkaProtocolMap` is configured.
Otherwise, the scheme must be a valid protocol in [PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL].
If hostname is not set, bind to the default interface. | +| kafkaListeners | Comma-separated list of URIs that we will listen on and the listener names.
e.g. PLAINTEXT://localhost:9092,SSL://localhost:9093.
Each URI's scheme represents a listener name if `kafkaProtocolMap` is configured.
Otherwise, the scheme must be a valid protocol in [PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL].
If the hostname is not set, it will be bound to the default interface. | | kafkaProtocolMap | Comma-separated map of listener name and protocol.
e.g. PRIVATE:PLAINTEXT,PRIVATE_SSL:SSL,PUBLIC:PLAINTEXT,PUBLIC_SSL:SSL. | | listeners | Deprecated. `kafkaListeners` is used. | | kafkaAdvertisedListeners | Listeners to publish to ZooKeeper for clients to use.
The format is the same as `kafkaListeners`. | @@ -13,7 +13,7 @@ > > Among all configurations, only `kafkaListeners` or `listeners` (deprecated) is required. -To support multiple listeners, you need to specify different listener names in `kafkaListeners` and `kafkaAdvertisedListeners`. Then map the listener name to the proper protocol in `kafkaProtocolMap`. +To support multiple listeners, you need to specify different listener names in `kafkaListeners` and `kafkaAdvertisedListeners`. Then, map the listener name to the proper protocol in `kafkaProtocolMap`. For example, assuming you need to listen on port 9092 and 19092 with the `PLAINTEXT` protocol, the associated names are `kafka_internal` and `kafka_external`. Then you need to add the following configurations: @@ -24,9 +24,9 @@ kafkaAdvertisedListeners=kafka_internal://localhost:9092,kafka_external://localh ``` In the above example, -- `kafkaListener` is split into multiple tokens by a comma (`,`), the format of each token format is `://:`. -- `kafkaProtocolMap` is split into multiple tokens by a comma (`,`), the format of each token format is `:`. -- `kafkaAdvertisedListeners` is split into multiple tokens by a comma(`,`), the format of each token format is `:://:`. +- `kafkaListener` is split into multiple tokens by a comma (`,`), the token is in a format of `://:`. +- `kafkaProtocolMap` is split into multiple tokens by a comma (`,`), the token is in a format of `:`. +- `kafkaAdvertisedListeners` is split into multiple tokens by a comma(`,`), the token is in a format of `:://:`. ## Logger