2

I have configured Hazelcast in my application and deployed it in glassfish, and tested it with ome simple methods in a REST service.

Now I want to install it in my servers as a Linux Service, to start running when the servers start, and I want to my glassfish application to be able to recognize this service and read or set variables in my map, using distributed lock.

How can I achieve this?

mtvec
  • 17,846
  • 5
  • 52
  • 83

1 Answers1

3

You can create an init.d script to start Hazelcast node and use HazelcastClient in your application to connect to Hazelcast node.

Look at an answer to a similar question:

Hazelcast dedicated nodes

And blog post about starting standalone nodes;

Hazelcast: Starting standalone Hazelcast nodes

To connect Hazelcast node using HazelcastClient in your app deployed to Glassfish;

ClientConfig config = new ClientConfig();
config.getNetworkConfig().addAddress("localhost");
HazelcastInstance client = HazelcastClient.newHazelcastClient(config);
Map map = client.getMap("map");
Community
  • 1
  • 1
mdogan
  • 1,929
  • 14
  • 15