日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

java中如何合并两个网格,Hazelcast: Java分布式内存网格框架(平台)

發(fā)布時間:2025/3/15 java 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java中如何合并两个网格,Hazelcast: Java分布式内存网格框架(平台) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

轉(zhuǎn)自:http://blog.csdn.net/iihero/article/details/7385641

下邊是它的宣傳內(nèi)容:

hazelcast是一個開放源碼集群和高度可擴(kuò)展的數(shù)據(jù)分發(fā)平臺,這是為Java:

1. 快如閃電;數(shù)以千計的運(yùn)算/秒。

2. 故障安全;崩潰后沒有丟失數(shù)據(jù)。

3. 作為新服務(wù)器的動態(tài)調(diào)整 。

4. 超級簡單的使用 ,包括一個單獨的jar。

Hazelcast與各種分布式數(shù)據(jù)結(jié)構(gòu),分布式緩存功能,彈性的性質(zhì),memcache的支持,與Spring和Hibernate的集成,更重要的是這么多的快樂用戶,是功能豐富,企業(yè)的準(zhǔn)備和開發(fā)人員友好的內(nèi)存數(shù)據(jù)網(wǎng)格解決方案。

Hazelcast是一個Java的開源分布式內(nèi)存實現(xiàn),它具有以下特性:

01??? Distributed implementations of java.util.{Queue, Set, List, Map}

02??? Distributed implementation of java.util.concurrent.ExecutorService

03??? Distributed implementation of java.util.concurrency.locks.Lock

04??? Distributed Topic for publish/subscribe messaging

05??? Transaction support and J2EE container integration via JCA

06??? Distributed listeners and events

07??? Support for cluster info and membership events

08??? Dynamic HTTP session clustering

09??? Dynamic clustering

10??? Dynamic scaling to hundreds of servers

11??? Dynamic partitioning with backups

12??? Dynamic fail-over

13??? Super simple to use; include a single jar

14??? Super fast; thousands of operations per sec.

15??? Super small; less than a MB

16??? Super efficient; very nice to CPU and RAM

安裝也非常方便:

1??? Download hazelcast-version.zip from www.hazelcast.com

2??? Unzip hazelcast-version.zip file

3??? Add hazelcast.jar file into your classpath

要使用分布式的Map,只需要以下代碼即可實現(xiàn):

Hazelcast的官網(wǎng)上面有一個非常直觀的視頻:http://www.hazelcast.com/screencast.jsp,建議有興趣的朋友花10分鐘時間看看。

還有一份PDF可以參考:http://roma.javaday.it/javaday2010/sites/default/files/ClusteringHazelcast-javaday.pdf。

Hazelcast作為一款與ZooKeeper類似的開源實現(xiàn),我在網(wǎng)上找了一篇相關(guān)的文章:http://blog.armstrongconsulting.com/?p=132 在這篇文章中有一段這樣寫道:

I had occasional hangs with Hazelcast 1.8.4 which caused me to switch to Zookeeper. As expected, Zookeeper was a lot harder to use than Hazelcast – you need Zookeeper installed on 3 servers. There’s no official java client, just some recipes and I found an implementation of Zookeeper locks called Cages on google code. For a java developer, Hazelcast is obviously way easier to use.

另外,在Hazelcast的官方文檔中,提到了Hazelcast的集群機(jī)制:

If there is no existing node, then the node will be the first member of the cluster. If multicast is enabled then it will start a multicast listener so that it can respond to incoming join requests. Otherwise it will listen for join request coming via

TCP/IP

.

If there is an existing cluster already, then the oldest member in the cluster will receive the join request and check if the request is for the right group. If so, the oldest member in the cluster will start the join process.

In the join process, the oldest member will:

send the new member list to all members

tell members to sync data in order to balance the data load

Every member in the cluster has the same member list in the same order. First member is the oldest member so if the oldest member dies, second member in the list becomes the first member in the list and the new oldest member.

從上邊的文字來看,它的這種集群機(jī)制是內(nèi)置的。可以拿來直接使用。

它分好幾種版本:

hazelcast企業(yè)版

hazelcast企業(yè)版(EE)商業(yè)授權(quán)版的Hazelcast。

它有附加功能,如彈性記憶和安全。

hazelcast彈性記憶

默認(rèn)情況下,,Hazelcast商店的分布式數(shù)據(jù)(映射條目,隊列中的項目)這是垃圾收集的Java堆。

為您堆變大了,垃圾收集停頓幾十秒,嚴(yán)重影響應(yīng)用程序的性能和響應(yīng)時間可能會導(dǎo)致您的應(yīng)用程序。

彈性記憶Hazelcast離堆內(nèi)存存儲,以避免GC暫停。

即使你有TB的內(nèi)存有大量的更新緩存,GC將有幾乎沒有影響;導(dǎo)致更多的可預(yù)見的延遲和吞吐量。

安全

hazelcast安全性是基于JAAS的可插拔的安全框架,可用于驗證群集成員和客戶,做客戶端操作的訪問控制檢查。

與安全框架,采取控制誰可以是群集的一部分,或作為客戶端和業(yè)務(wù)允許或不連接。

不要讓未經(jīng)授權(quán)的當(dāng)事方接觸群集!

檢查出的

安全文件

詳細(xì)信息。

hazelcast社區(qū)版

hazelcast CE是一個開放源碼集群和高度可擴(kuò)展的數(shù)據(jù)分發(fā)平臺,為Java。

hazelcast讓你輕松跨越群集的份額和分割您的應(yīng)用程序數(shù)據(jù)。

hazelcast是一個對等的解決方案(沒有主節(jié)點,每個節(jié)點是一個對),所以不存在單點故障。

JVM的正在運(yùn)行Hazelcast的動態(tài)集群。

hazelcast是純Java是簡單,只要使用java.util中。{隊列,地圖,集,名單}。

只需添加到你的classpath hazelcast.jar開始編碼

總結(jié)

以上是生活随笔為你收集整理的java中如何合并两个网格,Hazelcast: Java分布式内存网格框架(平台)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。