The rest.advertised.host.name (or if you’re using Docker, CONNECT_REST_ADVERTISED_HOST_NAME ) is how a Connect worker communicates with other workers in the cluster. If you set it to localhost then each worker in the cluster will only ever be able to contact itself when you use the REST interface, e.g. to send configuration updates. If the worker happens to be the leader of the connect cluster then the command will work, but if it’s not then you’ll get this:

{"error_code":409,"message":"Cannot complete request because of a conflicting operation (e.g. worker rebalance)"}⏎

If you front your Kafka Connect workers with a load balancer with a random/round-robin policy then you’ll see the above error "randomly", since you’ll only get it if you happen to be forwarded to a worker that is not the leader.

The second problem with doing this is that even though you might get connectors running successfully (if you send the config REST call to a worker that is the leader) the tasks that run across the cluster will all be identified as running on localhost , which makes it impossible to determine which worker they’re on. Here’s an example of a connector running a six tasks across three workers:

$ curl -s "http://localhost:8083/connectors?expand=info&expand=status" | \ jq '."source-datagen-01".status.tasks' [ { "id" : 0, "state" : "RUNNING" , "worker_id" : "localhost:8083" } , { "id" : 1, "state" : "RUNNING" , "worker_id" : "localhost:8083" } , { "id" : 2, "state" : "RUNNING" , "worker_id" : "localhost:8083" } , { "id" : 3, "state" : "RUNNING" , "worker_id" : "localhost:8083" } , { "id" : 4, "state" : "RUNNING" , "worker_id" : "localhost:8083" } , { "id" : 5, "state" : "RUNNING" , "worker_id" : "localhost:8083" } ]