Hi,
I am trying Cassandra authentication using the sample SimpleAuthenticator and SimpleAuthority classes and also trying securing the Cassandra JMX port. Ops Center can successfully connect to and monitor a Cassandra cluster with the authentication enabled.
However there are problems running Pig against a Cassandra cluster with authentication enabled.
Looking at the Pig stack trace, we found that the SimpleAuthenticator was throwing an exception during initialisation, so we added the required JVM -D system properties to both scripts $DSE_HOME/bin/dsetool and $DSE_HOME/resources/pig/bin/pig.
JVM_OPTS="$JVM_OPTS -Dpasswd.properties=$CASSANDRA_HOME/conf/passwd.properties"
JVM_OPTS="$JVM_OPTS -Daccess.properties=$CASSANDRA_HOME/conf/access.properties"
JVM_OPTS="$JVM_OPTS -Dpasswd.mode=MD5"
That takes us further, but then it appears that the CFS custom storage handler received an exception from Cassandra when it tries to connect to the Cassandra database without supplying credentials.
Error before Pig is launched
----------------------------
ERROR 2999: Unexpected internal error. Failed to create DataStorage
java.lang.RuntimeException: Failed to create DataStorage
at org.apache.pig.backend.hadoop.datastorage.HDataStorage.init(HDataStorage.java:75)
at org.apache.pig.backend.hadoop.datastorage.HDataStorage.<init>(HDataStorage.java:58)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:206)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:119)
at org.apache.pig.impl.PigContext.connect(PigContext.java:185)
at org.apache.pig.PigServer.<init>(PigServer.java:244)
at org.apache.pig.PigServer.<init>(PigServer.java:229)
at org.apache.pig.tools.grunt.Grunt.<init>(Grunt.java:47)
at org.apache.pig.Main.run(Main.java:492)
at org.apache.pig.Main.main(Main.java:111)
Caused by: java.io.IOException: InvalidRequestException(why:You have not logged in)
at com.datastax.bdp.util.CassandraProxyClient.initialize(CassandraProxyClient.java:227)
at com.datastax.bdp.util.CassandraProxyClient.<init>(CassandraProxyClient.java:180)
at com.datastax.bdp.util.CassandraProxyClient.newProxyConnection(CassandraProxyClient.java:119)
at com.datastax.bdp.hadoop.cfs.CassandraFileSystemThriftStore.initialize(CassandraFileSystemThriftStore.java:195)
at com.datastax.bdp.hadoop.cfs.CassandraFileSystem.initialize(CassandraFileSystem.java:67)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
at org.apache.pig.backend.hadoop.datastorage.HDataStorage.init(HDataStorage.java:72)
... 9 more
Caused by: InvalidRequestException(why:You have not logged in)
at org.apache.cassandra.thrift.Cassandra$describe_keyspaces_result.read(Cassandra.java:22379)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_keyspaces(Cassandra.java:1004)
at org.apache.cassandra.thrift.Cassandra$Client.describe_keyspaces(Cassandra.java:992)
at com.datastax.bdp.util.CassandraProxyClient.initialize(CassandraProxyClient.java:213)
... 19 more
I could not find anything in Datastax documentation on how to supply credentials in Pig to connect to Cassandra. Does the current Cassandra storage handler support connecting to a secured Cassandra database? We are using DSE 2.2.1.
Thanks in advance.
Chin
