ok. in this case you need to provide details about your environment and topology. clearly setPublicAddress("0.0.0.0")
is wrong.
the question is: what should be there instead? (if anything at all)
here is what I know so far:
is :point_up: correct?
setPublicAddress()
sets an IP address others should use to talk to this member. this is usually needed when you have multiple networks and what not.0.0.0.0
which CANNOT ever be used to talk to this member. The address 0.0.0.0
has a special meaning in IP networks.
join.getTcpIpConfig().setEnabled(true).setMembers(Arrays.asList(environment));
for this joiner you have to know all IP addresses anyway.setPublicAddress("127.0.0.1")
will work only on a single box. again, remove that. most likely you dont need at all.
Config config = new Config();
config.setLiteMember(false);
JoinConfig join = config.getNetworkConfig().getJoin();
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(true)
.setProperty("tag-key", "my-ec2-instance-tag-key")
.setProperty("tag-value", "my-ec2-instance-tag-value");
CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
cacheConfig.setName("buckets");
config.addCacheConfig(cacheConfig);
HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);
ICacheManager cacheManager = hazelcastInstance.getCacheManager();
Cache<String, GridBucketState> cache = cacheManager.getCache("buckets");
return cache;
that looks fine to me.
some notes: config.setLiteMember(false);
is redundant as that's the default.
depending on your deployment scheme you might want to store hazelcastInstance
somewhere and shut it down when your application is about to shutdown. this is mostly concern if you deploy to an app server with multiple tenants (applications). If you are using something like Spring Boot (or appserver-less deployment in general) then it's usually not a concern.
Config config = new Config();
config.setLiteMember(false);
System.out.println( Arrays.asList(environment).toString());
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getAwsConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).setMembers(Arrays.asList("172.323.24.130","896.341.438.65"));
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(true)
.setProperty("tag-key", "Name1")
.setProperty("tag-value", " api-1")
.setProperty("access-key","1")
.setProperty("secret-key","1");
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(true)
.setProperty("tag-key", "Name2")
.setProperty("tag-value", " api-2")
.setProperty("access-key","2")
.setProperty("secret-key","2");
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(true)
.setProperty("tag-key", "Name2")
.setProperty("tag-value", " api-2")
.setProperty("access-key","2")
.setProperty("secret-key","2");
Hello everyone,
I am from Hazelcast development team and I am trying to learn more about How People Use Hazelcast.
One of the Hazelcast painpoints is reliance on Java bytecode.
Example: IMap Entry Processors are awesome, they can often replace a complicated locking schema, increase both reliability and performance.
However they have one downside: They require bytecode to be available on each member classpath. This is usually not a issue if you are embedding Hazelcast inside your application. But It could be a problem in the client-server topology when your app uses a remote cluster. In this case you have to either distribute JARs with Entry Processors to all cluster members or use User Code Deployment.
I have 2 different questions is:
I will be grateful for any feedback, thank you!
Hi everyone,
We just introduced Hazelcast Guides with ~10 min. guides on Hazelcast integrations with Springboot, Quarkus, Micronaut, Microprofile, Kubernetes, Istio, and more! Check it out at https://guides.hazelcast.org