public static void failOnVersionMismatch(String minVersion, String message) {
   BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();
   String actualVersion = buildInfo.getVersion();
   LOGGER.info(
       "Compare version "
           + actualVersion
           + " with minimum version "
           + minVersion
           + ": "
           + isMinVersion(minVersion, actualVersion));
   if (!isMinVersion(minVersion, actualVersion)) {
     fail(format(message, minVersion));
   }
 }
Example #2
0
 public JoinMessage createSplitBrainJoinMessage() {
   return new JoinMessage(
       Packet.VERSION,
       buildInfo.getBuildNumber(),
       address,
       localMember.getUuid(),
       createConfigCheck(),
       clusterService.getMemberAddresses());
 }
Example #3
0
  public JoinRequest createJoinRequest(boolean withCredentials) {
    final Credentials credentials =
        (withCredentials && securityContext != null)
            ? securityContext.getCredentialsFactory().newCredentials()
            : null;

    return new JoinRequest(
        Packet.VERSION,
        buildInfo.getBuildNumber(),
        address,
        localMember.getUuid(),
        createConfigCheck(),
        credentials,
        config.getMemberAttributeConfig().getAttributes());
  }
Example #4
0
  void start() {
    nodeEngine.start();
    connectionManager.start();
    if (config.getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
      final Thread multicastServiceThread =
          new Thread(
              hazelcastThreadGroup.getInternalThreadGroup(),
              multicastService,
              hazelcastThreadGroup.getThreadNamePrefix("MulticastThread"));
      multicastServiceThread.start();
    }
    if (groupProperties.getBoolean(GroupProperty.DISCOVERY_SPI_ENABLED)) {
      discoveryService.start();
    }

    if (groupProperties.getBoolean(GroupProperty.SHUTDOWNHOOK_ENABLED)) {
      logger.finest("Adding ShutdownHook");
      Runtime.getRuntime().addShutdownHook(shutdownHookThread);
    }
    state = NodeState.ACTIVE;

    join();
    int clusterSize = clusterService.getSize();
    if (config.getNetworkConfig().isPortAutoIncrement()
        && address.getPort() >= config.getNetworkConfig().getPort() + clusterSize) {
      StringBuilder sb = new StringBuilder("Config seed port is ");
      sb.append(config.getNetworkConfig().getPort());
      sb.append(" and cluster size is ");
      sb.append(clusterSize);
      sb.append(". Some of the ports seem occupied!");
      logger.warning(sb.toString());
    }
    try {
      managementCenterService = new ManagementCenterService(hazelcastInstance);
    } catch (Exception e) {
      logger.warning("ManagementCenterService could not be constructed!", e);
    }
    nodeExtension.afterStart(this);
    versionCheck.check(this, getBuildInfo().getVersion(), buildInfo.isEnterprise());
  }