cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chamila Wijayarathna <>
Subject Accesing Cassandra Database which uses 'PasswordAuthenticator' in Java
Date Tue, 10 Feb 2015 20:24:08 GMT
Hello all,

I changed the authenticator value of my Cassandra database to
'PasswordAuthenticator' in cassandra.yaml file. Previously I used following
code to connect to the database using java.

public void connect(String node) {

      cluster = Cluster.builder()


      Metadata metadata = cluster.getMetadata();

      System.out.printf("Connected to cluster: %s\n",


      for ( Host host : metadata.getAllHosts() ) {

         System.out.printf("Datatacenter: %s; Host: %s; Rack: %s\n",

               host.getDatacenter(), host.getAddress(), host.getRack());


      session = cluster.connect();


Now this code gives me error saying

Exception in thread "main"
com.datastax.driver.core.exceptions.AuthenticationException: Authentication
error on host / Host / requires authentication, but no
authenticator found in Cluster configuration

I understand that I need to connect to the database with my super user
username and password. How can I give those details when connecting to
database using java?
Thank You!
*Chamila Dilshan Wijayarathna,*
Department of Computer Science and Engineering,
University of Moratuwa.

View raw message