-
1. Re: How to ensure failover while connecting to the endpoint of a cluster?
nadirx Mar 7, 2016 7:36 AM (in response to udit-mishra-5113a21a)You can specify multiple initial addresses from the clients, not just one.
And Apache can only load-balance HTTP, not HotRod.
-
2. Re: How to ensure failover while connecting to the endpoint of a cluster?
udit-mishra-5113a21a Mar 7, 2016 9:20 AM (in response to nadirx)Hey nadirx ,
I think something is wrong. I had two nodes, I put tejas.local.com down and then I wrote this code.
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
.host("udit.local.com")
.port(11222)
.host("tejas.local.com")
.port(11222)
.socketTimeout(10000)
.security()
.authentication()
.enable()
.serverName("CacheServer")
.saslMechanism("DIGEST-MD5")
.callbackHandler(new MyCallbackHandler("AdminUser", "ApplicationRealm", "AdminPass".toCharArray()));
It gave me "org.infinispan.client.hotrod.exceptions.TransportException: Could not fetch transport , Caused by: org.infinispan.client.hotrod.exceptions.TransportException: Could not connect to server: tejas.local.com/192.168.156.104:11222" exception after waiting for some time. But when I removed tejas.local.com, it immediately worked, stored and retrieved the key. What's wrong here? I thought If it could not reach one node, it could still connect to the cluster as udit.local.com was up.
-
3. Re: How to ensure failover while connecting to the endpoint of a cluster?
galder.zamarreno Mar 7, 2016 10:55 AM (in response to udit-mishra-5113a21a)What Infinispan version are you using? If not using latest, could you try with latest pre-release version, 8.2.0.CR1?
By default the maximum number of retries is 10, which is possibly why it takes time for the exception to be reported, but it should really try out both nodes.
If still having issues using latest pre-release version, could please you enable TRACE on org.infinispan on the client and attach the log.
Cheers
-
4. Re: How to ensure failover while connecting to the endpoint of a cluster?
udit-mishra-5113a21a Mar 8, 2016 12:38 AM (in response to galder.zamarreno)The version which I am using is the latest stable version i.e. 8.1.2
I changed the maxRetries to 1, now it takes less time, but still gives the error. Is it a known issue??
I am attaching the log file.
-
JBossClient.log.zip 897 bytes
-
-
5. Re: How to ensure failover while connecting to the endpoint of a cluster?
udit-mishra-5113a21a Mar 8, 2016 1:17 AM (in response to udit-mishra-5113a21a)Sorry galder.zamarreno , my Syntax was wrong. I forgot to chain .addServer() method while I was doing the configuration. Now it woks fine even if tejas.local.com is down.
Everything is cool, but it led me to one suspicion that suppose I have 20 nodes and I have their addresses as comma seperated values which comes from some property(dynamic, lets say a string named nodes). How would I construct the ConfigurationBuilder to take all those 20 nodes with the given syntax, even if I split the string, I can not write a loop or something. Alternatively, is there any method which takes a list of Servers ??
-
6. Re: How to ensure failover while connecting to the endpoint of a cluster?
galder.zamarreno Mar 11, 2016 9:09 AM (in response to udit-mishra-5113a21a)There's no such method at the moment, but you could send us a pull request to add it?
-
7. Re: How to ensure failover while connecting to the endpoint of a cluster?
udit-mishra-5113a21a Mar 17, 2016 2:10 AM (in response to galder.zamarreno)Hey galder.zamarreno ,
I found a method which could be helpful for me, its addServers whose syntax is -
addServers(host:port[;host:port][;host:port]);
Now, I have no issues, I can use dynamic properties.