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

create the session but output no connections were made when creating the session #1020

Open
imxyb opened this issue Nov 17, 2017 · 8 comments

Comments

@imxyb
Copy link

imxyb commented Nov 17, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

i use the scylladb 2.0 that is run on docker

What version of Gocql are you using?

latest

What did you do?

`
cluster := gocql.NewCluster("47.100.xxx.xx")
cluster.Keyspace = "test"
cluster.Consistency = gocql.Quorum
session, err := cluster.CreateSession()

if err != nil {
	log.Fatal(err)
}

`

What did you expect to see?

the sesssion created

What did you see instead?

but session is nil, the err is output no connections were made when creating the session

Describe your Cassandra cluster

i only has one node in the cluster

  • output of nodetool status
    Datacenter: datacenter1
    =======================
    Status=Up/Down
    |/ State=Normal/Leaving/Joining/Moving
    -- Address Load Tokens Owns (effective) Host ID Rack
    UN 172.17.0.2 120.77 KB 256 100.0% f8e2341a-52b4-459f-8887-127e80e29197 rack1

my scylladb can execute cqlsh and run normally

how to solve this problem?thanks

@iamanarchist
Copy link

I had the same issue with Cassandra 3.11.1. The server is single node in GCE, and I have configured the config as follows:

listen_address = localhost
rpc_address = 0.0.0.0
broadcast_rpc_address = <public_ip>

When using cqlsh to connect to the server remotely (via its public IP), everything works fine. However gocql will always report "no connections were made when creating the session".

I later found out it was trying to connect to my local development Cassandra server because it complains about missing keyspace even though I give the remote server IP...

Please advise. Thanks!

@thiagomorales
Copy link

thiagomorales commented Nov 27, 2017

I have same issue using last gocql version using:

const CqlHost = "34.xxx.xxx.xxx" // public IP - cqlsh connection works

cluster := gocql.NewCluster(CqlHost)
cluster.Keyspace = CqlClusterKeyspace
Session, err = cluster.CreateSession()

Using an older version of gocql (from backup) it works like a charm..
I didn't received any error about missing keyspace, but even passing Cassandra host server to NewCluster, looks like gocql ignores it completely..

@Zariel
Copy link
Contributor

Zariel commented Jan 12, 2018 via email

@abhirockzz
Copy link

abhirockzz commented Feb 2, 2018

Facing the same issue.. Any resolution yet ? nodetool status returns the internal IP of the VM where Cassandra is running. gocql fails but I am able to connect successfully using the Cassandra Java driver. gocql_debug gives me unable to dial "<internal VM IP>": dial tcp <internal VM IP>:9042: i/o timeout

@abhirockzz
Copy link

ok.. finally resolved this by setting DisableInitialHostLookup to true

@evildecay
Copy link
Contributor

This option has an impact on cluster performance, so this option should not be used in a production environment.

        // If DisableInitialHostLookup then the driver will not attempt to get host info
	// from the system.peers table, this will mean that the driver will connect to
	// hosts supplied and will not attempt to lookup the hosts information, this will
	// mean that data_centre, rack and token information will not be available and as
	// such host filtering and token aware query routing will not be available.
	DisableInitialHostLookup bool

@Emixam23
Copy link

Emixam23 commented Dec 3, 2019

Same issue.. Any workaround? I've just install Cassandra with brew and tried to connect from official doc with golang.. So I don't see at all right now what can be the issue

@martin-sucha
Copy link
Contributor

I don't have enough information to reproduce the issue. At the first look it seems that this could be related to configuration of the cluster. Note that cqlsh connects to a single node directly by default, while gocql discovers all the nodes it should connect to.

Please provide contents of system.local and system.peers tables and output when you compile gocql with gocql_debug tag.

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

No branches or pull requests

8 participants