File 0001-provide-SUSE-environment.patch of Package elasticsearch
From e767cfe4746038bf9691c8ff182c8be34955812f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Wed, 24 Jul 2019 11:38:29 +0200
Subject: [PATCH 1/3] provide SUSE environment
and enable G1GC
---
distribution/build.gradle | 4 ++--
distribution/packages/src/common/env/elasticsearch | 8 ++++----
.../src/common/systemd/elasticsearch.service | 4 ++--
distribution/src/config/jvm.options | 13 +++++++------
4 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/distribution/build.gradle b/distribution/build.gradle
index ac167b34870b..3d1983608338 100644
--- a/distribution/build.gradle
+++ b/distribution/build.gradle
@@ -573,7 +573,7 @@ subprojects {
'path.data': [
'deb': packagingPathData,
'rpm': packagingPathData,
- 'def': '#path.data: /path/to/data'
+ 'def': 'path.data: /var/lib/elasticsearch'
],
'path.env': [
'deb': '/etc/default/elasticsearch',
@@ -590,7 +590,7 @@ subprojects {
'path.logs': [
'deb': packagingPathLogs,
'rpm': packagingPathLogs,
- 'def': '#path.logs: /path/to/logs'
+ 'def': 'path.logs: /var/log/elasticsearch'
],
'loggc': [
'deb': packagingLoggc,
diff --git a/distribution/packages/src/common/env/elasticsearch b/distribution/packages/src/common/env/elasticsearch
index 5e2b1eb23b23..2d5f2f6e0643 100644
--- a/distribution/packages/src/common/env/elasticsearch
+++ b/distribution/packages/src/common/env/elasticsearch
@@ -3,17 +3,17 @@
################################
# Elasticsearch home directory
-#ES_HOME=/usr/share/elasticsearch
+ES_HOME=/usr/share/elasticsearch
# Elasticsearch Java path
-#JAVA_HOME=
+JAVA_HOME=/usr/lib64/jvm/jre
# Elasticsearch configuration directory
# Note: this setting will be shared with command-line tools
-ES_PATH_CONF=${path.conf}
+ES_PATH_CONF=/etc/elasticsearch
# Elasticsearch PID directory
-#PID_DIR=/var/run/elasticsearch
+PID_DIR=/run/elasticsearch
# Additional Java OPTS
#ES_JAVA_OPTS=
diff --git a/distribution/packages/src/common/systemd/elasticsearch.service b/distribution/packages/src/common/systemd/elasticsearch.service
index 797a3a4c740f..dc10c5ca7f86 100644
--- a/distribution/packages/src/common/systemd/elasticsearch.service
+++ b/distribution/packages/src/common/systemd/elasticsearch.service
@@ -9,10 +9,10 @@ Type=notify
RuntimeDirectory=elasticsearch
PrivateTmp=true
Environment=ES_HOME=/usr/share/elasticsearch
-Environment=ES_PATH_CONF=${path.conf}
+Environment=ES_PATH_CONF=/etc/elasticsearch
Environment=PID_DIR=/var/run/elasticsearch
Environment=ES_SD_NOTIFY=true
-EnvironmentFile=-${path.env}
+EnvironmentFile=-/etc/sysconfig/elasticsearch
WorkingDirectory=/usr/share/elasticsearch
diff --git a/distribution/src/config/jvm.options b/distribution/src/config/jvm.options
index 050a1e149d6d..7820e60769b2 100644
--- a/distribution/src/config/jvm.options
+++ b/distribution/src/config/jvm.options
@@ -19,8 +19,8 @@
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
--Xms${heap.min}
--Xmx${heap.max}
+-Xms4g
+-Xmx8g
################################################################
## Expert settings
@@ -48,7 +48,7 @@
14-:-XX:InitiatingHeapOccupancyPercent=30
## JVM temporary directory
--Djava.io.tmpdir=${ES_TMPDIR}
+-Djava.io.tmpdir=/var/tmp
## heap dumps
@@ -58,17 +58,18 @@
# specify an alternative path for heap dumps; ensure the directory exists and
# has sufficient space
-${heap.dump.path}
+#${heap.dump.path}
+-XX:HeapDumpPath=/var/lib/elasticsearch
# specify an alternative path for JVM fatal error logs
-${error.file}
+#${error.file}
## JDK 8 GC logging
8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
-8:-Xloggc:${loggc}
+8:-Xloggc:/var/log/elasticsearch/loggc
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m
--
2.26.0