hazelcast

Why hazelcast has default partition count of 271 and what are the parameters to chose one?

天大地大妈咪最大 提交于 2019-11-30 20:05:16
I just went through the hazelcast documentation. It suggests that data partitioned across all the nodes. And the number of partitions created in cluster 271 by default ! What parameters govern the selection of right partition count value. And why default partition count is 271 ? 271 is a prime number. And given any key, Hazelcast will hash the key and mod it with the partition count. In this context, prime numbers are believed to generate more pseudo-random result. Actually for user perspective, it is not that important to have it prime. Then you may ask, why 271 but not other prime number.

How to configure Hazelcast for session caching using spring while limiting it to a set of nodes?

旧街凉风 提交于 2019-11-30 16:19:22
I need to set up Hazelcast session caching using Spring. Using the configuration from the hazelcast docs is simple. However, its insufficient. I need to use a different configuration file for each one of my environments (DEV, QA, PROD). Alternatively (Ideally), I would like to use several properties from a spring bean that would be set during the initialization of the spring container. According to the hazelcast documentation, all I need to do set a group for each of my environments. like so: <hazelcast> <group> <name>dev</name> <password>dev-pass</password> </group> ... </hazelcast> As a

Hazelcast in multinode docker environments with TCPIP

孤者浪人 提交于 2019-11-30 09:43:44
I am currently struggling with the following problem: I have a Java EE application that shall be able to run in a cluster (it actually does). For the data exchange between the nodes I use Hazelcast 3.3.3. Since our customers are afraid of UDP we use TCP. So I configure 3 hazelcast parameters per node: The network interface to use, the port and the members of the cluster. In real life (not a docker environment) everything works. Now I want to put my Java EE servers into docker containers (one per node) and also link them via Hazelcast. What I did was: On the host machine running the docker

Why hazelcast has default partition count of 271 and what are the parameters to chose one?

隐身守侯 提交于 2019-11-30 04:37:36
问题 I just went through the hazelcast documentation. It suggests that data partitioned across all the nodes. And the number of partitions created in cluster 271 by default ! What parameters govern the selection of right partition count value. And why default partition count is 271 ? 回答1: 271 is a prime number. And given any key, Hazelcast will hash the key and mod it with the partition count. In this context, prime numbers are believed to generate more pseudo-random result. Actually for user

hazelcast vs ehcache

时间秒杀一切 提交于 2019-11-29 18:56:46
Question is clear as you see in the title, I would be appreciated to hear your ideas about adv./disadv. differences between them. UPDATE: I have decided to use Hazelcast because of the advantages like distributed caching/locking mechanism as well as the extremely easy configuration while adapting it to your application. Berkay We tried both of them for one of the largest online classifieds and e-commerce platform. We started with ehcache/terracotta(server array) cause it's well-known, backed by Terracotta and has bigger community support than hazelcast. When we get it on production environment

HazelCast Programmatic Configuration of Tcp-IP is no adding members in cluster

邮差的信 提交于 2019-11-29 18:06:27
Below is the HazelCast Programmatic Configuration given in Documentation but it is unable to add members in HazelCast Cluster. Config cfg = new Config(); Hazelcast.newHazelcastInstance(cfg); cfg.setProperty("hazelcast.initial.min.cluster.size","3"); cfg.getGroupConfig().setName("DEV").setPassword("DEV-pass"); NetworkConfig network = cfg.getNetworkConfig(); JoinConfig join = network.getJoin(); TcpIpConfig tcpipConfig=join.getTcpIpConfig(); tcpipConfig.addMember("172.17.153.87").addMember("10.45.67.100") .setRequiredMember("192.168.10.100").setEnabled(true); network.getInterfaces().setEnabled

How do I configure Vert.x event bus to work across cluster of Docker containers?

两盒软妹~` 提交于 2019-11-29 09:54:42
问题 In my current setup, I'm using the default multicast option of the Hazelcast cluster manager. When I link the instances of my containerized Vertx modules (via Docker networking links), I can see that they are successfully creating Hazelcast cluster. However, when I try publishing events on the event bus from one module, the other module doesn't react to it. I'm not sure how the network settings in the Hazelcast cluster related to the network settings for the event bus. At the moment, I have

记一次session获取为空的异常处理

梦想的初衷 提交于 2019-11-29 04:55:05
原本服务器端是单机tomcat运行,接口端获取请求响应的cookie中的jsessionid值作为以后请求的cookie,这样就可以使用session了 将服务器端升级成分布式的,使用hazelcast做缓存并保存session,这时候接口端请求获取session都是null 原因:Jsessionid只是tomcat的对sessionid的叫法,其实就是sessionid;在其它的容器也许就不叫jsessionid,而接口端是写死的Jsessionid=**** 查看了浏览器端的接口,响应是session=***********,意味着hazelcast获取cookie的值不是Jsessionid,而是session,cookie应该同样使用"session"做为标识 同理:如果使用其他方式保存session,需要注意sessionid的name值不能写死了,要根据响应的值,判断session标识 来源: https://my.oschina.net/u/1428688/blog/3101481

Spring Boot with Hazelcast and Tomcat

喜夏-厌秋 提交于 2019-11-29 04:47:58
How do you use Hazelcast as a http session store with embedded Tomcat with Spring Boot and Spring Security? I see there is a EmbeddedServletContainerCustomizer and SpringAwareWebFilter but I don't understand how to use it. Andy Wilkinson As described in Hazelcast's documentation , you need to configure Hazelcast's SpringAwareWebFilter and SessionListener . You can do so in Spring Boot by declaring a FilterRegistrationBean and a ServletListenerRegistrationBean respectively: @Bean public FilterRegistrationBean hazelcastFilter() { FilterRegistrationBean registration = new FilterRegistrationBean

HazelCast Programmatic Configuration of Tcp-IP is no adding members in cluster

99封情书 提交于 2019-11-28 12:49:35
问题 Below is the HazelCast Programmatic Configuration given in Documentation but it is unable to add members in HazelCast Cluster. Config cfg = new Config(); Hazelcast.newHazelcastInstance(cfg); cfg.setProperty("hazelcast.initial.min.cluster.size","3"); cfg.getGroupConfig().setName("DEV").setPassword("DEV-pass"); NetworkConfig network = cfg.getNetworkConfig(); JoinConfig join = network.getJoin(); TcpIpConfig tcpipConfig=join.getTcpIpConfig(); tcpipConfig.addMember("172.17.153.87").addMember("10