# I want to duplicate Connect Server, but an error occurs

**URL:** <https://forum.confluent.io/t/i-want-to-duplicate-connect-server-but-an-error-occurs/9052>\
**Category:** Kafka Connect\
**Created:** [10 November 2023 07:22 UTC](https://forum.confluent.io/t/i-want-to-duplicate-connect-server-but-an-error-occurs/9052 "2023-11-10T07:22:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoon](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@yoon](https://forum.confluent.io/u/yoon)\
**Post date:** [10 November 2023 07:22 UTC](https://forum.confluent.io/t/i-want-to-duplicate-connect-server-but-an-error-occurs/9052/1 "2023-11-10T07:22:57Z")

</div>

I want to configure two connect servers. I wrote the compose below, but it works normally when registering the connector through connect-1, but an error occurs when registering the connector through connect-2.

{“error\_code”:500,“message”:“IO Error trying to forward REST request: java.net.ConnectException: Connection refused”}%

Connectors registered through connect-1 can also be viewed in connect-2, and from what I have checked, I know that the source connector must be registered separately for connect-1 and connect-2.  
I want to hear an answer

The host information registered in extra\_hosts is registered in CONNECT\_REST\_ADVERTISED\_HOST\_NAME, but it was not registered due to the URL when writing the post, so it was modified.

I need your help

docker compose

version: ‘3.0’

services:  
connect-1:  
build: .  
image: comus-connect  
container\_name: connect-1  
ports:  
- “8083:8083”  
networks:  
- kn  
restart: always  
environment:  
- CONNECT\_PLUGIN\_PATH=“/usr/share/java”  
- CONNECT\_BOOTSTRAP\_SERVERS=[kafka.plgrim.com:8120](http://kafka.plgrim.com:8120)  
- CONNECT\_GROUP\_ID=connect-group  
- CONNECT\_CONFIG\_STORAGE\_TOPIC=KAFKA\_CONNECT\_CONFIGS  
- CONNECT\_OFFSET\_STORAGE\_TOPIC=KAFKA\_CONNECT\_OFFSETS  
- CONNECT\_STATUS\_STORAGE\_TOPIC=KAFKA\_CONNECT\_STATUS  
- CONNECT\_KEY\_CONVERTER=org.apache.kafka.connect.json.JsonConverter  
- CONNECT\_VALUE\_CONVERTER=org.apache.kafka.connect.json.JsonConverter  
- CONNECT\_INTERNAL\_KEY\_CONVERTER=org.apache.kafka.connect.json.JsonConverter  
- CONNECT\_INTERNAL\_VALUE\_CONVERTER=org.apache.kafka.connect.json.JsonConverter

- CONNECT\_REST\_ADVERTISED\_HOST\_NAME=connect-1

networks:  
kn:  
name: kn  
driver: bridge  
external: true

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [15 November 2023 06:23 UTC](https://forum.confluent.io/t/i-want-to-duplicate-connect-server-but-an-error-occurs/9052/2 "2023-11-15T06:23:41Z")

</div>

> the source connector must be registered separately for connect-1 and connect-2.

This is incorrect. The request will be forwarded to the appropriate leader worker, then tasks will be distributed as necessary.

Perhaps you’d have better luck scaling 2+ replicas using Strimzi or Confluent CFK in minikube? That way, you won’t need to duplicate config or worry about advertised listeners between workers

Otherwise, extra hosts isn’t what you should be using between two compose services, nor ip addresses

I have an example compose file at [GitHub - OneCricketeer/apache-kafka-connect-docker: [KAFKA-9774] Un-official Docker Image for Apache Kafka Connect](https://github.com/OneCricketeer/apache-kafka-connect-docker#scaling-out)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [15 December 2023 06:24 UTC](https://forum.confluent.io/t/i-want-to-duplicate-connect-server-but-an-error-occurs/9052/3 "2023-12-15T06:24:31Z")

</div>

Closed on 15 December 2023 06:24 UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
