@Bean
	public HazelcastInstance hazelcastInstance() {
		com.hazelcast.config.Config hazelcastConfig = new com.hazelcast.config.Config("nGrinder");
		hazelcastConfig.setManagedContext(managedContext());
		hazelcastConfig.getMemberAttributeConfig().setAttributes(getClusterMemberAttributes());
		hazelcastConfig.setMapConfigs(cacheConfigMap().getHazelcastCacheConfigs());
		hazelcastConfig.addExecutorConfig(getExecutorConfig(REGION_EXECUTOR_SERVICE_NAME));
		hazelcastConfig.addExecutorConfig(getExecutorConfig(AGENT_EXECUTOR_SERVICE_NAME));
		hazelcastConfig.addTopicConfig(getTopicConfig());
		NetworkConfig networkConfig = hazelcastConfig.getNetworkConfig();

		JoinConfig join = networkConfig.getJoin();
		join.getMulticastConfig().setEnabled(false);

		if (isClustered()) {
			TcpIpConfig tcpIpConfig = join.getTcpIpConfig();
			tcpIpConfig.setEnabled(true);
			String clusterMode = config.getClusterMode();
			String[] clusterURIs = defaultIfNull(getClusterURIs(), EMPTY_STRING_ARRAY);

			if ("easy".equals(clusterMode)) {
				tcpIpConfig.addMember(NetworkUtils.getLocalHostAddress());
			} else {
				networkConfig.setPort(getClusterPort()).setPortAutoIncrement(false);
				if (clusterURIs.length > 0) {
					tcpIpConfig.setMembers(Arrays.asList(clusterURIs));
				} else {
					log.warn("nGrinder system configuration 'cluster.members' is required in advanced clustering.\n" +
						"Please set comma separated IP list of all clustered controller servers in your system configuration.");
				}
			}

		}

		if (!isClustered()) {
			hazelcastConfig.setProperty(HAZELCAST_PARTITION_COUNT, "1");
		}

		HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(hazelcastConfig);
		ITopic<TopicEvent> topic = hazelcastInstance.getTopic(AGENT_TOPIC_NAME);
		topic.addMessageListener(topicSubscriber());
		return hazelcastInstance;
	}
Dynamic cache configuration. it creates local cache or dist cache.

@since 3.1
ngrinder-controller/src/main/java/org/ngrinder/infra/config/DynamicCacheConfig.java