I have done a setup of a three node Cassandra cluster. This one is on aws, and the server port are open. The three servers are well connected to each other and work perfectly. I have set
authenticator: AllowAllAuthenticator
in my cassandra.yaml
file
I would like to make the connection with go cql, here is the connection code
cluster := gocql.NewCluster("x.xxx.xxx.xxx")
cluster.Keyspace = "keyspace_name"
cluster.Consistency = gocql.Quorum
cluster.ProtoVersion = 4
cluster.ConnectTimeout = time.Second * 10
session, err := cluster.CreateSession()
if err != nil {
fmt.Println(err)
}
but go cql sends me back this message.
2020/09/26 09:53:44 gocql: unable to dial control conn x.xxx.xxx: dial tcp 127.0.0.1:9042: connectex: No connections could be made because the target machine actively refused them.
2020/09/26 09:53:44 gocql: unable to create session: control: unable to connect to initial hosts: dial tcp x.xxx.xxx.xxx:9042: connectex: No connections could be made because the target machine actively refused them.
panic: runtime error: invalid memory address or nil pointer dereference