I want to configure two connect servers. I wrote the compose below, but it works normally when registering the connector through connect-1.
yoon@yoon connect-2.4.0 % curl -X POST /connectors -H “Content-Type: application/json” -d @source.json
{“name”:“postgres-source”,“config”:{“connector.class”:“io.debezium.connector.postgresql.PostgresConnector”,“database.hostname”:“172.19.0.5”,“database.port”:“5432”,“database.user”:“postgres”,“database.password”:“1234”,“database.dbname”:“postgres”,“database.server.name”:“postgres”,“slot.name”:“source”,“topic.prefix”:“CDC”,“table.include.list”:“public.opr,public.opr_sys”,“plugin.name”:“pgoutput”,“name”:“postgres-source”},“tasks”:,“type”:“source”}%
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
yoon@yoon connect-2.4.0 % curl -X GET 8084/connectors
[“postgres-source”]%
yoon@yoon connect-2.4.0 % curl -X GET 8083/connectors
[“postgres-source”]%
but an error occurs when registering the connector through connect-2.
I need your help
curl -X POST 8084/connectors -H “Content-Type: application/json” -d @source.json
{“error_code”:500,“message”:“IO Error trying to forward REST request: java.net.ConnectException: Connection refused”}%
connect-2 | [2023-11-10 07:06:40,680] ERROR IO error forwarding REST request: (org.apache.kafka.connect.runtime.rest.RestClient)
connect-2 | java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
connect-2 | at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
connect-2 | at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
connect-2 | at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732)
connect-2 | at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:154)
connect-2 | at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:116)
connect-2 | at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:80)
connect-2 | at org.apache.kafka.connect.runtime.rest.HerderRequestHandler.completeOrForwardRequest(HerderRequestHandler.java:112)
connect-2 | at org.apache.kafka.connect.runtime.rest.HerderRequestHandler.completeOrForwardRequest(HerderRequestHandler.java:127)
connect-2 | at org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource.createConnector(ConnectorsResource.java:147)
connect-2 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
connect-2 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
connect-2 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
connect-2 | at java.base/java.lang.reflect.Method.invoke(Method.java:568)
connect-2 | at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
connect-2 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134)
connect-2 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177)
connect-2 | at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
connect-2 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81)
connect-2 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
connect-2 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
connect-2 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
connect-2 | at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
connect-2 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
connect-2 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
connect-2 | at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
connect-2 | at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
connect-2 | at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
connect-2 | at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
connect-2 | at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
connect-2 | at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
connect-2 | at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
connect-2 | at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
connect-2 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
connect-2 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
connect-2 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
connect-2 | at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
connect-2 | at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554)
connect-2 | at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
connect-2 | at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
connect-2 | at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
connect-2 | at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
connect-2 | at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
connect-2 | at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
connect-2 | at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
connect-2 | at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
connect-2 | at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
connect-2 | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
connect-2 | at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
connect-2 | at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:181)
connect-2 | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
connect-2 | at org.eclipse.jetty.server.Server.handle(Server.java:516)
connect-2 | at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
connect-2 | at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
connect-2 | at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
connect-2 | at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
connect-2 | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
connect-2 | at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
connect-2 | at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
connect-2 | at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
connect-2 | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
connect-2 | at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
connect-2 | at java.base/java.lang.Thread.run(Thread.java:840)
connect-2 | Caused by: java.net.ConnectException: Connection refused
connect-2 | at java.base/sun.nio.ch.Net.pollConnect(Native Method)
connect-2 | at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
connect-2 | at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
connect-2 | at org.eclipse.jetty.io.SelectorManager.doFinishConnect(SelectorManager.java:355)
connect-2 | at org.eclipse.jetty.io.ManagedSelector.processConnect(ManagedSelector.java:347)
connect-2 | at org.eclipse.jetty.io.ManagedSelector.access$1700(ManagedSelector.java:65)
connect-2 | at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:676)
connect-2 | at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:535)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(EatWhatYouKill.java:362)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:186)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
connect-2 | at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:137)
connect-2 | ... 3 more