Database Reference
In-Depth Information
Note that because the user Elvis Presley has a space in his username, a backslash must be used
to escape the space.
To use the Simple Authenticator, replace the value for the authenticator element in cas-
sandra.yaml. Change it from org.apache.cassandra.auth.AllowAllAuthenticator to the
name
of
the
implementing
class
that
requires
a
login:
org.apache.cassandra.auth.SimpleAuthenticator .
If you haven't configured the authentication files properly, you'll see an error like this:
ERROR 10:44:27,928 Fatal error: When using org.apache.cassandra.auth.SimpleAuth
enticator
access.properties and passwd.properties properties must be defined.
That's because there is one more step: we have to tell Cassandra the location of the access and
passwords files, using the bin/cassandra.in.shinclude script. We pass the file locations to the
JVM by pasting the following code at the bottom of this file. My include file now looks like the
snippet here, indicating the full path to the files:
JVM_OPTS="
-Dpasswd.properties=/home/eben/books/cassandra/dist/
apache-cassandra-0.7.0-beta1/
conf/passwd.properties
-Daccess.properties=/home/eben/books/cassandra/dist/
apache-cassandra-0.7.0-beta1/
conf/access.properties"
If you have specified an incorrect location or name for either of these files, the server log will let
you know:
ERROR 11:13:55,755 Internal error processing login
java.lang.RuntimeException: Authentication table file given by property
passwd.properties
could not be found: /somebadpath/my.properties (No such file or directory)
Now we can log into the command-line interface with a username and password combination:
[default@unknown] connect localhost/9160
Connected to: "Test Cluster" on localhost/9160
[default@unknown] use Keyspace1 jsmith 'havebadpass'
Authenticated to keyspace: Keyspace1
[jsmith@Keyspace1]
If you enter an incorrect password, the CLI tells you:
Search WWH ::




Custom Search