diff --git a/distribution/src/bin/elasticsearch-cli b/distribution/src/bin/elasticsearch-cli index 8d7e65cc382dc..ea292c2b6c032 100644 --- a/distribution/src/bin/elasticsearch-cli +++ b/distribution/src/bin/elasticsearch-cli @@ -19,6 +19,7 @@ exec \ -Des.path.home="$ES_HOME" \ -Des.path.conf="$ES_PATH_CONF" \ -Des.distribution.type="$ES_DISTRIBUTION_TYPE" \ + -Des.java.type="$JAVA_TYPE" \ -cp "$LAUNCHER_CLASSPATH" \ org.elasticsearch.launcher.CliToolLauncher \ "$@" diff --git a/distribution/src/bin/elasticsearch-cli.bat b/distribution/src/bin/elasticsearch-cli.bat index 608bd2b2a265c..82cc59da10170 100644 --- a/distribution/src/bin/elasticsearch-cli.bat +++ b/distribution/src/bin/elasticsearch-cli.bat @@ -18,6 +18,7 @@ set LAUNCHER_CLASSPATH=%ES_HOME%/lib/*;%ES_HOME%/lib/cli-launcher/* -Des.path.home="%ES_HOME%" ^ -Des.path.conf="%ES_PATH_CONF%" ^ -Des.distribution.type="%ES_DISTRIBUTION_TYPE%" ^ + -Des.java.type="%JAVA_TYPE%" ^ -cp "%LAUNCHER_CLASSPATH%" ^ org.elasticsearch.launcher.CliToolLauncher ^ %* diff --git a/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java b/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java index d60c5b7e57deb..caabc8583bb18 100644 --- a/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java +++ b/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java @@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.Configurator; +import org.apache.lucene.util.Constants; import org.apache.lucene.util.StringHelper; import org.apache.lucene.util.VectorUtil; import org.elasticsearch.Build; @@ -55,6 +56,7 @@ import java.io.InputStream; import java.io.PrintStream; import java.lang.invoke.MethodHandles; +import java.lang.management.ManagementFactory; import java.lang.reflect.InvocationTargetException; import java.nio.file.Files; import java.nio.file.Path; @@ -64,6 +66,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -176,6 +179,9 @@ public void checkPermission(Permission perm) { *
Phase 2 consists of everything that must occur up to and including security manager initialization.
*/
private static void initPhase2(Bootstrap bootstrap) throws IOException {
+ // always start by dumping what we know about the process to the log
+ logSystemInfo();
+
final ServerArgs args = bootstrap.args();
final SecureSettings secrets = args.secrets();
bootstrap.setSecureSettings(secrets);
@@ -289,6 +295,35 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
bootstrap.setPluginsLoader(pluginsLoader);
}
+ private static void logSystemInfo() {
+ final Logger logger = LogManager.getLogger(Elasticsearch.class);
+ logger.info(
+ "version[{}], pid[{}], build[{}/{}/{}], OS[{}/{}/{}], JVM[{}/{}/{}/{}]",
+ Build.current().qualifiedVersion(),
+ ProcessHandle.current().pid(),
+ Build.current().type().displayName(),
+ Build.current().hash(),
+ Build.current().date(),
+ Constants.OS_NAME,
+ Constants.OS_VERSION,
+ Constants.OS_ARCH,
+ Constants.JVM_VENDOR,
+ Constants.JVM_NAME,
+ System.getProperty("java.version"),
+ Runtime.version().toString()
+ );
+ boolean isBundledJdk = System.getProperty("es.java.type", "").equals("bundled JDK");
+ logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), isBundledJdk);
+ logger.info("JVM arguments {}", ManagementFactory.getRuntimeMXBean().getInputArguments());
+ logger.info("Default Locale [{}]", Locale.getDefault());
+ if (Build.current().isProductionRelease() == false) {
+ logger.warn(
+ "version [{}] is a pre-release version of Elasticsearch and is not suitable for production",
+ Build.current().qualifiedVersion()
+ );
+ }
+ }
+
private static Map