File 0003-provide-SUSE-environment.patch of Package elasticsearch

From 7708c314b5061f1c620068522560d1666029994e 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 3/4] provide SUSE environment

and enable G1GC
---
 distribution/packages/src/common/env/elasticsearch  |  8 ++++----
 .../src/common/systemd/elasticsearch.service        |  4 ++--
 distribution/src/config/jvm.options                 | 13 +++++++------
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/distribution/packages/src/common/env/elasticsearch b/distribution/packages/src/common/env/elasticsearch
index 76d9473b0fb5..3949a7904327 100644
--- a/distribution/packages/src/common/env/elasticsearch
+++ b/distribution/packages/src/common/env/elasticsearch
@@ -3,16 +3,16 @@
 ################################
 
 # Elasticsearch home directory
-#ES_HOME=/usr/share/elasticsearch
+ES_HOME=/usr/share/elasticsearch
 
 # Elasticsearch Java path
-#JAVA_HOME=
+JAVA_HOME=/usr/lib64/jvm/java
 
 # Elasticsearch configuration directory
-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 ed32b0708adf..3210e37effc1 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.25.1

openSUSE Build Service is sponsored by