Abh*_*hek 1 go cassandra gocql
尝试使用 gocql(Go:1.8.3)连接到 Cassandra(v 3.10.0)。这是错误
gocql:无法拨号控制 conn [hostIP]:gocql:超时内对连接启动没有响应
恐慌:gocql:无法创建会话:控制:无法连接到初始主机:gocql:超时内没有响应连接启动
这是代码...
func test() {
cluster := gocql.NewCluster("hostIP")
cluster.ProtoVersion = 4
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: "<username>",
Password: "<password>",
}
cluster.Keyspace = "myspace"
cluster.Consistency = gocql.One
session, err := cluster.CreateSession()
if err != nil {
panic(err)
}
defer session.Close()
}
Run Code Online (Sandbox Code Playgroud)
谁能指出我可能遗漏了什么?
| 归档时间: |
|
| 查看次数: |
2387 次 |
| 最近记录: |