我曾尝试通过使用合流的zip/tar文件安装ksql服务器和客户端来创建流,结果成功了。例如,下面日志中的create stream语句使用ksql-cli运行良好。
但当我使用以下链接docker-compose up
启动ksql服务器时https://ksqldb.io/quickstart.html(通过关闭以前的ksql服务器(它在下面给出了错误,可能是因为这个原因,ksqlcli没有使用docker exec -it ksqldb-cli ksql http://0.0.0.0:8088
连接到ksql服务器,并给出了错误Couldn't connect to the KSQL server: KSQL is not yet ready to serve requests.
ksqldb-server | [2021-01-12 17:16:05,182] ERROR Failed to handle: Command{statement='CREATE STREAM persons (version int, id int, type string, data string) WITH (kafka_topic='prod.trail', value_format='json');', overwriteProperties={}, version=Optional.empty} (io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor:214)
ksqldb-server | io.confluent.ksql.util.KsqlException: This version of ksqlDB does not support executing statements submitted prior to ksqlDB 0.8.0 or Confluent Platform ksqlDB 5.0. Please see the upgrading guide to upgrade.
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.throwUnsupportedStatementError(InteractiveStatementExecutor.java:309)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.executeStatement(InteractiveStatementExecutor.java:279)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.handleStatementWithTerminatedQueries(InteractiveStatementExecutor.java:212)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.handleRestore(InteractiveStatementExecutor.java:135)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.lambda$null$3(CommandRunner.java:276)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:89)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:60)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:41)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.lambda$processPriorCommands$4(CommandRunner.java:272)
ksqldb-server | at java.base/java.lang.Iterable.forEach(Iterable.java:75)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.processPriorCommands(CommandRunner.java:269)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.initialize(KsqlRestApplication.java:437)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.startKsql(KsqlRestApplication.java:367)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.startAsync(KsqlRestApplication.java:350)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlServerMain.tryStartApp(KsqlServerMain.java:91)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlServerMain.main(KsqlServerMain.java:66)
ksqldb-server | [2021-01-12 17:16:05,183] ERROR Exception encountered running command: This version of ksqlDB does not support executing statements submitted prior to ksqlDB 0.8.0 or Confluent Platform ksqlDB 5.0. Please see the upgrading guide to upgrade.. Retrying in 5000 ms (io.confluent.ksql.util.RetryUtil:106)
ksqldb-server | [2021-01-12 17:16:05,183] ERROR Stack trace: io.confluent.ksql.util.KsqlException: This version of ksqlDB does not support executing statements submitted prior to ksqlDB 0.8.0 or Confluent Platform ksqlDB 5.0. Please see the upgrading guide to upgrade.
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.throwUnsupportedStatementError(InteractiveStatementExecutor.java:309)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.executeStatement(InteractiveStatementExecutor.java:279)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.handleStatementWithTerminatedQueries(InteractiveStatementExecutor.java:212)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.handleRestore(InteractiveStatementExecutor.java:135)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.lambda$null$3(CommandRunner.java:276)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:89)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:60)
ksqldb-server | at io.confluent.ksql.util.RetryUtil.retryWithBackoff(RetryUtil.java:41)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.lambda$processPriorCommands$4(CommandRunner.java:272)
ksqldb-server | at java.base/java.lang.Iterable.forEach(Iterable.java:75)
ksqldb-server | at io.confluent.ksql.rest.server.computation.CommandRunner.processPriorCommands(CommandRunner.java:269)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.initialize(KsqlRestApplication.java:437)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.startKsql(KsqlRestApplication.java:367)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlRestApplication.startAsync(KsqlRestApplication.java:350)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlServerMain.tryStartApp(KsqlServerMain.java:91)
ksqldb-server | at io.confluent.ksql.rest.server.KsqlServerMain.main(KsqlServerMain.java:66)
ksqldb-server | (io.confluent.ksql.util.RetryUtil:110)
ksqldb-server | [2021-01-12 17:16:10,184] ERROR Failed to handle: Command{statement='CREATE STREAM persons (version int, id int, type string, data string) WITH (kafka_topic='prod.trail', value_format='json');', overwriteProperties={}, version=Optional.empty} (io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor:214)
ksqldb-server | io.confluent.ksql.util.KsqlException: This version of ksqlDB does not support executing statements submitted prior to ksqlDB 0.8.0 or Confluent Platform ksqlDB 5.0. Please see the upgrading guide to upgrade.
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.throwUnsupportedStatementError(InteractiveStatementExecutor.java:309)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.executeStatement(InteractiveStatementExecutor.java:279)
ksqldb-server | at io.confluent.ksql.rest.server.computation.InteractiveStatementExecutor.handleStatementWithTerminatedQueries(InteractiveStatementExecutor.java:212)
ksqldb-server |
我对kafka/ksql完全陌生。在网上找不到太多运气。有人能帮忙吗?
在新的安装中,如果Docker Compose版本和下载的归档文件之间没有任何共享数据,我预计不会发生这种情况。您是否正在连接到现有Kafka集群?
Docker镜像使用KSQLdb独立服务器,这是一个比与Confluent Platform捆绑的服务器更新的版本。这可能是您看到有关版本问题的错误的原因。
这里有一个升级指南,但如果你只是在玩示例数据,你会想清理使用的主题。