File tree 4 files changed +25
-4
lines changed
deb/src/main/packaging/init.d
rpm/src/main/packaging/init.d
qa/vagrant/src/test/resources/packaging/scripts 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ DAEMON_OPTS="-d -p $PID_FILE -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$D
84
84
export ES_JAVA_OPTS
85
85
export JAVA_HOME
86
86
export ES_INCLUDE
87
+ export ES_JVM_OPTIONS
87
88
88
89
if [ ! -x " $DAEMON " ]; then
89
90
echo " The elasticsearch startup script does not exists or it is not executable, tried: $DAEMON "
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ prog="elasticsearch"
60
60
pidfile=" $PID_DIR /${prog} .pid"
61
61
62
62
export ES_JAVA_OPTS
63
- export ES_STARTUP_SLEEP_TIME
64
63
export JAVA_HOME
65
64
export ES_INCLUDE
65
+ export ES_JVM_OPTIONS
66
+ export ES_STARTUP_SLEEP_TIME
66
67
67
68
lockfile=/var/lock/subsys/$prog
68
69
Original file line number Diff line number Diff line change @@ -110,12 +110,12 @@ setup() {
110
110
local temp=` mktemp -d`
111
111
touch " $temp /jvm.options"
112
112
chown -R elasticsearch:elasticsearch " $temp "
113
- echo " -Xms264m " >> " $temp /jvm.options"
114
- echo " -Xmx264m " >> " $temp /jvm.options"
113
+ echo " -Xms512m " >> " $temp /jvm.options"
114
+ echo " -Xmx512m " >> " $temp /jvm.options"
115
115
export ES_JVM_OPTIONS=" $temp /jvm.options"
116
116
export ES_JAVA_OPTS=" -XX:-UseCompressedOops"
117
117
start_elasticsearch_service
118
- curl -s -XGET localhost:9200/_nodes | fgrep ' "heap_init_in_bytes":276824064 '
118
+ curl -s -XGET localhost:9200/_nodes | fgrep ' "heap_init_in_bytes":536870912 '
119
119
curl -s -XGET localhost:9200/_nodes | fgrep ' "using_compressed_ordinary_object_pointers":"false"'
120
120
stop_elasticsearch_service
121
121
export ES_JVM_OPTIONS=$es_jvm_options
Original file line number Diff line number Diff line change @@ -134,6 +134,25 @@ setup() {
134
134
[ " $status " -eq 3 ] || [ " $status " -eq 4 ]
135
135
}
136
136
137
+ @test " [INIT.D] start Elasticsearch with custom JVM options" {
138
+ local es_java_opts=$ES_JAVA_OPTS
139
+ local es_jvm_options=$ES_JVM_OPTIONS
140
+ local temp=` mktemp -d`
141
+ touch " $temp /jvm.options"
142
+ chown -R elasticsearch:elasticsearch " $temp "
143
+ echo " -Xms512m" >> " $temp /jvm.options"
144
+ echo " -Xmx512m" >> " $temp /jvm.options"
145
+ cp /etc/sysconfig/elasticsearch " $temp /elasticsearch"
146
+ echo " ES_JVM_OPTIONS=\" $temp /jvm.options\" " >> /etc/sysconfig/elasticsearch
147
+ echo " ES_JAVA_OPTS=\" -XX:-UseCompressedOops\" " >> /etc/sysconfig/elasticsearch
148
+ service elasticsearch start
149
+ wait_for_elasticsearch_status
150
+ curl -s -XGET localhost:9200/_nodes | fgrep ' "heap_init_in_bytes":536870912'
151
+ curl -s -XGET localhost:9200/_nodes | fgrep ' "using_compressed_ordinary_object_pointers":"false"'
152
+ service elasticsearch stop
153
+ cp " $temp /elasticsearch" /etc/sysconfig/elasticsearch
154
+ }
155
+
137
156
# Simulates the behavior of a system restart:
138
157
# the PID directory is deleted by the operating system
139
158
# but it should not block ES from starting
You can’t perform that action at this time.
0 commit comments