【问题标题】:gocql.createSession: Consistency level ANY is not supported for this operationgocql.createSession:此操作不支持一致性级别 ANY
【发布时间】:2020-07-23 00:15:22
【问题描述】:

尝试从 cql 创建会话时出现以下错误,

Error: 
Consistency level ANY is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE

我使用过 Amazon Managed Apache Cassandra 服务

以下是创建会话的代码

clusterConfig := gocql.NewCluster("<HOST:PORT>")
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: "Username", Password: "Password"}
clusterConfig.SslOpts = &gocql.SslOptions{
CaPath: "./AmazonRootCA1.pem",
}
clusterConfig.Consistency = gocql.LocalQuorum
clusterConfig.ConnectTimeout = time.Second * 10
clusterConfig.ProtoVersion = 3
clusterConfig.DisableInitialHostLookup = true
clusterConfig.Keyspace = "TestDB"
clusterConfig.NumConns = 3
session, err := clusterConfig.CreateSession()
if err != nil {
fmt.Println("err>", err)
}
return session

我将一致性级别设置为 LocalQuorum,但仍然给出上述错误。如果有人知道如何解决,请帮助我们

【问题讨论】:

  • 尝试更新你的 gocql 依赖。 17 天前,一个相关的 fix 被合并到 master。
  • @mkopriva 在做
  • @mkopriva 包升级成功。谢谢。

标签: amazon-web-services go cassandra gocql amazon-keyspaces


【解决方案1】:

包升级对我有用!

【讨论】:

    猜你喜欢
    • 2020-09-27
    • 2020-12-02
    • 2020-07-11
    • 2021-01-22
    • 1970-01-01
    • 1970-01-01
    • 2023-01-14
    • 1970-01-01
    • 2020-11-07
    相关资源
    最近更新 更多