Hi,
Aerospike Enterprise version
As far as I know one can create a client as follows that works
import com.aerospike.spark.sql._
import com.aerospike.client.AerospikeClient
import com.aerospike.client.Bin
import com.aerospike.client.Key
import com.aerospike.client.Value
import com.aerospike.client.AerospikeClient
import com.aerospike.client.Host
import com.aerospike.client.policy.ClientPolicy
var hosts = {
new Host("rhes75", 3000)
}
val policy = new ClientPolicy()
policy.user = dbConnection
policy.password = dbPassword
val client = new AerospikeClient(policy, hosts)
val TEST_COUNT = 100
for (i <- 1 to TEST_COUNT) {
val key = new Key(namespace, "spark-test", "spark-test-"+i)
client.put(null, key,
new Bin("one", i),
new Bin("two", "two:"+i),
new Bin("three", i.toDouble)
)
}
sys.exit()
However, I have no way passing user credential when I am doing bulk write using a dataframe
df.write.
mode(SaveMode.Overwrite).
format("com.aerospike.spark.sql").
option("aerospike.namespace", namespace).
option("aerospike.set", dbSet).
option("aerospike.updateByKey", "id").
option("aerospike.keyColumn", "__id").
option("aerospike.batchMax", 5000).
option("aerospike.keyPath", "/etc/aerospike/features.conf").
save()
when I turn off security in conf file this works fine. Otherwise I get the following error:
Caused by: com.aerospike.client.AerospikeException$Connection: Error -8: Failed to connect to host(s): rhes75 3000 Error 80: not authenticated
Any ideas how this can be done with user authentication
Thanks,
Mich