You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Subodh Nijsure <su...@gmail.com> on 2014/08/10 14:04:33 UTC

Unable to connect to cassandra server on EC2?

Hello,


I have setup a new EC2 instance to run cassandra on EC2, have gone
through bunch of questions that don't seem to help. I am running
apache-cassandra-2.1.0-rc3

I have opened port 9160, 9042 on my EC2 instance say its IP address is 1.2.3.4

Since this is single node system I haven't opened other ports as pointed in

http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMISecurityGroup.html

When I try to connect to this host using the python driver with
cluster config like this:

cluster = Cluster(contact_points=['1.2.3.4',], port=9160)

I am getting error:

 File "....cluster.py", line 1649, in _reconnect_internal
    raise NoHostAvailable("Unable to connect to any servers", errors)
cassandra.cluster.NoHostAvailable: ('Unable to connect to any
servers', {'1.2.3.4': error(111, 'Connection refused')})

Any ideas on what incantation I need to have in cassandra.yml file to
allow external clients to connect cassandra instance running on EC2 ?

-Subodh

Re: Unable to connect to cassandra server on EC2?

Posted by Subodh Nijsure <su...@gmail.com>.
Thanks Mark, indeed changing port to 9042 worked.

In addition I set following parameters in my cassandra.yaml

rpc_address: 0.0.0.0
broadcast_rpc_address: 1.2.3.4 ( External IP address of my EC2 machine)

Regards,
-Subodh Nijsure


On Sun, Aug 10, 2014 at 6:13 AM, Mark Reddy <ma...@boxever.com> wrote:
> Hi,
>
> While I have no direct experience with the Python driver itself I took a
> quick and it uses Cassandra's native transport protocol, so setting the port
> to 9160 (Thrift protocol) won't work. You will need to set it to the native
> transport port, which is 9042.
>
> Also make sure that you have the rpc_address (and if needed
> broadcast_rpc_address) set correctly.
>
> On a side note, if you are trying out 2.1.0, 2.1.0-rc5 is out and with many
> fixes and improvements.
>
>
> Mark
>
>
> On Sun, Aug 10, 2014 at 1:04 PM, Subodh Nijsure <su...@gmail.com>
> wrote:
>>
>> Hello,
>>
>>
>> I have setup a new EC2 instance to run cassandra on EC2, have gone
>> through bunch of questions that don't seem to help. I am running
>> apache-cassandra-2.1.0-rc3
>>
>> I have opened port 9160, 9042 on my EC2 instance say its IP address is
>> 1.2.3.4
>>
>> Since this is single node system I haven't opened other ports as pointed
>> in
>>
>>
>> http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMISecurityGroup.html
>>
>> When I try to connect to this host using the python driver with
>> cluster config like this:
>>
>> cluster = Cluster(contact_points=['1.2.3.4',], port=9160)
>>
>> I am getting error:
>>
>>  File "....cluster.py", line 1649, in _reconnect_internal
>>     raise NoHostAvailable("Unable to connect to any servers", errors)
>> cassandra.cluster.NoHostAvailable: ('Unable to connect to any
>> servers', {'1.2.3.4': error(111, 'Connection refused')})
>>
>> Any ideas on what incantation I need to have in cassandra.yml file to
>> allow external clients to connect cassandra instance running on EC2 ?
>>
>> -Subodh
>
>

Re: Unable to connect to cassandra server on EC2?

Posted by Mark Reddy <ma...@boxever.com>.
Hi,

While I have no direct experience with the Python driver itself I took a
quick and it uses Cassandra's native transport protocol, so setting the
port to 9160 (Thrift protocol) won't work. You will need to set it to the
native transport port, which is 9042.

Also make sure that you have the rpc_address (and if needed
broadcast_rpc_address) set correctly.

On a side note, if you are trying out 2.1.0, 2.1.0-rc5 is out and with many
fixes and improvements.


Mark


On Sun, Aug 10, 2014 at 1:04 PM, Subodh Nijsure <su...@gmail.com>
wrote:

> Hello,
>
>
> I have setup a new EC2 instance to run cassandra on EC2, have gone
> through bunch of questions that don't seem to help. I am running
> apache-cassandra-2.1.0-rc3
>
> I have opened port 9160, 9042 on my EC2 instance say its IP address is
> 1.2.3.4
>
> Since this is single node system I haven't opened other ports as pointed in
>
>
> http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMISecurityGroup.html
>
> When I try to connect to this host using the python driver with
> cluster config like this:
>
> cluster = Cluster(contact_points=['1.2.3.4',], port=9160)
>
> I am getting error:
>
>  File "....cluster.py", line 1649, in _reconnect_internal
>     raise NoHostAvailable("Unable to connect to any servers", errors)
> cassandra.cluster.NoHostAvailable: ('Unable to connect to any
> servers', {'1.2.3.4': error(111, 'Connection refused')})
>
> Any ideas on what incantation I need to have in cassandra.yml file to
> allow external clients to connect cassandra instance running on EC2 ?
>
> -Subodh
>