Reputation: 57
I am finding difficulty while setting up Riak Kv Cluster setup using java client.
Can anybody tell how we do that??
Achually i tried with below code to use riak security in cluster but i am getting error of SSLEngine Problem, can anybody tell how we resolve this issues.
Below is java Code for Refference
InputStream inputStream = null;
KeyStore ks = null;
try {
// inputStream = new FileInputStream("/ssl_dir/cacertfile.pem");
inputStream = new FileInputStream("/home/shahzad/Desktop/amit/rootCA.pem");
// Generate an X509Certificate from the InputStream
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
X509Certificate caCert = (X509Certificate) certFactory.generateCertificate(inputStream);
inputStream.close();
// Generate a KeyStore object
ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null, "password".toCharArray());
ks.setCertificateEntry("cacert", caCert);
} catch (Exception e) {
e.printStackTrace();
}
synchronized (RiakConfig.class) {
List<RiakNode> riakNodeList = new ArrayList<RiakNode>();
for (final String riakServer : riakServerArray) {
RiakNode node = new RiakNode.Builder()
.withMinConnections(10)
.withMinConnections(50)
.withRemoteAddress(riakServer.split(":")[0])
.withRemotePort(
Integer.parseInt(riakServer.split(":")[1]))
.withAuth("shahzad", "shahzad", ks)
.build();
riakNodeList.add(node);
}
// This cluster object takes our one node as an argument
cluster = new RiakCluster.Builder(riakNodeList).build();
// The cluster must be started to work, otherwise you will see
// errors
cluster.start();
}
Tell one thing..... how we access security enable Riak KV remotely.
Upvotes: 0
Views: 32
Reputation: 9
Please check, if you enable security at Riak KV cluster and added client source
riak-admin security add-source all <<127.0.0.1/32>> trust
The IP address belongs to the client machine from where the connection will originate
Upvotes: 0