Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

amuthan.arul_80414 avatar image
amuthan.arul_80414 asked ·

How do I authenticate using cassandra-stress with SSL enabled?

Not able to connect to cassandra stress with SSL and Authentication
but able to connect with same credential in cqlsh.

#cqlsh -u cassandra -p **************** ************ --ssl
Connected to Dev01B_Cluster at ***************************04:9042.
[cqlsh 6.8.0 | DSE 6.8.5 | CQL spec 3.4.5 | DSE protocol v2]
Use HELP for help.
cassandra@cqlsh> exit

Command used:-

cassandra-stress "write n=1k cl=ONE no-warmup" -transport "truststore=/var/ssl/client2dse/client2dse-truststore.jks truststore-password=*********** keystore=/var/ssl/client2dse/client2node-keystore.jks keystore-password=**************" -node vdldsecasdbda04 -mode native cql3 compression=none user=cassandra password=********** port=9042 auth-provider=com.datastax.driver.core.PlainTextAuthProvider


******************** Stress Settings ********************
Command:
Type: write
Count: 1,000
No Warmup: true
Consistency Level: ONE
Target Uncertainty: not applicable
Key Size (bytes): 10
Counter Increment Distibution: add=fixed(1)
Rate:
Auto: false
Thread Count: 200
OpsPer Sec: 0
Population:
Sequence: 1..1000
Order: ARBITRARY
Wrap: true
Insert:
Revisits: Uniform: min=1,max=1000000
Visits: Fixed: key=1
Row Population Ratio: Ratio: divisor=1.000000;delegate=Fixed: key=1
Batch Type: not batching
Columns:
Max Columns Per Key: 5
Column Names: [C0, C1, C2, C3, C4]
Comparator: AsciiType
Timestamp: null
Variable Column Count: false
Slice: false
Size Distribution: Fixed: key=34
Count Distribution: Fixed: key=5
Errors:
Ignore: false
Tries: 10
Log:
No Summary: false
No Settings: false
No Progress: false
Show Queries: false
Query Log File: null
File: null
Interval Millis: 1000
Level: NORMAL
Mode:
API: JAVA_DRIVER_NATIVE
Connection Style: CQL_PREPARED
CQL Version: CQL3
Protocol Version: DSE_V2
Username: cassandra
Password: *suppressed*
Auth Provide Class: com.datastax.driver.core.PlainTextAuthProvider
Max Pending Per Connection: 128
Connections Per Host: 8
Compression: NONE
Node:
Nodes: [vdldsecasdbda04]
Is White List: false
Datacenter: null
Schema:
Keyspace: keyspace1
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Strategy Options: {replication_factor=1}
Table Compression: null
Table Compaction Strategy: null
Table Compaction Strategy Options: {}
Transport:
truststore=/var/ssl/client2dse/client2dse-truststore.jks; truststore-type=null; truststore-password=**************; keystore=/var/ssl/client2dse/client2node-keystore.jks; keystore-type=null; keystore-password=**************; ssl-protocol=TLS; ssl-alg=SunX509; ssl-ciphers=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA;
Port:
Native Port: 9042
JMX Port: 7199
Send To Daemon:
*not set*
Graph:
File: null
Revision: unknown
Title: null
Operation: WRITE
TokenRange:
Wrap: true
Split Factor: 1

java.lang.RuntimeException: com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host vdldsecasdbda04/10.148.17.70:9042: Failed to login. Please re-try.
    at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:148)
    at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:116)
    at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpaces(SettingsSchema.java:66)
    at org.apache.cassandra.stress.settings.StressSettings.maybeCreateKeyspaces(StressSettings.java:156)
    at org.apache.cassandra.stress.StressAction.run(StressAction.java:57)
    at org.apache.cassandra.stress.Stress.run(Stress.java:148)
    at org.apache.cassandra.stress.Stress.main(Stress.java:67)
Caused by: com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host vdldsecasdbda04/10.148.17.70:9042: Failed to login. Please re-try.
    at com.datastax.driver.core.Connection$9.apply(Connection.java:548)
    at com.datastax.driver.core.Connection$9.apply(Connection.java:505)
    at com.google.common.util.concurrent.Futures$AsyncChainingFuture.doTransform(Futures.java:1442)
    at com.google.common.util.concurrent.Futures$AsyncChainingFuture.doTransform(Futures.java:1433)
    at com.google.common.util.concurrent.Futures$AbstractChainingFuture.run(Futures.java:1408)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:817)
    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:753)
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:613)
    at com.datastax.driver.core.Connection$Future.onSet(Connection.java:1554)
    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1307)
    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1214)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1407)
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1177)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1221)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:808)
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:474)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:370)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
cassandra-stress
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

I'm not sure how your cluster is configured but here's the command I used that works on a DSE 6.8.5 cluster with encryption enabled as per Configuring SSL for client-to-node connections:

$ cassandra-stress write n=10000 cl=ONE no-warmup \
    -node <node_ip> \
    -mode native cql3 user=<username> password=<password> \
    -transport truststore=/path/to/truststore truststore-password=<password>

It's difficult to assist you with encryption issues in a Q&A forum so if you have any follow up questions, please log a ticket with DataStax Support so one of our engineers can assist you directly. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.