JBoss Developer: Message List - HA-JNDI and JNDI for cluster accessMost recent forum messageshttps://developer.jboss.org/community/jbossas/clustering?view=discussionsJive Engage2007-06-29T21:21:27Z2007-06-29T21:21:27ZenRe: HA-JNDI and JNDI for cluster accessBrian Stansberry/people/brian.stansberrydo-not-reply@jboss.com2007-06-29T21:21:27Z2007-06-29T21:21:27Z<!-- [DocumentBodyStart:67c6f18a-a1c5-4213-b10c-b9a901c846d8] --><div class="jive-rendered-content"><p>There's a two stage process:<br/><br/>1) The code cycles through the list of URLs you provide, attempting to contact a server and download a naming proxy. At this point, providing mutliple URLs helps in case1, since if server1 is not available it can try server2, etc.<br/><br/>2) Once you contact a server, there's a big difference between regular JNDI and HA-JNDI. Now you have a proxy; it's the proxy that communicates with the server to do the lookup. Let's say that server1 was running. Step #1 iterates through the list in order, so server1 will provide the proxy.<br/><br/>a) With regular JNDI, the naming proxy you download will only know how to talk to the server it came from (server1). If server1 subsequently fails, the proxy can't recover; the exception propagates to your code. You can catch the exception, and do "context = new InitialContext(props)" again to recover, but you have to manage it.<br/><br/>b) With HA-JNDI, the naming proxy you download will have clustering logic and cluster topology info inside of it. It will know that server2 and server3 are all running. When you do a lookup it will load balance requests across them. If a call fails, it can transparently fail over to a different server.</p></div><!-- [DocumentBodyEnd:67c6f18a-a1c5-4213-b10c-b9a901c846d8] --><img src='/beacon?t=1550837323102' />2007-06-29T21:21:27Z11 years 8 months ago0Re: HA-JNDI and JNDI for cluster accessTarik Varli/people/timjerdo-not-reply@jboss.com2007-06-29T20:39:45Z2007-06-29T20:39:45Z<!-- [DocumentBodyStart:5d3093dd-7dbc-4136-9cf2-10f4ff286289] --><div class="jive-rendered-content"><p style="min-height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><span>"</span><a class="jive-link-email-small" href="mailto:bstansberry@jboss.com" rel="nofollow">bstansberry@jboss.com</a><span>" wrote:</span><br/>To continue your use case beyond what you wrote to include actual use of the context:<br/><br/>Object foo = context.lookup("Foo");<br/><br/>.... then server context has connected to fails or is shut down<br/><br/>Object bar = context.lookup("Bar");<br/><br/>1) With case2, the lookup of "Bar" will succeed; with case1 it will not. The case2 client side naming proxy includes clustering behavior that supports transparent failover.<br/><br/>2) In the above example, with case2 the lookups will be load balanced to the available servers; in case 1 they will all go to server1.<br/><br/><strong>Hmm? you mean in case1 only server1 aktiv? server2 and server3 will be ignored?<br/> there is not difference betwenn<br/> props.put("java.naming.provider.url", "server1:1099,server2:1099,server3:1099");<br/> and<br/> props.put("java.naming.provider.url", "server1:1099,");<br/> or sorry i don`t understand :-)</strong><br/><br/><br/><br/>3) If "Foo" were only bound in JNDI on server2, the lookup of Foo will fail in case1; with case2 the server-side HA-JNDI service on whatever server the client connects to will transparently find Foo and return it.</blockquote><br/><br/></div><!-- [DocumentBodyEnd:5d3093dd-7dbc-4136-9cf2-10f4ff286289] -->2007-06-29T20:39:45Z11 years 8 months ago0Re: HA-JNDI and JNDI for cluster accessjerrygauth/people/jerrygauthdo-not-reply@jboss.com2007-06-29T19:36:31Z2007-06-29T19:36:31Z<!-- [DocumentBodyStart:e5f443d4-0e4e-4080-adf3-529a0563f025] --><div class="jive-rendered-content"><p>JNDI (i.e., port 1099) will only perform the lookup on the local server's JNDI bindings<br/><br/>HA-JNDI (i.e., port 1100) will search the following until the requested object is located.<br/>1) the cluster's HA-JNDI bindings<br/>2) the local server's JNDI bindings<br/>3) all other cluster servers' JNDI bindings<br/><br/>Note that if you create an initial context using HA-JNDI and then bind something via that context, the binding is to HA-JNDI and is replicated across the cluster. HA-JNDI bindings are not visible to JNDI contexts (i.e., port 1099).<br/></p></div><!-- [DocumentBodyEnd:e5f443d4-0e4e-4080-adf3-529a0563f025] -->2007-06-29T19:36:31Z11 years 8 months ago0Re: HA-JNDI and JNDI for cluster accessBrian Stansberry/people/brian.stansberrydo-not-reply@jboss.com2007-06-29T19:34:38Z2007-06-29T19:34:38Z<!-- [DocumentBodyStart:4e957b45-80bb-4f19-ade4-6ab8a0a8c3c8] --><div class="jive-rendered-content"><p>To continue your use case beyond what you wrote to include actual use of the context:<br/><br/>Object foo = context.lookup("Foo");<br/><br/>.... then server context has connected to fails or is shut down<br/><br/>Object bar = context.lookup("Bar");<br/><br/>1) With case2, the lookup of "Bar" will succeed; with case1 it will not. The case2 client side naming proxy includes clustering behavior that supports transparent failover.<br/><br/>2) In the above example, with case2 the lookups will be load balanced to the available servers; in case 1 they will all go to server1.<br/><br/>3) If "Foo" were only bound in JNDI on server2, the lookup of Foo will fail in case1; with case2 the server-side HA-JNDI service on whatever server the client connects to will transparently find Foo and return it.</p></div><!-- [DocumentBodyEnd:4e957b45-80bb-4f19-ade4-6ab8a0a8c3c8] -->2007-06-29T19:34:38Z11 years 8 months ago0HA-JNDI and JNDI for cluster accessTarik Varli/people/timjerdo-not-reply@jboss.com2007-06-29T19:20:55Z2007-06-29T19:20:55Z<!-- [DocumentBodyStart:1554298d-fcd3-474c-9d8e-13d66a851885] --><div class="jive-rendered-content"><p>Hi,<br/>can anybody tell me what is difference between case1(1099) and case2(1100)?<br/>it seem both notation work for cluster-access by client.<br/><br/>thanks in advance<br/><br/>case1:<br/>Properties props = new Properties();<br/>...<br/>props.put("java.naming.provider.url", "server1:1099,server2:1099,server3:1099");<br/>context = new InitialContext(props);<br/><br/>case2:<br/>Properties props = new Properties();<br/>...<br/>props.put("java.naming.provider.url", "server1:1100,server2:1100,server3:1100");<br/>context = new InitialContext(props);</p></div><!-- [DocumentBodyEnd:1554298d-fcd3-474c-9d8e-13d66a851885] -->2007-06-29T19:20:55Z11 years 8 months ago40