gocqlx
gocqlx copied to clipboard
Unable to create new session
I'm running the docker command
docker run --name some-scylla -d scylladb/scylla:5.2.0 --smp 2 --memory 200MB --developer-mode 1
When I try cqlsh it says connected to 172.17.0.2:9042
.
But when I try
SELECT peer, preferred_ip, rpc_address FROM system.peers; peer | preferred_ip | rpc_address ------+--------------+-------------
So completely empty.
When I try to run
retryPolicy := &gocql.ExponentialBackoffRetryPolicy{
Min: time.Second,
Max: 30 * time.Second,
NumRetries: 5,
}
cluster := gocql.NewCluster("172.17.0.2")
cluster.Keyspace = keyspace
cluster.Timeout = 2 * time.Minute
cluster.RetryPolicy = retryPolicy
cluster.Consistency = consistency
cluster.ProtoVersion = 4
// cluster.Port = 9042
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: "cassandra",
Password: "cassandra",
}
session, err := gocql.NewSession(*cluster)
And it fails at this point Have tried changing config as much as I can from stackoverflow posts, but not getting it to work
Error is
2024/07/18 16:46:04 gocql: unable to dial control conn 172.17.0.2:9042: dial tcp 172.17.0.2:9042: i/o timeout
2024/07/18 16:46:04 unable to connect to scyllagocql: unable to create session: unable to connect to initial hosts: dial tcp 172.17.0.2:9042: i/o timeout
The logs in docker logs is
INFO 2024-07-18 11:52:48,308 [shard 0:stmt] cql_server_controller - Starting listening for CQL clients on 172.17.0.2:9042 (unencrypted, non-shard-aware)
INFO 2024-07-18 11:52:48,308 [shard 0:stmt] cql_server_controller - Starting listening for CQL clients on 172.17.0.2:19042 (unencrypted, shard-aware)
INFO 2024-07-18 11:52:48,308 [shard 0:main] standard_role_manager - Created default superuser role 'cassandra'.
Versions
[cqlsh 5.0.1 | Cassandra 3.0.8 | CQL spec 3.3.1 | Native protocol v4 | Scylla 5.2.0]