Is there a way to authenticate to cassandra using the new cassandra-stress tool released with cassandra 2.1? It appears as if the '-un' (username) and '-pw' (password) switches have been removed from the tool.

In the 2.0 version, this is the command I would run: 'cassandra-stress -D nodesfile -un -pw '

The 2.1 version has been totally reworked, and that command fails completely. Looking through the documentation reveals nothing about authenication to the database. Google searches have turned up nothing since it's so new.

I did try one suggestion about putting authentication information into ~/.cassandra/cqlshrc

This seems to work for the cqlsh tool, but not for cassandra-stress. Any suggestions would be greatly appreciated. Thanks!


It seems that it's been moved to the -mode option.

Try cassandra-stress -mode user=username password=password.

  • Thanks so much! Note, -mode option has required parameters like thrift, native, simplenative cql2 cql3 cassandra-stress help -mode Usage: -mode thrift [smart] [user=?] [password=?] OR Usage: -mode native [unprepared] cql3 [compression=?] [port=?] [user=?] [password=?] [auth-provider=?] OR Usage: -mode thrift [unprepared] cql3 [compression=?] [port=?] [user=?] [password=?] [auth-provider=?] OR Usage: -mode simplenative [prepared] cql3 [port=?] OR Usage: -mode thrift cql2 [prepared] user=? username password=? password unprepared force use of unprepared statements compression=? (default=none) por – Shuo Jun 17 '15 at 20:41

The correct parameters are:

cassandra-stress [command] -node [nodes] -mode thrift user=[user] password=[password]

thrift is the default protocol, connecting to port 9160 on your nodes. The list of nodes should be separated by commas.


There are many modes possible

-mode thrift [smart] [user=?] [password=?]
-mode native [unprepared] cql3 [compression=?] [port=?] [user=?] [password=?] [auth-provider=?] [maxPending=?] [connectionsPerHost=?] [protocolVersion=?]
-mode simplenative [prepared] cql3 [port=?]

I used this one, because it is giving quite some flexibility

/opt/cassandra/tools/bin/cassandra-stress write -mode native cql3 compression=none user=username password=user_password port=9042 auth-provider=com.datastax.driver.core.PlainTextAuthProvider

You can pass your nodes with the argument -node. I logged into one of the Cassandra-node ( part of Kubernetes cluster ) and directly run the stress test.

Complete documentation - https://docs.datastax.com/en/dse/6.7/dse-dev/datastax_enterprise/tools/toolsCStress.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.