Newbie - Issue while running PYCassa

191 views
Skip to first unread message

hem...@snappydata.io

unread,
Apr 22, 2016, 4:50:43 AM4/22/16
to pycassa-discuss
Issue when PyCassa shell queries Cassandra. Works fine with cqlsh.

PyCassa: Latest master.
Cassandra - Same issue with both 3.0.5 and 3.5

/home/hemant/repos/pycassa>pycassaShell
[I]: IPython not found, falling back to default interpreter.
----------------------------------
Cassandra Interactive Python Shell
----------------------------------
Keyspace: None
Host: localhost:9042

ColumnFamily instances are only available if a keyspace is specified with -k/--keyspace

Schema definition tools and cluster information are available through SYSTEM_MANAGER.
>>> SYSTEM_MANAGER.create_keyspace('Keyspace1', strategy_options={"replication_factor": "1"})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/pycassa/system_manager.py", line 208, in create_keyspace
  File "build/bdist.linux-x86_64/egg/pycassa/system_manager.py", line 156, in _system_add_keyspace
  File "build/bdist.linux-x86_64/egg/pycassa/system_manager.py", line 465, in _schema_update
  File "build/bdist.linux-x86_64/egg/pycassa/cassandra/Cassandra.py", line 1646, in system_add_keyspace
  File "build/bdist.linux-x86_64/egg/pycassa/cassandra/Cassandra.py", line 1657, in recv_system_add_keyspace
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
    sz = self.readI32()
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TBinaryProtocol.py", line 206, in readI32
    buff = self.trans.readAll(4)
  File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 63, in readAll
    raise EOFError()
EOFError
>>>

/home/hemant/install/apache-cassandra-3.0.5>bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.5 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> CREATE KEYSPACE mykeyspace
   ... WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
cqlsh> describe keyspaces

system_schema  system      system_distributed
system_auth    mykeyspace  system_traces    

cqlsh>
 
What is it that I am doing wrong? Please advice.

Tyler Hobbs

unread,
Apr 22, 2016, 12:43:20 PM4/22/16
to pycassa...@googlegroups.com
First, pycassa is no longer maintained.  I recommend that you use https://github.com/datastax/python-driver, which is a modern Cassandra driver with support for CQL and the native protocol.

Second, you're using the native protocol port (9042) for pycassa instead of the thrift port (9160).

--
You received this message because you are subscribed to the Google Groups "pycassa-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pycassa-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



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