mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
Adapt ES_JVM_OPTIONS packaging test to ubuntu-1204
This commit adapts the "[INIT.D] start Elasticsearch with custom JVM options" packaging test so that it works on ubuntu-1204. Related to #21445
This commit is contained in:
parent
27a7b30349
commit
3f7f8e4b97
@ -135,6 +135,7 @@ setup() {
|
||||
}
|
||||
|
||||
@test "[INIT.D] start Elasticsearch with custom JVM options" {
|
||||
assert_file_exist $ESENVFILE
|
||||
local es_java_opts=$ES_JAVA_OPTS
|
||||
local es_jvm_options=$ES_JVM_OPTIONS
|
||||
local temp=`mktemp -d`
|
||||
@ -142,15 +143,15 @@ setup() {
|
||||
chown -R elasticsearch:elasticsearch "$temp"
|
||||
echo "-Xms512m" >> "$temp/jvm.options"
|
||||
echo "-Xmx512m" >> "$temp/jvm.options"
|
||||
cp /etc/sysconfig/elasticsearch "$temp/elasticsearch"
|
||||
echo "ES_JVM_OPTIONS=\"$temp/jvm.options\"" >> /etc/sysconfig/elasticsearch
|
||||
echo "ES_JAVA_OPTS=\"-XX:-UseCompressedOops\"" >> /etc/sysconfig/elasticsearch
|
||||
cp $ESENVFILE "$temp/elasticsearch"
|
||||
echo "ES_JVM_OPTIONS=\"$temp/jvm.options\"" >> $ESENVFILE
|
||||
echo "ES_JAVA_OPTS=\"-XX:-UseCompressedOops\"" >> $ESENVFILE
|
||||
service elasticsearch start
|
||||
wait_for_elasticsearch_status
|
||||
curl -s -XGET localhost:9200/_nodes | fgrep '"heap_init_in_bytes":536870912'
|
||||
curl -s -XGET localhost:9200/_nodes | fgrep '"using_compressed_ordinary_object_pointers":"false"'
|
||||
service elasticsearch stop
|
||||
cp "$temp/elasticsearch" /etc/sysconfig/elasticsearch
|
||||
cp "$temp/elasticsearch" $ESENVFILE
|
||||
}
|
||||
|
||||
# Simulates the behavior of a system restart:
|
||||
|
@ -36,6 +36,12 @@ export_elasticsearch_paths() {
|
||||
export ESDATA="/var/lib/elasticsearch"
|
||||
export ESLOG="/var/log/elasticsearch"
|
||||
export ESPIDDIR="/var/run/elasticsearch"
|
||||
if is_dpkg; then
|
||||
export ESENVFILE="/etc/default/elasticsearch"
|
||||
fi
|
||||
if is_rpm; then
|
||||
export ESENVFILE="/etc/sysconfig/elasticsearch"
|
||||
fi
|
||||
}
|
||||
|
||||
# Install the rpm or deb package.
|
||||
|
Loading…
x
Reference in New Issue
Block a user