confluentinc / cp-all-in-one

docker-compose.yml files for cp-all-in-one , cp-all-in-one-community, cp-all-in-one-cloud, Apache Kafka Confluent Platform
970 stars 684 forks source link

ksqldb-cli cannot connect to ksqldb-server #67

Closed gpietro closed 3 years ago

gpietro commented 3 years ago

Description Hi,

I'm trying to use the docker-compose file community version to execute some ksql statements. When connecting to the ksqldb-cli container through docker exec -it ksqldb-cli bash there is an error with the connection to ksqldb-server. The configuration seems to be correct but I'm not able to use ksql.

Any idea?

Thanks

Troubleshooting

The server responded with the following error: Error issuing GET to KSQL server. path:/info Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8088 Caused by: Could not connect to the server. Please check the server details are correct and that the server is running.




**Environment**
 - GitHub branch: 6.1.0-post
 - Operating System: macOS BigSur 11.1
 - Version of Docker Engine: v20.10.5
 - Version of Docker Compose: 2
ybyzek commented 3 years ago

@gpietro the error message shows:

Remote server at http://localhost:8088 does not appear to be a valid KSQL

which means that the CLI is trying to connect to localhost (i.e., the ksqldb-cli container), which is not correct. It needs to connect to the ksqldb-server contiainer. The correct command is:

docker exec -it ksqldb-cli ksql http://ksqldb-server:8088

and the output will show:

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

                  ===========================================
                  =       _              _ ____  ____       =
                  =      | | _____  __ _| |  _ \| __ )      =
                  =      | |/ / __|/ _` | | | | |  _ \      =
                  =      |   <\__ \ (_| | | |_| | |_) |     =
                  =      |_|\_\___/\__, |_|____/|____/      =
                  =                   |_|                   =
                  =  Event Streaming Database purpose-built =
                  =        for stream processing apps       =
                  ===========================================

Copyright 2017-2020 Confluent Inc.

CLI v6.1.1, Server v6.1.1 located at http://ksqldb-server:8088
Server Status: RUNNING

Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!

ksql> 
jangalapallisr commented 1 year ago

@ybyzek, I'm trying to connect to my existing Kafka 3 node cluster(v3.4.0) which is hosted on AWS, I have added below entries at below 3 config files before docker compose up connect.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092 ksql-production-server.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092 ksql-server.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092

and started ksql container as you suggested aforesaid, but getting below error (server status is unknow) and ksql commands are throwing error, plz help me on this, how to connect or config remote Kafka cluster.

ksql % docker exec -it ksqldb-cli ksql http://primary-ksqldb-server:8088

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

              ===========================================
              =       _              _ ____  ____       =
              =      | | _____  __ _| |  _ \| __ )      =
              =      | |/ / __|/ _` | | | | |  _ \      =
              =      |   <\__ \ (_| | | |_| | |_) |     =
              =      |_|\_\___/\__, |_|____/|____/      =
              =                   |_|                   =
              =        The Database purpose-built       =
              =        for stream processing apps       =
              ===========================================

Copyright 2017-2022 Confluent Inc.

CLI v0.28.2, Server v located at http://primary-ksqldb-server:8088

WARNING: Could not identify server version. Non-matching CLI and server versions may lead to unexpected errors.

Server Status:

Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!

*****ERROR** Remote server at http://primary-ksqldb-server:8088 does not appear to be a valid KSQL server. Please ensure that the URL provided is for an active KSQL server.

The server responded with the following error: Error issuing GET to KSQL server. path:/info Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: primary-ksqldb-server/172.18.0.5:8088 Caused by: Could not connect to the server. Please check the server details are correct and that the server is running.


ksql> show topics; Error issuing POST to KSQL server. path:/ksql Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: primary-ksqldb-server/172.18.0.5:8088 Caused by: Could not connect to the server. Please check the server details are correct and that the server is running. ksql>

mdelnegro-lennd commented 11 months ago

@ybyzek, I'm trying to connect to my existing Kafka 3 node cluster(v3.4.0) which is hosted on AWS, I have added below entries at below 3 config files before docker compose up connect.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092 ksql-production-server.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092 ksql-server.properties: bootstrap.servers=X.Y.Z.I1:9092,X.Y.Z.I2:9092,X.Y.Z.I3:9092

and started ksql container as you suggested aforesaid, but getting below error (server status is unknow) and ksql commands are throwing error, plz help me on this, how to connect or config remote Kafka cluster.

ksql % docker exec -it ksqldb-cli ksql http://primary-ksqldb-server:8088

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

              ===========================================
              =       _              _ ____  ____       =
              =      | | _____  __ _| |  _ \| __ )      =
              =      | |/ / __|/ _` | | | | |  _ \      =
              =      |   <\__ \ (_| | | |_| | |_) |     =
              =      |_|\_\___/\__, |_|____/|____/      =
              =                   |_|                   =
              =        The Database purpose-built       =
              =        for stream processing apps       =
              ===========================================

Copyright 2017-2022 Confluent Inc.

CLI v0.28.2, Server v located at http://primary-ksqldb-server:8088

WARNING: Could not identify server version. Non-matching CLI and server versions may lead to unexpected errors.

Server Status:

Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!

ERROR* Remote server at http://primary-ksqldb-server:8088 does not appear to be a valid KSQL server. Please ensure that the URL provided is for an active KSQL server.

The server responded with the following error: Error issuing GET to KSQL server. path:/info Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: primary-ksqldb-server/172.18.0.5:8088 Caused by: Could not connect to the server. Please check the server details are correct and that the server is running.

ksql> show topics; Error issuing POST to KSQL server. path:/ksql Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: primary-ksqldb-server/172.18.0.5:8088 Caused by: Could not connect to the server. Please check the server details are correct and that the server is running. ksql>

same issue

MedAzizTousli commented 6 months ago

My ksqlDB server was running fine until yesterday. For some reason, I started receiving the same error. I can connect to the server using ksql host:port, and it shows the server running, but when I attempt any command, I receive a similar error to the guys above.