为了账号安全,请及时绑定邮箱和手机立即绑定

gocql.createSession:此操作不支持一致性级别 ANY

gocql.createSession:此操作不支持一致性级别 ANY

Go
守着星空守着你 2022-05-23 18:07:37
尝试从 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.LocalQuorumclusterConfig.ConnectTimeout = time.Second * 10clusterConfig.ProtoVersion = 3clusterConfig.DisableInitialHostLookup = trueclusterConfig.Keyspace = "TestDB"clusterConfig.NumConns = 3session, err := clusterConfig.CreateSession()if err != nil {fmt.Println("err>", err)}return session我将一致性级别设置为LocalQuorum,但仍然给出上述错误。如果有人知道如何解决,请帮助我们
查看完整描述

1 回答

?
qq_花开花谢_0

TA贡献1835条经验 获得超7个赞

包升级对我有用!



查看完整回答
反对 回复 2022-05-23
  • 1 回答
  • 0 关注
  • 139 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信