Hi all!

I am using org.apache.cassandra.auth.SimpleAuthenticator to use
authentication in my cluster with one node (with cassandra 0.6.1). I have
put:
<Authenticator>org.apache.cassandra.auth.SimpleAuthenticator</Authenticator>
in storage-conf.xml file, and:
keyspace=username
in access.properties file, and:
username=password
in passwd.properties file.
When I try to use cassandra client I am using:
./cassandra-cli --host localhost --port 9160 --username username --password
password --keyspace keyspace --debug
and it returns this:

org.apache.thrift.TApplicationException: Internal error processing login
at
org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
at
org.apache.cassandra.thrift.Cassandra$Client.recv_login(Cassandra.java:300)
at org.apache.cassandra.thrift.Cassandra$Client.login(Cassandra.java:282)
at org.apache.cassandra.cli.CliMain.connect(CliMain.java:109)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:239)
Login failure. Did you specify 'keyspace', 'username' and 'password'?

When I try the same process with Java Thrift API:

TTransport tr = new TSocket(ip, port);
static Cassandra.Client client = new Cassandra.Client(new
TBinaryProtocol(tr));
Map<String, String> credentials = new HashMap<String, String>();
credentials.put(SimpleAuthenticator.USERNAME_KEY, username);
credentials.put(SimpleAuthenticator.PASSWORD_KEY, password);
try {
tr.open();
client.login(KEY_SPACE, new AuthenticationRequest(credentials));
catch{...}
..

I get:

org.apache.thrift.TApplicationException: Internal error processing login
at
org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
at
org.apache.cassandra.thrift.Cassandra$Client.recv_login(Cassandra.java:300)
at org.apache.cassandra.thrift.Cassandra$Client.login(Cassandra.java:282)

...

What I am doing wrong?

Reply via email to