-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Search in Windows Azure
PostPosted: Tue Jan 21, 2014 2:56 pm 
Newbie

Joined: Tue Jan 21, 2014 2:53 pm
Posts: 3
I have a Worker Role in Windows Azure where I run a Java application. In order to do not affect the SLA, we need to have at least two instances of this worker role. I'm using Hibernate Search 3.4 in this Java application and the lucene indexes are being saved in filesystem, so when one instance modifies an index the other is not aware of that. What do you recommend to have synchonized indexes? I guess I can save indexes in the blob storage or use a JMS Master/slave configuration but I do not know how I can do it.


Top
 Profile  
 
 Post subject: Re: Hibernate Search in Windows Azure
PostPosted: Wed Jan 22, 2014 4:50 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I'm not too familiar with what options you have on Azure. It might provide alternative queue implementations "as a service" ?
It's pretty easy to extend the pattern we made for JMS to use a different messaging strategy.

I wouldn't mind playing with Azure to help with this, but you'd need to update the the very latest version of Hibernate Search (and Hibernate ORM) for that to be helpfull to you, as 3.4 is quite old and whatever advice I'd come up with will probably not apply on that.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search in Windows Azure
PostPosted: Wed Jan 29, 2014 3:10 pm 
Newbie

Joined: Tue Jan 21, 2014 2:53 pm
Posts: 3
Thank you, Sanne.

I'm playing with JGroups Master/Slave configuration in Azure.
Because Azure doesn't support IP Multicasting, I'm using TCP instead.
The problem now is that only the slave server doesn't have an updated copy of the indexes.

My current JGroups TCP configuration is:

Code:
<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-2.8.xsd">
    <TCP bind_port="9700"
         loopback="true"
         recv_buf_size="${tcp.recv_buf_size:20M}"
         send_buf_size="${tcp.send_buf_size:640K}"
         discard_incompatible_packets="true"
         max_bundle_size="64K"
         max_bundle_timeout="30"
         enable_bundling="true"
         use_send_queues="true"
         sock_conn_timeout="300"
         timer.num_threads="4"
         
         thread_pool.enabled="true"
         thread_pool.min_threads="1"
         thread_pool.max_threads="10"
         thread_pool.keep_alive_time="5000"
         thread_pool.queue_enabled="false"
         thread_pool.queue_max_size="100"
         thread_pool.rejection_policy="discard"

         oob_thread_pool.enabled="true"
         oob_thread_pool.min_threads="1"
         oob_thread_pool.max_threads="8"
         oob_thread_pool.keep_alive_time="5000"
         oob_thread_pool.queue_enabled="false"
         oob_thread_pool.queue_max_size="100"
         oob_thread_pool.rejection_policy="discard"/>
                         
    <TCPPING timeout="3000"
             initial_hosts="${jgroups.tcpping.initial_hosts:SERVER-A[9700],SERVER-B[9701]}"
             port_range="1"
             num_initial_members="2"/>
    <MERGE2  min_interval="10000"
             max_interval="30000"/>
    <FD_SOCK/>
    <FD timeout="3000" max_tries="3" />
    <VERIFY_SUSPECT timeout="1500"  />
    <BARRIER />
    <pbcast.NAKACK
                   use_mcast_xmit="false" gc_lag="0"
                   retransmit_timeout="300,600,1200,2400,4800"
                   discard_delivered_msgs="true"/>
    <UNICAST timeout="300,600,1200" />
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                   max_bytes="400K"/>
    <pbcast.GMS print_local_addr="true" join_timeout="3000"

                view_bundling="true"/>
    <FC max_credits="2M"
        min_threshold="0.10"/>
    <FRAG2 frag_size="60K"  />
    <pbcast.STREAMING_STATE_TRANSFER/>
    <!-- <pbcast.STATE_TRANSFER/> --> 
</config>


Am I missing something?


Top
 Profile  
 
 Post subject: Re: Hibernate Search in Windows Azure
PostPosted: Wed Jan 29, 2014 4:20 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
there are two aspects to a clustered index:
- forwarding the changes from each node to the master
- synchronizing the index from the master to the other nodes

My guess is that you've setup a JGroups based backend - probably even succesfully - but didn't setup a replication strategy for the index?

To replicate the index you have various options:
- use the Master/Slave DirectoryProvider(s)
- use Infinispan to have real-time sharing

The Master/Slave approach requires a shared drive, so that Hibernate Search can coordinate writing and reading to this shared space. Snapshots are replicated periodically.

The Infinispan approach is more interesting as it allows real time replication, and Infinispan runs on JGroups.. so assuming you have learned how to get JGroups to work in your environment already, this is probably your best bet.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search in Windows Azure
PostPosted: Tue Feb 04, 2014 6:26 pm 
Newbie

Joined: Tue Jan 21, 2014 2:53 pm
Posts: 3
I used 'Infinispan' as directory provider. Because Azure doesn't support UDP multicasting, I used TCPPing as JGroups discovery method.

It works now!

Thank you, Sanne!


Top
 Profile  
 
 Post subject: Re: Hibernate Search in Windows Azure
PostPosted: Tue Feb 04, 2014 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Great!
thanks for letting me know, it's nice to know that Azure works as well :-)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.