Support Hazelcast on Manual and Auto Cluster
Currently our Autoclustr sets up the JGroups channel. We need to hook it up to hazelcast. We can still use TCP for this which is how the JGroups channel sets up. After we read the Hazelcast XML we can set the TCP properties and start the provider
There following is the overview of what needs to happen:
-
Both AutoWire and Manual cluster config is handled here https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotmarketing/business/ChainableCacheAdministratorImpl.java#L103. It sets a bunch of system properties that Jgroups reads. We need to make these be dotCMS properties that all our CacheTransports can use on init(). We will stick with TCP config for autowire. In the HazelCastTransport we need to figure out of the properties are commented out. IF they are don't try to use them just load the hazelcast config XML. The idea is that we will always load the config and then IF we have properties set in our system one of which might be autowire THEN we force the TCP BUT IF autowire is false AND there are no cache TCP settings in the dotmarketing-config.properties file THEN we only load the hazel xml and move on.
-
HazelcastUtil needs to hold more then one HazelCastInstance. Basically this https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/cluster/business/HazelcastUtil.java#L16 needs to be a Map<String, HazelcastInstance> where string is the XMLFIlePath The default path is hazelcast-embedded.xml as it already is in the code. To solve the properties case mentioned above we also need to overload the methods getHazel(...) which take the Properties object or a map of props
-
Bug-fixes here and there to support Manual and Auto Cluster on Fresh vs. Existing dotCMS instances as expected
PR Core: #11414 PR EE: dotCMS/enterprise-2.x#464
Passed QA. Both AutoWire and Manual cluster can be configured to use Hazelcast. Tested on dotcms 4.1.0 distribution generated from master on commit 6b1238a Mac OS 10.10 / MySQL 5.6.35 / Firefox v45.0.1 / Tomcat 8 / Java 8