pycassa: remote accessing of cassandra issue

34 views
Skip to first unread message

Nagarjuna Avula

unread,
Jan 17, 2014, 2:06:58 AM1/17/14
to pycassa...@googlegroups.com
Hi all ,
i am new to cassandra and pycass below is my code to connect to cassandra database

import pycassa
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily

pool = ConnectionPool('my_keyspace', ['192.168.3.14:9160'])  # it works well
pool = ConnectionPool('my_keyspace', ['192.168.3.14:9160'])  # it is not working for the remote system

col_fam = ColumnFamily(pool, 'blog_entry')
col_fam.get('yomama')


for the localhost it is working and for the remote ip's i am getting the below error
Traceback (most recent call last):
  File "F:\ZONE-Applications\DjangoProjects\Python Coding\pycassa\pycassa1.py", line 6, in <module>
    ['192.168.3.14:9160'])
  File "C:\Python27\lib\site-packages\pycassa-1.11.0-py2.7.egg\pycassa\pool.py", line 382, in __init__
    self.fill()
  File "C:\Python27\lib\site-packages\pycassa-1.11.0-py2.7.egg\pycassa\pool.py", line 442, in fill
    conn = self._create_connection()
  File "C:\Python27\lib\site-packages\pycassa-1.11.0-py2.7.egg\pycassa\pool.py", line 431, in _create_connection
    (exc.__class__.__name__, exc))
AllServersUnavailable: An attempt was made to connect to each of the servers twice, but none of the attempts succeeded. The last failure was TTransportException: Could not connect to 192.168.3.14:9160

please some body help me to resolve this

Tyler Hobbs

unread,
Jan 17, 2014, 12:09:43 PM1/17/14
to pycassa...@googlegroups.com

On Fri, Jan 17, 2014 at 1:06 AM, Nagarjuna Avula <nagarjun...@gmail.com> wrote:


pool = ConnectionPool('my_keyspace', ['192.168.3.14:9160'])  # it works well
pool = ConnectionPool('my_keyspace', ['192.168.3.14:9160'])  # it is not working for the remote system

Is that a typo, or are you opening two different ConnectionPools to the same address?


--
Tyler Hobbs
DataStax
Reply all
Reply to author
Forward
0 new messages