use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class LocalAddressRegistryIntegrationTest method createConfigForServer.
private Config createConfigForServer() {
Config config = smallInstanceConfig();
AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
advancedJoinConfig.getTcpIpConfig().setEnabled(true);
ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_MEMBER_ADDRESS.getPort());
memberServerSocketConfig.getInterfaces().addInterface(SERVER_MEMBER_ADDRESS.getHost());
ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_CLIENT_ADDRESS.getPort());
clientServerSocketConfig.getInterfaces().addInterface(SERVER_CLIENT_ADDRESS.getHost());
ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
wanServerSocketConfig.getInterfaces().addInterface(SERVER_WAN_ADDRESS.getHost());
memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
return config;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class LocalAddressRegistryIntegrationTest method createConfigForInitiator.
private Config createConfigForInitiator() {
Config config = smallInstanceConfig();
AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
advancedJoinConfig.getTcpIpConfig().setEnabled(true).addMember(SERVER_MEMBER_ADDRESS.getHost() + ":" + SERVER_MEMBER_ADDRESS.getPort());
ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_MEMBER_ADDRESS.getPort());
memberServerSocketConfig.getInterfaces().addInterface(INITIATOR_MEMBER_ADDRESS.getHost());
ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_CLIENT_ADDRESS.getPort());
ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
wanServerSocketConfig.getInterfaces().addInterface(INITIATOR_WAN_ADDRESS.getHost());
memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
return config;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class TcpMetricValuesTest method getConfig.
private Config getConfig(String... members) {
Config config = new Config();
NetworkConfig networkConfig = config.getNetworkConfig();
JoinConfig join = networkConfig.getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true);
for (String member : members) {
join.getTcpIpConfig().addMember(member);
}
return config;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class WordCountTest method before.
@Before
public void before() {
Config config = defaultInstanceConfigWithJetEnabled();
config.getJetConfig().setCooperativeThreadCount(PARALLELISM);
config.setClusterName(randomName());
final JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1");
for (int i = 0; i < NODE_COUNT; i++) {
instance = Hazelcast.newHazelcastInstance(config);
}
logger = instance.getLoggingService().getLogger(WordCountTest.class);
generateMockInput();
}
use of com.hazelcast.config.JoinConfig in project cas by apereo.
the class HazelcastConfigurationFactory method createDiscoveryJoinConfig.
private static JoinConfig createDiscoveryJoinConfig(final Config config, final HazelcastClusterProperties cluster, final NetworkConfig networkConfig) {
val joinConfig = new JoinConfig();
LOGGER.trace("Disabling multicast and TCP/IP configuration for discovery");
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(false);
val discoveryConfig = new DiscoveryConfig();
val strategyConfig = locateDiscoveryStrategyConfig(cluster, joinConfig, config, networkConfig);
LOGGER.trace("Creating discovery strategy configuration as [{}]", strategyConfig);
discoveryConfig.setDiscoveryStrategyConfigs(CollectionUtils.wrap(strategyConfig));
joinConfig.setDiscoveryConfig(discoveryConfig);
return joinConfig;
}
Aggregations