hazelcast-原版文档


-
Hazelcast 是面向 Java 的缓存、集群及数据分发解决方案。特性包括:提供java.util.{Queue,Set,List,Map}分布式实现。提供java.util.concurrency.locks.Lock分布式实现
Table of contents Introduction I.I. Getting Started (Tutorial) 2. Distributed Data structu 2.1. Distributed Queue 2. 2. Distributed Topic........... 2.3. Distributed map… 2. 1. Backups 2.3.2.EⅤ iction. 456789 2.3.3. Persistence 2.3.4. Query.... 2. 3.5. Near Cache 13 2.3.6. Entry Statistics ·· 2.3.7.Ind 15 2. 4. Distributed MultiMap......... 15 2.5. Distributed set 2. 6. Distributed list 16 2.7. Distributed lock 16 2. 8. Distributed events 17 3. Elastic Memory (Enterprise Edition Only) .· 18 4. Security (Enterprise Edition Only) 19 19 42. Cluster module 20 4.3. Cluster Member Security 4. 4. Native client st 4. 4.1. Authentication 22 4. 4.2. Authorization 4.4.3. Permissions∴ 24 5. Data Affinity ·········“····· ··“········*····· 申非 ·······*···· 28 6. Monitoring with JMX 7. Cluster Utilities 7.1. Cluster Interface 33 7. 2. Cluste Generator 7.3. LiteMember……… 33 8. Transactions 34 8. 1. Transaction Interface 8.2.J2 FE Integration….… 8.2.1. Resource Adapter Configuration 35 8.2.2. Sample glassfish v3 Web Application Configuration 36 8.2.3. Sample JBoss Web Application Configuration 36 9. Distributed Executor 37 9. 1. Distributed execution ..37 9. 2. Execution Cancellation 38 93. Exccution Callback 39 10. Ittp s Clustering with hlazelcastwm 11. WAN Rep 44 12. Configuration 46 12. 1. Creating Separate Cluste 47 12.2. Network Configuration 48 12.2. 1. Configuring TCP/IP Cluster 48 12. 2. 2. Specifying Network Interfaces 48 12.2.3. EC2 Auto dise 12.2.4. Network Partitioning(Split-Brain Syndrome) 49 12.2.5.SSL 12.2.6.EI 52 12.2.7.S ntercept Hazelcast documentation 12. 2.8. IPv6 Support 12.3. Partition group configuration 55 12.4. Listener Configurations…… 56 12.5. Wildcard Configuration 12.6. Advanced Configuration Properties 60 12.7, Logging Configuration…… 62 12.8 Setting License Key (Enterprise Edition Only 63 13. Hibernate Second Level Cache 14. Spring Integration ........ 7 14. 1. Configuration 67 14.2. Spring Managed Context 69 14.3. Spring cache… 14.4. Hibernate2 nd Level Cache Config…..,..,.,,…,… 14.5. Spring data-JPA 14.6. Spring Data-MongoDB 15. Clients∴ i5. Native client 75 76 15.1.2. CSharp Client (Entcrprise Edition Only) .76 15,2, Memcache client∴…………78 15.3. Rest client∴ 79 16. Internals 16.1. Internals 2. serialization 80 16.2. Internals 3: Cluster Membership 8 16.3. Internals4: Distributed Map…… 82 17. Management Center…,……,… 17.1. Introduction 17.1.1. Installatic ············· 17. 1.2. User Administration 17.13. Tool Overview 17. 2. Maps 85 17.2.1. Monitoring Maps 85 17.2.2. Map Browser 86 Map configuration… 86 17.3. Queues 86 17.4. Topics.…,…,…,…,,…,…,87 I7. 5. Members +++++ 87 ng 88 17.5.2. Operations… 88 17.6. System Logs… 88 17.7. Scripting 89 17. 8. Time travel 89 17.9. Console 18. Miscellaneous 18.1. Common Gotchas 18.2. Testing Cluster 18.3. Planned Features 95 18.4. Release notes 1V List of tables 12. 1. Properties Table Chapter 1 Introduction Hazelcast is a clustering and highly scalable data distribution platform for Java. Hazelcast helps architects and developers to easily design and develop faster, highly scalable and reliable applications for their businesses Distributed implementations of java.util.Queuer Set, list, Nap) Distributed implementation of java. util. concurrent. ExecutorService Distributed implementation of java. util. concurrency. locks.Lock Distributed Topic for publish/ subscribe messaging Transaction support and J2EE container integration via JCA Distributed listeners and events Support for cluster info and membership events Dynamic Http session clustering Dynamic clustering Dynamic scaling to hundreds of servers Dynamic partitioning with backups Dynamic fail-over Super simple to use, include a single jar Super fast: thousands of operations per sec Super small; less than a mB Super efficient: very nice to CPU and RaM To install hazelcast: Downloadhazelcast-version.zipfromwww.hazelcast.com[http://www.hazelcast.com] Unzip hazelcast- version. zip file Add hazelcast jar file into your classpath Hazelcast is pure Java JVMS that are running Hazelcast will dynamically cluster. Although by default hazelcast will use multicast for discovery, it can also be configured to only use TCP/IP for environments where multicast is not available or preferred ( Click here for more info). Communication among cluster members is always TCP/IP with Java NIO beauty Default configuration comes with 1 backup so if one node fails, no data will be lost. It is as simple as usingjava. util [Queue, Set, List, Map). Just add the hazelcast. jar into your classpath and start coding 1.1. Getting Started (Tutorial) In this short tutorial, we will create simple Java application using Hazelcast distributed map and queue. Then we will run our application twice to have two nodes (Jvms)clustered and finalize this tutorial with connecting to our cluster from another Java application by using Hlazelcast Native Java Client API DownloadthelatestHazelcastzip[http://www.hazclcast.com/downloads.jsp] Unzip it and add the lib/hazelcast. jar to your class path. Introduction Create a Java class and import hazelcast libraries Following code will start the first node and create and use customers map and queue. import com. hazelcas-. core. Hazelcasti import java. util. Map; import java.util. Queue public class GettingStarted I public static void main(string[] args)( Map<Integer, String> mapCustomers Ilazelcast getMap("customers") na cUstomers put(,"Joe") mapCustomers.put(2,Ali)i mapCustomers. put(,Avi )i printin("Customer with key cUstomers get(1))i out println(Map Size: mapCustomers size())i QueuecString> queueCustomers Hazelcast getQueue("customers") of=er("Tom queueCustomers.ofFer("Mary)i queueCus omers of=er("Jane")i System. out. println("First customer: -queueCustomers poll())i System. out. println("Second customer queueCust omers peek()) System. out. println(Queue size: queueCustomers size()) Run this class second time to get the second node started Have you seen they formed a cluster? You should see something like this Members [2]t Member[127.0.0.1:5701] Member[127.0.0.1:5702]this Connecting hazelcast Cluster with Java Client API Besides hazelcast. jar you should also add hazelcast-client. jar to your classpath Following code will start a llazelcast Client, connect to our two node cluster and print the size of our customers a package com. hazelcast cesti import com. hazelcast,client. ClientCon-igi import com. hazelcast. client. Hazelcastclient import com. hazelcas= core. Hazelcastinstance import com. hazelcast. core. IMap; public class GetingStartedclient public static void main(String[] args)( ClientConfig client Config= new ClientConfig()i clien-Config. addAddress("127.0.0. 1: 5701) Ha.zelcastInstance client HazelcastClient newHazeicastC-ient(clientconfig) IMap map- client getMap("customers") System. out. println('May Size: I map size())i When you run it, you will see the client properly connects to the cluster and print the map size as 3 Introduction What is Next? Youcanbrowsedocumentation[http://www.hazelcast.com/docs.jspandresourcesfordetailedfeaturesandexamples YoucanemailyourquestionstoHazelcastmailgroup[http:iigroups.googlecom/group/hazelcast] YoucanbrowseHazelcastsourcecode[http:icode.google.com/p/hazelcast/source/browse/#svn/trunk] Chapter 2. Distributed Data Structures Common Features of all hazelcast data Structures Data in the cluster is almost evenly distributed (partitioned) across all nodes. So each node carries(1/n* total-data)+ backups, n being the number of nodes in the cluster If a member goes down, its backup replica that also holds the same data, will dynamically redistribute the data including the ownership and locks on them to remaining live nodes. As a result, no data will get lost When a new node joins the cluster, new node takes ownership(responsibility) and load of-some -of the entire data n the cluster. Eventually the new node will carry almost(1/n total-data)+ backups and becomes the new partition reducing the load on others There is no single cluster master or something that can cause single point of failure. Every node in the cluster has equal rights and responsibilities. No-one is superior and no dependency on external 'serveror master kind of concept Here is how you can retrieve existing data structure instances(map, queue, set, lock, topic, etc )and how you can listen for instance events to get notified when an instance is created or destroyed import ava. util. Collectioni Hazelcast import ccm, hazelcast core Ins tance; import ccm. hazelcast. core. Instancelistener public class sample implements Instancelistener I public static void main(String[] args)( e azelcast. addInstancelistener(sample)i Collection<Instance> instances Haze_cast. getIrstances(i for (Instance instance System. out.printin(instance. getInstanceType()+ ,"+ instance getId() public void instanceCreated(InstanceEvent evert)( Instance instance event getinstance(i System. cut. println("Created t instance. getTrstanceType()t t instance getTo() ublic void d(TnstanceFvent event) i Instance instance event getInstance( System. out. println(" Destroyed instance getIrstancelype()+",+ instance. ge=Id()i 2.1. Distributed Queue Hazelcast distributed queue is an implementation ofjava.util. concurrent. BlockincQueue import ava.util. concurrent. BlockingQueu BlockingQueue<MyTask> q= Hazeicast. getQueue("tasks")i g put (new MyTask()) take( boolean c=fered- g c=fer(new MyTask(), 15, TimeUrit SECONDS)i cas< =gpoll(5, TimeUnit SECONDS )i f(t 4 Distributed Data Structures If you have 10 million tasks in yourtasks"queue and you are running that code over 10 JVMs(or servers ), then each server carries 1 million task objects(plus backups ). FIFO ordering will apply to all queue operations cluster-wide User objects(such as My k in the example above), that are(en/de)queued have to beserializable Maximum capacity per JVM and the ttl (Time to Live) for a queue can be configured Distributed queues are backed by distributed maps. Thus, queues can have custom backup counts and persistent storage Hazelcast will generate cluster-wide unique id for each element in the queue Sample configuration hazelcast> <queue name="tasks"> MaximUm e of the queue. When a UVM's Iocal queue size reaches the maximun, ail put/offer operations will get blocked until the queue size of the uvM goes down below the maximum Any integer bet ween s and Integer. MAX VALUF. 0 means Integer. MAX VATUF. De fault is o ize-per-ivm>10000</max-size-per-ivm> ame of the map configuration that will be used for the backing distributed mao Iar this queue ret queue> t>l</backup-cou <map-store enabled="true"> <class-name >com. your, company. storage. DBMapStore</class-name> <write-delay-seconds></write-de lay-secords> </map-store> </hazelcast> If the backing map has no map-etore defined then your distributed queue will be in-memory only If the backing map has a map-store defined then Hazelcast will call your Map Store implementation to persist queue elements. Even if you reboot your cluster Hazelcast will rebuild the queue with its content. When implementing a Mapstore for the backing map, note that type of the key is always Long and values are the elements you place into the queue. So make sure Mapstore loadAllKeys returns Set<long> for instance To learn about wildcard configuration feature see wildcard Configuration page. 2.2. Distributed Topic Hazelcast provides distribution mechanism for publishing messages that are delivered to multiple subscribers which is also known as publish/subscribe (pub/sub) messaging model Publish and subscriptions are cluster-wide. When a member subscribes for a topic, it is actually registering for messages published by any member in the cluster, including the new members joined after you added the listener. Messages are ordered, meaning, listeners( subscribers ) will process the messages in the order they are actually published. If cluster member M publishes messages ml, m2, m3. mn to topic T, then hazelcast makes sure that all of the subscribers of topic t will receive and process ml, m2, m3.mn in order. Therefore there is only single thread invoking onMessage. The user shouldn 't keep the thread busy and preferably dispatch it via an executor This will increase the performance of the topic

-
2014-07-16
高并发下的Nginx性能优化实战
2019-12-24<p> <b><span style="background-color:#FFE500;">【超实用课程内容】</span></b> </p> <p> <br /> </p> <p> <br /> </p> <p> 本课程内容包含讲解<span>解读Nginx的基础知识,</span><span>解读Nginx的核心知识、带领学员进行</span>高并发环境下的Nginx性能优化实战,让学生能够快速将所学融合到企业应用中。 </p> <p> <br /> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><br /> </b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><span style="background-color:#FFE500;">【课程如何观看?】</span></b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> PC端:<a href="https://edu.csdn.net/course/detail/26277"><span id="__kindeditor_bookmark_start_21__"></span></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 移动端:CSDN 学院APP(注意不是CSDN APP哦) </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 本课程为录播课,课程永久有效观看时长,大家可以抓紧时间学习后一起讨论哦~ </p> <p style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <br /> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <strong><span style="background-color:#FFE500;">【学员专享增值服务】</span></strong> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b>源码开放</b> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 下载方式:电脑登录<a href="https://edu.csdn.net/course/detail/26277"></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a>,播放页面右侧点击课件进行资料打包下载 </p> <p> <br /> </p> <p> <br /> </p> <p> <br /> </p>
Java学习指南(Java入门与进阶)
2017-08-09<p> 这是Java学习指南系列课程的第1篇,介绍Java语言的入门语法,引领希望学习Java语言编程的初学者进入Java大门。 </p> <p> 本课程不需要其他语言作为基础,可以直接学习。 </p> <p> 课程从Java开发平台的下载和安装开始,从浅到深、从易到难,循序渐进地进行语法讲解。 </p> <p> 为了让学员更好的掌握Java语言,本课程配套在线的Java题库及答案解析。 </p> <p> 相比于其他语言,Java语言更科学、更容易掌握,快来和大家一起学习Java吧。 </p>
Mysql数据库基础入门视频教程
2018-10-24Mysql数据库基础入门视频课程:属于零基础Mysql数据库教程,从数据库的基本专业术语介绍到数据库软件的下载使用 一步一步带你安装MySql。SQL阶段你将学会如果使用数据定义语言DDL,数据操作语言DML,数据查询语言DQL 在学会各中查询语句之后,会带你学习数据的完整性, 掌握如果正确的向数据库中添加数据 以上掌握技能之后,将会带你学习如何进行多表操作,关系的建立,各种连接查询等. 常用函数,事务的学习,您将学到什么是事务的提交,回滚,并发操作及脏读,幻读. 最后视图,存储过程,索引的学习,将会带你掌握更高级的数据库技术.
基于SSM技术的在线商城系统[实战视频]
2018-07-04本课程基于【SSM】【Maven】【BootStrap】【MySQL】【BootStrap】技术,使用IntelliJ IDEA开发工具。 主要是锻炼SSM技术的运用,通过项目实战,加强对框架技术的理解和运用,如果你是SSM的初学者,这套视频课程适合你!!
Python金融数据分析入门到实战
2019-09-26<p> <strong><span style="font-size:16px;color:#003399;">会用Python分析金融数据 or 金融行业会用Python</span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;">职场竞争力更高</span></strong> </p> <p> <br /> </p> <p> <img src="https://img-bss.csdnimg.cn/202012231042221925.png" alt="" /> </p> <p> <br /> </p> <p> <br /> </p> <p> <strong><span style="font-size:16px;color:#003399;">Python金融数据分析入门到实战</span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;">Get√金融行业数据分析必备技能</span></strong> </p> <p> <img src="https://img-bss.csdnimg.cn/202012231042438069.png" alt="" /> </p> <p> <br /> </p> <p> <br /> </p> <p> <strong><span style="font-size:16px;color:#003399;">以股票量化交易为应用场景</span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;">完成技术指标实现的全过程</span></strong> </p> <p> <br /> </p> <p> <span style="font-size:14px;">课程选取股票量化交易为应用场景,由股票数据的获取、技术指标的实现,逐步进阶到策略的设计</span><span style="font-size:14px;">和回测,由浅入深、由技术到思维地为同学们讲解Python金融数据分析在股票量化交易中的应用</span><span style="font-size:14px;">。</span> </p> <p> <br /> </p> <p> <span style="font-size:14px;"><br /> </span> </p> <p> <img src="https://img-bss.csdnimg.cn/202012231043183686.png" alt="" /> </p> <p> <br /> </p> <p> <br /> </p> <p> <strong><span style="font-size:16px;color:#003399;">以Python为编程语言</span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;">解锁3大主流数据分析工具</span></strong> </p> <p> <br /> </p> <p> <span style="font-size:14px;">Python做金融具有先天优势,课程提取了Python数据分析工具NumPy、Pandas及可视化工具</span><span style="font-size:14px;">Matplotlib的关键点详细讲解,帮助同学掌握数据分析的关键技能。</span> </p> <p> <img src="https://img-bss.csdnimg.cn/202012231043472858.png" alt="" /> </p> <p> <strong><span style="font-size:16px;color:#003399;"><br /> </span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;">2大购课福利</span></strong> </p> <p> <strong><span style="font-size:16px;color:#003399;"><br /> </span></strong> </p> <p> <img src="https://img-bss.csdnimg.cn/202012300628195864.png" alt="" /> </p>
Javascript前端开发
2018-03-14JavaScript一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,内置支持类型。它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用于客户端的脚本语言,早是在HTML(标准通用标记语言下的一个应用)网页上使用,用来给HTML网页增加动态功能。
-
下载
82案例实战:陌生人社交APP的MySQL索引设计实战(二).pdf
82案例实战:陌生人社交APP的MySQL索引设计实战(二).pdf
-
下载
06 生产经验:互联网公司的生产环境数据库是如何进行性能测试的.pdf
06 生产经验:互联网公司的生产环境数据库是如何进行性能测试的.pdf
-
下载
107 透彻研究通过explain命令得到的SQL执行计划(8).pdf
107 透彻研究通过explain命令得到的SQL执行计划(8).pdf
-
下载
66 不断在表中插入数据时,物理存储是如何进行页分裂的?l.pdf
66 不断在表中插入数据时,物理存储是如何进行页分裂的?l.pdf
-
下载
86以MySQL单表查询来举例,看看执行计划包含哪些内容(1)?.pdf
86以MySQL单表查询来举例,看看执行计划包含哪些内容(1)?.pdf
-
下载
85提纲挈领的告诉你,SQL语句的执行计划和性能优化有什么关系?.pdf
85提纲挈领的告诉你,SQL语句的执行计划和性能优化有什么关系?.pdf
-
下载
南山铝业:山东南山铝业股份有限公司2020年年度报告.PDF
南山铝业:山东南山铝业股份有限公司2020年年度报告.PDF
-
下载
驰宏锌锗:驰宏锌锗2020年年度报告.PDF
驰宏锌锗:驰宏锌锗2020年年度报告.PDF
-
下载
105 透彻研究通过explain命令得到的SQL执行计划(6).pdf
105 透彻研究通过explain命令得到的SQL执行计划(6).pdf
-
下载
13 从磁盘读取数据页到Buffer Pool的时候,free链表有什么用.pdf
13 从磁盘读取数据页到Buffer Pool的时候,free链表有什么用.pdf
