Confluent 4.0.1 KSQL CLI报错:无法覆盖bootstrap.servers属性
Let's break down why you're hitting this error and how to resolve it:
Root Cause
Confluent 4.0.1 uses a client-server architecture for KSQL, which is a major shift from the standalone mode in the older 0.5 version. Your current CLI launch command creates a conflict:
- You're pointing the CLI to connect to a remote KSQL Server (
http://127.0.0.1:9195), which will push its ownbootstrap.serversconfiguration to the client - But you're also forcing the CLI to load the server's local config file (
ksql-server.properties) via--config-file, which defines the samebootstrap.serversproperty—triggering the "cannot override" error
Step-by-Step Solutions
1. Use the Simplified, Correct CLI Launch Command
You don't need to pass the server's config file when starting the CLI. The client is designed to fetch all necessary configuration directly from the connected KSQL Server. Replace your launch command with:
./bin/ksql http://127.0.0.1:9195
2. Override CLI-Specific Properties (If Required)
If you need to set custom properties only for the CLI client (not the server), use the --properties-file flag instead of --config-file. Create a dedicated CLI config file (e.g., ksql-cli.properties) with just the settings you want to adjust, then launch with:
./bin/ksql --properties-file etc/ksql/ksql-cli.properties http://127.0.0.1:9195
Note: Avoid defining bootstrap.servers in this file unless you intentionally want to bypass the server's configuration (not recommended for standard client-server setups).
3. Validate Server Configuration
Double-check that your ksql-server.properties has the correct bootstrap.servers value matching your Kafka cluster. The CLI will inherit this setting automatically when connecting to the server, so there's no need to duplicate it elsewhere.
Why This Worked in 0.5
KSQL 0.5 ran in standalone mode, where the CLI itself acted as the server process—so passing a config file directly made sense. Confluent 4.x moved to a separate client-server model, which changes how configuration is shared between components.
内容的提问来源于stack exchange,提问作者Zamir Arif

