Package gocql implements a fast and robust Cassandra client for the Go programming language.
Zariel on master
conn: send heartbeats to detect… (compare)
tls.Config
and not a pointer to one? Passing it like this will copy the mutex in the tls.Config
's sync.Once by value.
Hi, I am new to golang and gocql. I have question and can't find way to resolve the connection issue.
Currently I am using cassandra 2.1.5.
cluster := gocql.NewCluster(".....")
cluster.Keyspace = "production"
session, _ := cluster.CreateSession()
then I got error message like ;
panic: no valid connect address for host: [HostInfo connectAddress="<nil>" peer="<nil>" rpc_address="<nil>" broadcast_address="<nil>" preferred_ip="<nil>" connect_addr="0.0.0.0" connect_addr_source="invalid" port=9042 data_centre="datacenter1" rack="rack1" host_id="*" version="v2.1.5" state=UP num_tokens=1]. Is your cluster configured correctly?
When I test this code with cassandra 3.1 , it works but 2.1.5 it doesn't
system.local's schema is different between two versions and I think it cause the problem.
Is there any way to resolve this ?
I am getting following error while trying to create session from cql,
"Consistency level ANY is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE"
I am using "Amazon Managed Apache Cassandra Service".
I have set following properties,
clusterConfig := gocql.NewCluster("<HOST>")
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
Hello! I was looking at the BatchObserver for gocql and came across this in the comments:
https://github.com/gocql/gocql/blob/34081eda590e85c1fdbd412012340d9ee2cf3aff/session.go#L2007
It says that this is called for every query in the batch. I just wanted to clarify whether it is the BatchObserver thats called for each query, or the QueryObserver?