Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create new session #283

Open
adi-kmt opened this issue Jul 18, 2024 · 4 comments
Open

Unable to create new session #283

adi-kmt opened this issue Jul 18, 2024 · 4 comments

Comments

@adi-kmt
Copy link

adi-kmt commented Jul 18, 2024

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]

@adi-kmt
Copy link
Author

adi-kmt commented Jul 18, 2024

@sylwiaszunejko
Copy link
Collaborator

Please try to use 5.4 or 6.0 scylla version

@adi-kmt
Copy link
Author

adi-kmt commented Jul 18, 2024

@sylwiaszunejko Thanks for the quick reply.
I tried with latest version 6.0.1-0.20240612.bc89aac9d017 but still getting the same error

Even nc -zv 172.17.0.2 9042 is not giving me anything

@dkropachev
Copy link
Collaborator

dkropachev commented Jul 18, 2024

@sylwiaszunejko Thanks for the quick reply. I tried with latest version 6.0.1-0.20240612.bc89aac9d017 but still getting the same error

Even nc -zv 172.17.0.2 9042 is not giving me anything

Do you mean it can't connect to the host ?

Could you please provide docker network inspect $net on the network where some-scylla is provisioned, it supposed to be bridge
It is definitely docker network environment issue.

Make sure that network addresses on docker network do not collide with addresses from your local network.
Provide more memory to the scylla:
docker run --name some-scylla -d scylladb/scylla:6.0.0 --smp 2 --memory 1024MB --developer-mode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants