Authentication via username and password in Cassandra - cassandra

In order to create a DBLink from Oracle to Cassandra, I am trying to have a connection in Cassandra via username and password.
By default, the installation of Cassandra does not ask for username.
Searching here, I found a topic where it is described the steps for that.
unfortunately, when I modify the authenticator and authorizer parameters, the Cassandra CQL Shell opens and immediately closes.
Cassandra Installer version: datastax-ddc-64bit-3.9.0.msi
OS: Windows 7
Can someone tell me how to solve this, please?
Thank you,

To Solve CQL Shell error edit cqlshrc file.
Default location in windows is C:\Users\USER\.cassandra where USER is windows username.
In cqlshrc file edit following:
[authentication]
;; If Cassandra has auth enabled, fill out these options
username = cassandra
password = cassandra
Note cassandra is default username & password which is also a superuser.

Related

Does Cassandra 2.0.6 not support ROLE in cqlsh?

I encountered an issue with Cassandra 2.0.6.
I want to create a new role in Cassandra via cqlsh as following create role command. However, it returns Bad Request error message.
cqlsh> CREATE ROLE abc WITH SUPERUSER=true AND LOGIN=true AND PASSWORD='mypass';
Bad Request: line 1:7 no viable alternative at input 'ROLE'
I run the same command on Cassandra 2.2.x, it was good.
If anyone can help me understand the reason of it? Does Cassandra 2.0.6 not support ROLE in cqlsh?
If so, what is the alternative option?
Thank you so much!
Jun
Correct. Role Based Access Control (RBAC) was new to Cassandra in 2.2.
With 2.0, you’ll need to do a CREATE USER instead:
CREATE USER abc WITH PASSWORD='mypass' SUPERUSER;
That should work (2.0 also does not have the LOGIN option).
I answered a similar question back in the 2.0/2.1 days:
How do you create the first user in Cassandra DB

Activating the cluster in Apache Ignite

I am using Apache Ignite 2.8.0. When persistence is enabled then my server becomes Inactive. When I am trying to activate the cluster (only one server) by control.bat --activate, it asks username and password, but when I activate using code ignite.cluster().active(true); it doesn't ask.
I need an explanation why it doesn't ask username and password when I activating the cluster by code?
You can only do that from a node that's already a part of topology (obviously) and thus passed security checks.
Apache Ignite only has thin client authentication currently. If you're looking for server-server authentication, use SSL or check GridGain security plugin.

Bluemix spark-submit -- How to secure credentials needed by my Scala jar

I have a Spark application that I am submitting to the Bluemix Spark Cluster. It reads from a DASHDB database and writes the results to Cloudant. The code accesses the DASHDB using both Spark and JDBC.
The userid & password for the DASHDB database are passed as arguments to the program. I can pass these parameters via spark-submit but I don't think that would be secure. In the code I need to know the credentials of the DASHDB database because I am using JDBC to connect to various tables.
I am trying to find the "Best Practices" way to pass credentials using spark-submit in a secure manner.
Thanks in advance - John
I think the jdbc driver will always need username and password to connect to database so that is out of question as you are in multi-tenant enviornment on bluemix.
Now about spark-submit.sh to read the arguments securely, that option is not available yet.
Thanks,
Charles.
Based on the answer here, my preference would be to pass a properties file that has the credentials. Other tenants will not be able to read the properties file, but you will be able to read if from your spark application, e.g. as a dataframe spfrom which you can access the parameters.

Automate the spark submit job with DB2 connection

I have a spark job that I call with my shell scripts using the spark submit command line tool.
I need to pass the credentials for DB2 connection username and password to the jar file.
The requirement is that the username and password be not readable.
Can anyone help with this?
I would try using hadoop credential API
Hadoop has introduced keystore since version hadoop 2.6. You can pass the key store path and alias to your spark program and get the password from the keystore at run time
https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-common/CommandsManual.html#credential
Here is sample Java program
https://apache.googlesource.com/hadoop-common/+/refs/heads/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/alias/JavaKeyStoreProvider.java

Is there a way to check the selected keyspace in Cassandra?

Is there a way to check the selected keyspace in Cassandra while using it through Java?
Context:
A subsystem uses authentication credentials to select a keyspace. I'm working on a DTO that executes commands. I have a hunch that i'm operating in the wrong keyspace (commands execute successfully in DevCenter but not within the Java code).
I'm new to Cassandra and this Java application so I apologize if this is a silly question.

Resources