TransportException Cannot connect

601 views
Skip to first unread message

alexandr.porunov@gmail.com

<alexandr.porunov@gmail.com>
unread,
Sep 7, 2016, 3:16:01 AM9/7/16
to ScyllaDB users
Hello,

I have configured scylla and wrote a simple Java client with "datastax java driver" but it can't connect to the cluster.
It shows:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [com/fyfine/loader/configuration/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.driver.core.Session]: Factory method 'cassandraSession' threw exception; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.0.61:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.61:9042] Cannot connect), /192.168.0.62:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.62:9042] Cannot connect), /192.168.0.64:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.64:9042] Cannot connect), /192.168.0.65:9042 [only showing errors of first 3 hosts, use getErrors() for more details])

Cluster is running.
Also I can connect localy with "cqlsh 127.0.0.1 9042" but I can not connect remotely "cqlsh 192.168.0.61 9042". It shows:

Connection error: ('Unable to connect to any servers', {'192.168.0.61': error(111, "Tried connecting to [('192.168.0.61', 9042)]. Last error: Connection refused")})

I configured 6 nodes. 3 in each DC.
I configured "listen_address" to a public ip of each machine (eth0).

Here is parameters from scylla.yaml of machine 192.168.0.61. All hosts have the same scylla.yaml configuration except "listen_address" parameter:

Here is "nodetool status" output:
Datacenter: USA_east_1
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  192.168.0.61  514.36 KB  256     ?       dc49641d-5e26-4559-993b-cea28765f72f  rack1
UN  192.168.0.62  370.99 KB  256     ?       d24bb17f-c2a7-47d7-8d7a-eaac7b3895b3  rack1
UN  192.168.0.63  417.6 KB   256     ?       812cec5c-ec7a-49b4-8eb1-2d28754b362a  rack2
Datacenter: EU_east_1
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  192.168.0.64  441.18 KB  256     ?       73e23ef2-c5c6-45e7-98d5-5e1be0488007  rack1
UN  192.168.0.65  424.29 KB  256     ?       9af52b2d-a42c-4380-b15c-934bcd5a478b  rack1
UN  192.168.0.66  405.53 KB  256     ?       11eed44b-bc20-4b2e-a915-4f79b32c91b5  rack2

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

What am I missing?

Sincerely,
Alexandr

Asias He

<asias@scylladb.com>
unread,
Sep 7, 2016, 3:23:36 AM9/7/16
to ScyllaDB users
On Wed, Sep 7, 2016 at 3:16 PM, <alexandr...@gmail.com> wrote:
Hello,

I have configured scylla and wrote a simple Java client with "datastax java driver" but it can't connect to the cluster.
It shows:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [com/fyfine/loader/configuration/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.driver.core.Session]: Factory method 'cassandraSession' threw exception; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.0.61:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.61:9042] Cannot connect), /192.168.0.62:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.62:9042] Cannot connect), /192.168.0.64:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.0.64:9042] Cannot connect), /192.168.0.65:9042 [only showing errors of first 3 hosts, use getErrors() for more details])

Cluster is running.
Also I can connect localy with "cqlsh 127.0.0.1 9042" but I can not connect remotely "cqlsh 192.168.0.61 9042". It shows:

Connection error: ('Unable to connect to any servers', {'192.168.0.61': error(111, "Tried connecting to [('192.168.0.61', 9042)]. Last error: Connection refused")})

I configured 6 nodes. 3 in each DC.
I configured "listen_address" to a public ip of each machine (eth0).


If you want the cql clients to connect to your scylla server with public ip address, you can configure "rpc_address" to your server's public ip address.

What does 

sudo netstat -natlp|grep 9042

say. 
 

Here is parameters from scylla.yaml of machine 192.168.0.61. All hosts have the same scylla.yaml configuration except "listen_address" parameter:

Here is "nodetool status" output:
Datacenter: USA_east_1
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  192.168.0.61  514.36 KB  256     ?       dc49641d-5e26-4559-993b-cea28765f72f  rack1
UN  192.168.0.62  370.99 KB  256     ?       d24bb17f-c2a7-47d7-8d7a-eaac7b3895b3  rack1
UN  192.168.0.63  417.6 KB   256     ?       812cec5c-ec7a-49b4-8eb1-2d28754b362a  rack2
Datacenter: EU_east_1
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  192.168.0.64  441.18 KB  256     ?       73e23ef2-c5c6-45e7-98d5-5e1be0488007  rack1
UN  192.168.0.65  424.29 KB  256     ?       9af52b2d-a42c-4380-b15c-934bcd5a478b  rack1
UN  192.168.0.66  405.53 KB  256     ?       11eed44b-bc20-4b2e-a915-4f79b32c91b5  rack2

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

What am I missing?

Sincerely,
Alexandr

--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-users+unsubscribe@googlegroups.com.
To post to this group, send email to scylladb-users@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/a75bec1e-6e66-45c8-aa3c-ee99e30e0869%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Asias
Message has been deleted

alexandr.porunov@gmail.com

<alexandr.porunov@gmail.com>
unread,
Sep 7, 2016, 5:46:35 AM9/7/16
to ScyllaDB users
Thank you!

I don't know why it doesn't work with "rpc_interface" but when I set "rpc_address" to node ip it become work.

Sincerely,
Alexandr

Asias He

<asias@scylladb.com>
unread,
Sep 7, 2016, 6:06:26 AM9/7/16
to scylladb-users@googlegroups.com

On Sep 7, 2016 5:46 PM, <alexandr...@gmail.com> wrote:
>
> Thank you!
>
> I don't know why it doesn't work with "rpc_interface" but when I set "rpc_address" to node ip it become work.

Good to know it worked for you.

Scylla currently  does not surrport the _interface option.

>
> Sincerely,
> Alexandr
>
> --
> You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.

> To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
> To post to this group, send email to scyllad...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/f9ee987f-3374-4c94-baa6-00e3816a58c9%40googlegroups.com.

Pekka Enberg

<penberg@scylladb.com>
unread,
Sep 7, 2016, 12:09:45 PM9/7/16
to ScyllaDB users, Alexandr Porunov, Asias He, Avi Kivity
On Wed, Sep 7, 2016 at 12:46 PM, <alexandr...@gmail.com> wrote:
> I don't know why it doesn't work with "rpc_interface" but when I set
> "rpc_address" to node ip it become work.

It's a known issue:

https://github.com/scylladb/scylla/issues/1058

We should remove references to 'rpc_interface' from scylla.yaml until
that issue is fixed.
Reply all
Reply to author
Forward
0 new messages