Skip to content

Commit

Permalink
Update to ES 2.1.0
Browse files Browse the repository at this point in the history
- Remove unused example init script from templates dir
- Add ES_STARTUP_SLEEP_TIME to CentOS/Amazon Linux init script & elasticsearch_configure resource (elastic/elasticsearch#14170)
- Remove Java detection from Debian/Ubuntu init scripts (elastic/elasticsearch#13514)
- Bump default version to 2.1.0 and add sha256 hashes for rpm/deb/tar of 2.1.0

Fixes #402.

ES 2.1.0 release notes: https://www.elastic.co/guide/en/elasticsearch/reference/2.1/release-notes-2.1.0.html
  • Loading branch information
martinb3 committed Dec 1, 2015
1 parent a499b40 commit a21fd17
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 102 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ the version parameter as a string into your download_url.

|Name|Default|Other values|
|----|-------|------------|
|`default['elasticsearch']['version']`|`'2.0.0'`|[See list](attributes/default.rb).|
|`default['elasticsearch']['version']`|`'2.1.0'`|[See list](attributes/default.rb).|
|`default['elasticsearch']['install_type']`|`:package`|`:tarball`|
|`default['elasticsearch']['download_urls']['debian']`|[See values](attributes/default.rb).|`%s` will be replaced with the version attribute above|
|`default['elasticsearch']['download_urls']['rhel']`|[See values](attributes/default.rb).|`%s` will be replaced with the version attribute above|
Expand Down
8 changes: 7 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# elasticsearch version & install type
default['elasticsearch']['version'] = '2.0.0'
default['elasticsearch']['version'] = '2.1.0'
default['elasticsearch']['install_type'] = :package

# platform_family keyed download URLs
Expand Down Expand Up @@ -40,3 +40,9 @@
default['elasticsearch']['checksums']['2.0.0']['debian'] = 'f846cab2b7e99159650d38767249275c2fd5d3574fe700ef199cd1cb06ef28bf'
default['elasticsearch']['checksums']['2.0.0']['rhel'] = '6bd2d7840447836450d8781fffa9e296dfb257b523598c6e55433850e37feb25'
default['elasticsearch']['checksums']['2.0.0']['tar'] = 'b25f13f615337c2072964fd9fc5c7250f8a2a983b22198daf93548285d5d16df'
default['elasticsearch']['checksums']['2.0.1']['debian'] = '815a7b7d3bbd862c3ec136aa7bfb1adec272bdecdae45233d9ffdf61d307e86c'
default['elasticsearch']['checksums']['2.0.1']['rhel'] = '69957ef5ee6a142adf02c1065faa29bda7e2cf7f2d5c56edad4852b7f644345a'
default['elasticsearch']['checksums']['2.0.1']['tar'] = '7be4a6c717002057e422073ca8e957df8b4cb198bf2399a0d79f42121e34798b'
default['elasticsearch']['checksums']['2.1.0']['debian'] = '099fdeb7b3903ce8cea7d39b577ed6445b78b64d14dd2664fd2ca1e0896691dd'
default['elasticsearch']['checksums']['2.1.0']['rhel'] = 'a79c1985224c1b57479275794b258f4eba973e0b65f5c62b1c38e02738a1ce71'
default['elasticsearch']['checksums']['2.1.0']['tar'] = '8a4e85bcb506daa369651506af1cbc55c09fd7ff387d111142ae14d0a85d4d14'
6 changes: 3 additions & 3 deletions libraries/provider_configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ def whyrun_supported?
# Valid values in /etc/sysconfig/elasticsearch or /etc/default/elasticsearch
# ES_HOME CONF_DIR CONF_FILE DATA_DIR LOG_DIR WORK_DIR PID_DIR
# ES_HEAP_SIZE ES_HEAP_NEWSIZE ES_DIRECT_SIZE ES_JAVA_OPTS
# ES_RESTART_ON_UPGRADE ES_GC_LOG_FILE ES_USER ES_GROUP
# MAX_OPEN_FILES MAX_LOCKED_MEMORY MAX_MAP_COUNT
# ES_RESTART_ON_UPGRADE ES_GC_LOG_FILE ES_STARTUP_SLEEP_TIME
# ES_USER ES_GROUP MAX_OPEN_FILES MAX_LOCKED_MEMORY MAX_MAP_COUNT
params = {}

params[:ES_HOME] = new_resource.path_home[es_install.type]
params[:CONF_DIR] = new_resource.path_conf[es_install.type]
params[:DATA_DIR] = new_resource.path_data[es_install.type]
params[:LOG_DIR] = new_resource.path_logs[es_install.type]
params[:PID_DIR] = new_resource.path_pid[es_install.type]

params[:ES_STARTUP_SLEEP_TIME] = new_resource.startup_sleep_seconds.to_s
params[:ES_USER] = es_user.username
params[:ES_GROUP] = es_user.groupname

Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class ElasticsearchCookbook::ConfigureResource < Chef::Resource::LWRPBase

attribute(:java_home, kind_of: String, default: nil)

attribute(:startup_sleep_seconds, kind_of: [String, Integer], default: 5)

# Calculations for this are done in the provider, as we can't do them in the
# resource definition. default is 50% of RAM or 31GB, which ever is smaller.
attribute(:allocated_memory, kind_of: String)
Expand Down
1 change: 1 addition & 0 deletions templates/amazon/initscript.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export ES_HEAP_NEWSIZE
export ES_DIRECT_SIZE
export ES_JAVA_OPTS
export ES_GC_LOG_FILE
export ES_STARTUP_SLEEP_TIME
export JAVA_HOME

lockfile=/var/lock/subsys/$prog
Expand Down
1 change: 1 addition & 0 deletions templates/centos/initscript.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export ES_HEAP_NEWSIZE
export ES_DIRECT_SIZE
export ES_JAVA_OPTS
export ES_GC_LOG_FILE
export ES_STARTUP_SLEEP_TIME
export JAVA_HOME

lockfile=/var/lock/subsys/$prog
Expand Down
12 changes: 1 addition & 11 deletions templates/debian/initscript.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ fi
ES_USER=elasticsearch
ES_GROUP=elasticsearch

# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
JDK_DIRS="/usr/lib/jvm/java-8-oracle/ /usr/lib/jvm/j2sdk1.8-oracle/ /usr/lib/jvm/jdk-7-oracle-x64 /usr/lib/jvm/java-7-oracle /usr/lib/jvm/j2sdk1.7-oracle/ /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/java-7-openjdk-amd64/ /usr/lib/jvm/java-7-openjdk-armhf /usr/lib/jvm/java-7-openjdk-i386/ /usr/lib/jvm/default-java"

# Look for the right JVM to use
for jdir in $JDK_DIRS; do
if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
JAVA_HOME="$jdir"
fi
done
export JAVA_HOME

# Directory where the Elasticsearch binary distribution resides
ES_HOME=/usr/share/$NAME

Expand Down Expand Up @@ -117,6 +106,7 @@ export ES_HEAP_NEWSIZE
export ES_DIRECT_SIZE
export ES_JAVA_OPTS
export ES_GC_LOG_FILE
export JAVA_HOME

# Check DAEMON exists
test -x $DAEMON || exit 0
Expand Down
74 changes: 0 additions & 74 deletions templates/default/elasticsearch.in.sh.example

This file was deleted.

12 changes: 1 addition & 11 deletions templates/ubuntu/initscript.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ fi
ES_USER=elasticsearch
ES_GROUP=elasticsearch

# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
JDK_DIRS="/usr/lib/jvm/java-8-oracle/ /usr/lib/jvm/j2sdk1.8-oracle/ /usr/lib/jvm/jdk-7-oracle-x64 /usr/lib/jvm/java-7-oracle /usr/lib/jvm/j2sdk1.7-oracle/ /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/java-7-openjdk-amd64/ /usr/lib/jvm/java-7-openjdk-armhf /usr/lib/jvm/java-7-openjdk-i386/ /usr/lib/jvm/default-java"

# Look for the right JVM to use
for jdir in $JDK_DIRS; do
if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
JAVA_HOME="$jdir"
fi
done
export JAVA_HOME

# Directory where the Elasticsearch binary distribution resides
ES_HOME=/usr/share/$NAME

Expand Down Expand Up @@ -117,6 +106,7 @@ export ES_HEAP_NEWSIZE
export ES_DIRECT_SIZE
export ES_JAVA_OPTS
export ES_GC_LOG_FILE
export JAVA_HOME

# Check DAEMON exists
test -x $DAEMON || exit 0
Expand Down
2 changes: 1 addition & 1 deletion test/integration/helpers/serverspec/install_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

shared_examples_for 'elasticsearch install' do |args = {}|
dir = args[:dir] || (package? ? '/usr/share/elasticsearch' : '/usr/local')
version = args[:version] || '2.0.0'
version = args[:version] || '2.1.0'

expected_user = args[:user] || 'elasticsearch'
expected_group = args[:group] || expected_user || 'elasticsearch'
Expand Down

0 comments on commit a21fd17

Please sign in to comment.