Skip to content

Commit 9517b2a

Browse files
committed
Update Java version to Java11.
1 parent 23ed93e commit 9517b2a

File tree

1 file changed

+10
-6
lines changed
  • cluster/node/appnode/src/main/java/com/thefirstlineofcode/granite/cluster/node/appnode

1 file changed

+10
-6
lines changed

cluster/node/appnode/src/main/java/com/thefirstlineofcode/granite/cluster/node/appnode/Starter.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class Starter {
4040
private static final String FILE_NAME_DEPLOY_PLAN_CHECKSUM = "deploy-plan-checksum.txt";
4141

4242
public void start(Options options) {
43+
preconfigureIgnite(options);
44+
4345
MgtnodeIpAndDeployPlanChecksum mgtnodeIpAndDeployPlanChecksum = null;
4446
if (!options.isNoDeploy()) {
4547
mgtnodeIpAndDeployPlanChecksum = getMgtnodeIpAndDeployChecksum(options);
@@ -84,6 +86,12 @@ public void start(Options options) {
8486

8587
startRuntime(options, nodeType, mgtnodeIpAndDeployPlanChecksum == null ? null : mgtnodeIpAndDeployPlanChecksum.mgtnodeIp, runtimeName);
8688
}
89+
90+
private void preconfigureIgnite(Options options) {
91+
System.setProperty("IGNITE_REST_START_ON_CLIENT", "true");
92+
System.setProperty("java.net.preferIPv4Stack", "true");
93+
configureIgniteLogger(options);
94+
}
8795

8896
private void removeLocalDeployPlanCheckSum(String configurationDir) {
8997
Path localDeployPlanChecksumFilePath = Paths.get(configurationDir, FILE_NAME_DEPLOY_PLAN_CHECKSUM);
@@ -475,17 +483,12 @@ private String tryToGetDeployPlanChecksum(String address, int port) {
475483
private void joinCluster(Options options) {
476484
logger.info("Application node is trying to join the cluster...");
477485

478-
configureIgniteLogger(options);
479-
480-
System.setProperty("java.net.preferIPv4Stack", "true");
481-
482486
try {
483487
IgniteConfiguration configuration = new IgniteConfiguration();
484488
configuration.setUserAttributes(Collections.singletonMap("ROLE", "appnode"));
485489

486490
configuration.setClientMode(true);
487491
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
488-
discoverySpi.setForceServerMode(true);
489492
configuration.setDiscoverySpi(discoverySpi);
490493

491494
Ignition.start(configuration);
@@ -520,6 +523,7 @@ private boolean isValidIpv4Address(String address) {
520523
}
521524

522525
private void configureIgniteLogger(Options options) {
523-
System.setProperty("java.util.logging.config.file", options.getConfigurationDir() + "/java_util_logging.ini");
526+
Path logConfigPath = Paths.get(options.getConfigurationDir(), "java_util_logging.ini");
527+
System.setProperty("java.util.logging.config.file", logConfigPath.toAbsolutePath().toString());
524528
}
525529
}

0 commit comments

Comments
 (0)