-->
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.  [ 4 posts ] 
Author Message
 Post subject: small custom javafx app, ip6, vmware, cluster indexs .
PostPosted: Thu Aug 14, 2014 2:12 pm 
Newbie

Joined: Thu Aug 14, 2014 1:35 pm
Posts: 3
Hi all,

I've been working on a small office app using javafx and java 8 as well as hibernate search with infinispan and jgroups. It took embarrassing long time to get a infinispan cluster working mostly because my setup was defaulting to IPv6 and the jgroups multicast routing did not work. Another related issue was I HAD vmplayer installed and two vmnet listed when i ran ifconfig, my setup attached to the vmnets and only created clusters with ONE node.

So I removed the VM player and use -Djava.net.preferIPv4Stack=true and my clusters connect to more then one node. I have also found jconsole in the bin directory of the jdk which is nice as you can see the Mbeans and information about infinispan while your cluster is running.

Now I'm doubting my set up, as it seems most people are running a cluster of Web like servers and writings web clients for the large amount of internet users. I'm trying to use infinispan in what one youtube video called library mode. Where as each user of my small app, (dozen users) connect to cluster as slaves and one master is doing all index updates. Is this a sound architecture? What happens if that single master shuts down? Does a new on get elected? Can I fire up an new master? (my testing says, reboot all nodes and rebuild index with master in order to see inserts on all nodes)

How can I have the master rebuild the index in background and swap fresh index when complete?

Is there a way to configure hibernate to default back to slow lookups in case index or cluster communication is lost?


Sorry for so many questions in one post, questions have been pinned up for a few weeks now.

Thanks guys, I'll add what version and config files as soon as I get to work.


Here's my trouble adapter:
vmnet1 Link encap:Ethernet HWaddr 00:55:57:c1:00:01
inet addr:192.168.196.1 Bcast:192.168.196.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:333173 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


Top
 Profile  
 
 Post subject: Re: small custom javafx app, ip6, vmware, cluster indexs .
PostPosted: Thu Aug 14, 2014 3:27 pm 
Newbie

Joined: Thu Aug 14, 2014 1:35 pm
Posts: 3
Ok Heres what I'm using:

Oracle JDK 1.8.0_05

<!-- hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>4.5.1.Final</version>
</dependency>
<!-- hibernate search clustering -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-infinispan</artifactId>
<version>4.5.1.Final</version>
</dependency>


Top
 Profile  
 
 Post subject: Re: small custom javafx app, ip6, vmware, cluster indexs .
PostPosted: Fri Aug 15, 2014 6:13 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
it always is a good idea to have a single node in charge of being the "master" and be the only node in charge of indexwriting, as having multiple nodes writing at the same time leads to lock contention issues.
However the Hibernate Search library version 4.x does not implement an automatic master election protocol, if you need that level of guarantees I'd suggest you use a JMS backend: with JMS you can choose to either make messages persistent - so that when the master node is down messages aren't lost and can be processed as soon as it's restored - or you can let your JMS provider implement an highly available master.
With Hibernate Search 5 in combination with Infinispan I'm working at an automatic election protocol, but I can't promise yet as when it might be ready.

Quote:
How can I have the master rebuild the index in background and swap fresh index when complete?

Not implemented: we generally expect you to rebuild the index when it was lost, so there is no swapping logic. But even so, as soon as your index is rebuilt, queries will work again. Technically queries will work even with an incomplete index, but will return incomplete results.

Quote:
Is there a way to configure hibernate to default back to slow lookups in case index or cluster communication is lost?

What do you mean by "slow lookups"?

On the vmnet adapter, that's a question for the JGroups experts mailing list; my guess is that your routing isn't setup to multicast packets to this machine, or maybe the ip_ttl is too low? You might want to use a TCP stack rather than the default UDP, and then use a different DISCOVERY protocol than the default (which relies on multicast packets). You could use TCPPING or JDBC_PING.. I wrote JDBC_PING myself as I assume for people using Hibernate+JGroups it's handy to delegate the discovery aspect to the shared database.

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


Top
 Profile  
 
 Post subject: Re: small custom javafx app, ip6, vmware, cluster indexs .
PostPosted: Fri Aug 15, 2014 1:29 pm 
Newbie

Joined: Thu Aug 14, 2014 1:35 pm
Posts: 3
Ok thanks for the response. Seems like JMS is a more robust method, ill spend some time trying it.


Quote:
What do you mean by "slow lookups"?


I mean "slow lookups" as the frame work can resorts back to a standard database look up when the Hsearch index is lost, like in a way a date only used the column index if its build and will do a row scan if there is no index.


thanks for a great project,
brant


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.