3 Replies Latest reply: Apr 11, 2013 12:42 PM by john dorien RSS

JNDI provider and backup servers

Alexander Hartner Expert

I would like to list all servers in the jndi provider list, as in java.naming.provider.url=jnp://10.1.40.27:1099,jnp://10.1.40.26:2099. However this requires that all hosts are primary (ie. not backup) servers. In my environment I am deploying 4 hornet instances across two servers. Each server hosts one primary (active) instance and the backup of its counterpart. This allows me to distribute work-load across two system while maintain fail-over capability.

 

Server A

Hornet A

Hornet B_BACKUP

 

Server B

Hornet B

Hornet A_BACKUP

 

I would like to be able to include all 4 servers in the list of JNDI providers, however the backup servers only become active one the primary server fail. If a client attempt to connect via JNDI to a backup server an Naming Exception is raised as the name of my connection factories and destination cannot be found as the server is still in stand-by mode.

 

Is it possible to configure the servers to only accept JNDI requests once they out of stand-by mode ?

 

If not what other alterntives are there to achieve full reduncendy and load distribution.

 

Thanks in advance

  • 1. Re: JNDI provider and backup servers
    Yong Hao Gao Master

    Re: Is it possible to configure the servers to only accept JNDI requests once they out of stand-by mode ?

     

    If a backup server becomes live, it should be able to get connected via JNDI. In other words a backup won't register its resources with JNDI unless it becomes live server.

     

    If you use a 'HA' connection factory you should get load balancing capability.

     

     

    Howard

  • 2. Re: JNDI provider and backup servers
    Alexander Hartner Expert

    My problem is that I am able to connect to the backup before it becomes alive while it is still in stand-by. In this state none of the connection factories and destinations have been deployed, and hence cannot be found. So when connected to a backup-node in stand-by state I am getting NameNotFoundExceptions.

  • 3. Re: JNDI provider and backup servers
    john dorien Newbie

    Same situation here. Need to provide JNDI names of multiple HornetQ servers (live/backup setup). But backup server accepts JNDI connections and fails to lookup resources with NameNotFoundException (because it is backup and resources are not in JDNI yet).

     

    Why does backup server even accepts JNDI connections where it is not fully started? And once it does why not to publish queues/connection factories for clients? Client can get connection factory from backup server and factory should lookup active HornerQ server (transparently to the client).

     

    @Alex: did you ever find solution to this issue?