diff --git a/.travis.yml b/.travis.yml index 664d4300f..61ee13980 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ sudo: required -# group: deprecated-2017Q4 services: - docker cache: @@ -11,21 +10,11 @@ language: ruby script: travis_retry bundle exec rake $TASK jobs: allow_failures: - - env: - - TASK=beaker:ubuntu-server-1404-x64:snapshot - - env: - - OSS_PACKAGE=true - - TASK=beaker:ubuntu-server-1404-x64:snapshot - env: - TASK=beaker:ubuntu-server-1604-x64:snapshot - env: - OSS_PACKAGE=true - TASK=beaker:ubuntu-server-1604-x64:snapshot - - env: - - TASK=beaker:centos-6-x64:snapshot - - env: - - OSS_PACKAGE=true - - TASK=beaker:centos-6-x64:snapshot - env: - TASK=beaker:centos-7-x64:snapshot - env: @@ -33,9 +22,6 @@ jobs: - TASK=beaker:centos-7-x64:snapshot - env: - TASK=beaker:debian-8-x64:snapshot - - env: - - OSS_PACKAGE=true - - TASK=beaker:debian-8-x64:snapshot - env: - TASK=beaker:debian-9-x64:snapshot - env: @@ -47,7 +33,7 @@ jobs: - TASK=intake - env: - TASK=intake - - PUPPET_VERSION='~> 5.0' + - PUPPET_VERSION='~> 6.0' - stage: acceptance env: - BEAKER_PUPPET_COLLECTION=puppet6 @@ -61,12 +47,6 @@ jobs: - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:amazonlinux-2-x64:acceptance[7.8.0] - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:centos-6-x64:acceptance - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:centos-6-x64:acceptance[7.8.0] - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:centos-7-x64:acceptance @@ -79,24 +59,12 @@ jobs: - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:centos-8-x64:acceptance[7.8.0] - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:oracle-6-x64:acceptance - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:oracle-6-x64:acceptance[7.8.0] - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:oracle-7-x64:acceptance - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:oracle-7-x64:acceptance[7.8.0] - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:debian-8-x64:acceptance - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:debian-8-x64:acceptance[7.8.0] - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:debian-9-x64:acceptance @@ -109,12 +77,6 @@ jobs: - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:debian-10-x64:acceptance[7.8.0] - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:ubuntu-server-1404-x64:acceptance - - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - TASK=beaker:ubuntu-server-1404-x64:acceptance[7.8.0] - env: - BEAKER_PUPPET_COLLECTION=puppet6 - TASK=beaker:ubuntu-server-1604-x64:acceptance @@ -133,32 +95,16 @@ jobs: # - env: # - BEAKER_PUPPET_COLLECTION=puppet6 # - TASK=beaker:ubuntu-server-2004-x64:acceptance[7.8.0] - - stage: snapshots - env: - - TASK=beaker:ubuntu-server-1404-x64:snapshot - env: - - OSS_PACKAGE=true - - TASK=beaker:ubuntu-server-1404-x64:snapshot - env: - TASK=beaker:ubuntu-server-1604-x64:snapshot - env: - OSS_PACKAGE=true - TASK=beaker:ubuntu-server-1604-x64:snapshot - - env: - - TASK=beaker:centos-6-x64:snapshot - - env: - - OSS_PACKAGE=true - - TASK=beaker:centos-6-x64:snapshot - env: - TASK=beaker:centos-7-x64:snapshot - env: - OSS_PACKAGE=true - TASK=beaker:centos-7-x64:snapshot - - env: - - TASK=beaker:debian-8-x64:snapshot - - env: - - OSS_PACKAGE=true - - TASK=beaker:debian-8-x64:snapshot - env: - TASK=beaker:debian-9-x64:snapshot - env: diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a7984751a..c03d4dd38 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -33,3 +33,4 @@ Matthias Baur (baurmatt) Gavin Williams (fatmcgav) Giedrius Statkevičius (GiedriusS) Jakub Pieńkowski (Jakski) +Grant Davies (grant-veepshosting) diff --git a/data/common.yaml b/data/common.yaml index cd0a63e54..dab51757a 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -28,7 +28,22 @@ elasticsearch::init_defaults: {} elasticsearch::init_defaults_file: ~ elasticsearch::init_template: "%{module_name}/etc/init.d/elasticsearch.systemd.erb" elasticsearch::instances: {} -elasticsearch::jvm_options: [] +elasticsearch::jvm_options: + - '-Dfile.encoding=UTF-8' + - '-Dio.netty.noUnsafe=true' + - '-Dio.netty.noKeySetOptimization=true' + - '-Dio.netty.recycler.maxCapacityPerThread=0' + - '-Djava.awt.headless=true' + - '-Djna.nosys=true' + - '-Dlog4j2.disable.jmx=true' + - '-Dlog4j.shutdownHookEnabled=false' + - '-server' + - '-Xss1m' + - '-XX:+AlwaysPreTouch' + - '-XX:CMSInitiatingOccupancyFraction=75' + - '-XX:+HeapDumpOnOutOfMemoryError' + - '-XX:-OmitStackTraceInFastThrow' + - '-XX:+UseCMSInitiatingOccupancyOnly' elasticsearch::license: ~ elasticsearch::logdir: /var/log/elasticsearch elasticsearch::logging_config: {} @@ -69,3 +84,5 @@ elasticsearch::templates: {} elasticsearch::users: {} elasticsearch::validate_tls: true elasticsearch::version: false +elasticsearch::xms: '2g' +elasticsearch::xmx: '2g' diff --git a/manifests/config.pp b/manifests/config.pp index dffda9f28..3a5d480cf 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -11,7 +11,7 @@ # @author Tyler Langlois # @author Gavin Williams # -class elasticsearch::config { +class elasticsearch::config inherits elasticsearch { #### Configuration @@ -182,14 +182,23 @@ mode => '0440', } - # Add any additional JVM options - $elasticsearch::jvm_options.each |String $jvm_option| { - file_line { "jvm_option_${jvm_option}": - ensure => present, - path => "${elasticsearch::configdir}/jvm.options", - line => $jvm_option, - notify => $elasticsearch::_notify_service, - } + # JVM options + $jvm_options_template = @(EOF) + # FILE MANAGED BY PUPPET - DO NOT MODIFY + + <% @jvm_options.flatten.each do|jvm_option| -%> + <%= jvm_option %> + <% end -%> + -Xms<%= @xms %> + -Xmx<%= @xmx %> + | EOF + + file { "${elasticsearch::configdir}/jvm.options": + ensure => file, + content => inline_template($jvm_options_template), + group => $elasticsearch::elasticsearch_group, + notify => $elasticsearch::_notify_service, + owner => $elasticsearch::elasticsearch_user, } if $elasticsearch::system_key != undef { diff --git a/manifests/init.pp b/manifests/init.pp index 3d5331f0c..1251cdcea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -323,6 +323,12 @@ # @param version # To set the specific version you want to install. # +# @param xms +# JVM minimum memory (should match xmx, or max). +# +# @param xmx +# JVM maximum memory (should match xms). +# # @author Richard Pijnenburg # @author Tyler Langlois # @author Gavin Williams @@ -400,6 +406,8 @@ Hash $users, Boolean $validate_tls, Variant[String, Boolean] $version, + String $xms, + String $xmx, Optional[Stdlib::Absolutepath] $ca_certificate = undef, Optional[Stdlib::Absolutepath] $certificate = undef, String $default_logging_level = $logging_level, diff --git a/spec/acceptance/nodesets/centos-6-x64.yml b/spec/acceptance/nodesets/centos-6-x64.yml deleted file mode 100644 index 40b294bf8..000000000 --- a/spec/acceptance/nodesets/centos-6-x64.yml +++ /dev/null @@ -1,19 +0,0 @@ -HOSTS: - centos-6-x64: - roles: - - master - - agent - - database - - dashboard - platform: el-6-x86_64 - image: centos:6.9 - hypervisor: docker - docker_cmd: ["/sbin/init"] - docker_preserve_image: true - docker_image_commands: - - yum install -y wget tar which java-1.8.0-openjdk-headless - - rm /etc/init/tty.conf - - echo -e "elasticsearch hard nproc 4096\nelasticsearch soft nproc 4096" >> /etc/security/limits.conf - - echo -e "esuser hard nproc 4096\nesuser soft nproc 4096" >> /etc/security/limits.conf -CONFIG: - log_level: warn diff --git a/spec/acceptance/nodesets/debian-8-x64.yml b/spec/acceptance/nodesets/debian-8-x64.yml deleted file mode 100644 index 766a41410..000000000 --- a/spec/acceptance/nodesets/debian-8-x64.yml +++ /dev/null @@ -1,23 +0,0 @@ -HOSTS: - debian-8: - roles: - - agent - - master - - database - - dashboard - platform: debian-8-amd64 - image: debian:8.11 - hypervisor: docker - docker_cmd: ["/bin/systemd"] - docker_preserve_image: true - docker_image_commands: - - echo 'deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main' >> /etc/apt/sources.list - - echo 'Acquire::Check-Valid-Until "false";' >> /etc/apt/apt.conf - - sed -i '/jessie.updates/d' /etc/apt/sources.list - - apt-get update - - apt-get install -yq -t jessie-backports openjdk-8-jre-headless - - apt-get install -yq wget net-tools apt-transport-https - - rm /lib/systemd/system/systemd*udev* - - rm /lib/systemd/system/getty.target -CONFIG: - log_level: warn diff --git a/spec/acceptance/nodesets/oracle-6-x64.yml b/spec/acceptance/nodesets/oracle-6-x64.yml deleted file mode 100644 index f492d67f7..000000000 --- a/spec/acceptance/nodesets/oracle-6-x64.yml +++ /dev/null @@ -1,19 +0,0 @@ -HOSTS: - centos-6-x64: - roles: - - agent - - master - - database - - dashboard - platform: el-6-x86_64 - image: oraclelinux:6 - hypervisor: docker - docker_cmd: ["/sbin/init"] - docker_preserve_image: true - docker_image_commands: - - yum install -y tar wget which java-1.8.0-openjdk-headless - - rm /etc/init/tty.conf - - echo -e "elasticsearch hard nproc 4096\nelasticsearch soft nproc 4096" >> /etc/security/limits.conf - - echo -e "esuser hard nproc 4096\nesuser soft nproc 4096" >> /etc/security/limits.conf -CONFIG: - log_level: warn diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml deleted file mode 100644 index 6dea31b00..000000000 --- a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml +++ /dev/null @@ -1,24 +0,0 @@ -HOSTS: - ubuntu-14-04: - roles: - - agent - - master - - database - - dashboard - platform: ubuntu-14.04-amd64 - image: ubuntu:14.04.5 - hypervisor: docker - docker_cmd: ["/sbin/init"] - docker_preserve_image: true - docker_image_commands: - - apt-get update - - apt-get install -yq apt-transport-https libssl-dev software-properties-common - - add-apt-repository -y ppa:openjdk-r/ppa - - apt-get update - - apt-get install -y openjdk-8-jre-headless - - update-ca-certificates -f - - ln -sf /sbin/initctl.distrib /sbin/initctl - - locale-gen en_US en_US.UTF-8 - - dpkg-reconfigure locales -CONFIG: - log_level: warn diff --git a/spec/classes/000_elasticsearch_init_spec.rb b/spec/classes/000_elasticsearch_init_spec.rb index c37fe5eb4..25bb319df 100644 --- a/spec/classes/000_elasticsearch_init_spec.rb +++ b/spec/classes/000_elasticsearch_init_spec.rb @@ -15,9 +15,9 @@ let(:pkg_prov) { 'dpkg' } let(:version_add) { '' } if (facts[:os]['name'] == 'Debian' and \ - facts[:os]['release']['major'].to_i >= 8) or \ + facts[:os]['release']['major'].to_i >= 9) or \ (facts[:os]['name'] == 'Ubuntu' and \ - facts[:os]['release']['major'].to_i >= 15) + facts[:os]['release']['major'].to_i >= 16) let(:systemd_service_path) { '/lib/systemd/system' } test_pid = true else @@ -41,7 +41,7 @@ let(:pkg_prov) { 'rpm' } let(:version_add) { '-1' } if facts[:os]['name'] == 'OpenSuSE' and - facts[:os]['release']['major'].to_i <= 12 + facts[:os]['release']['major'].to_i >= 12 let(:systemd_service_path) { '/lib/systemd/system' } else let(:systemd_service_path) { '/usr/lib/systemd/system' } @@ -335,28 +335,6 @@ .with(:owner => 'myesuser', :group => 'myesgroup') } end - describe 'setting jvm_options' do - jvm_options = [ - '-Xms16g', - '-Xmx16g' - ] - - let(:params) do - default_params.merge( - :jvm_options => jvm_options - ) - end - - jvm_options.each do |jvm_option| - it { should contain_file_line("jvm_option_#{jvm_option}") - .with( - :ensure => 'present', - :path => '/etc/elasticsearch/jvm.options', - :line => jvm_option - )} - end - end - context 'with restart_on_change => true' do let(:params) do default_params.merge( @@ -368,17 +346,6 @@ it { should contain_file('/etc/elasticsearch/elasticsearch.yml') .that_notifies('Service[elasticsearch]')} end - - describe 'setting jvm_options triggers restart' do - let(:params) do - super().merge( - :jvm_options => ['-Xmx16g'] - ) - end - - it { should contain_file_line('jvm_option_-Xmx16g') - .that_notifies('Service[elasticsearch]')} - end end # This check helps catch dependency cycles. diff --git a/spec/defines/003_elasticsearch_template_spec.rb b/spec/defines/003_elasticsearch_template_spec.rb index 6c316b75e..ecad2bbe4 100644 --- a/spec/defines/003_elasticsearch_template_spec.rb +++ b/spec/defines/003_elasticsearch_template_spec.rb @@ -6,7 +6,7 @@ :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |os, facts| diff --git a/spec/defines/004_elasticsearch_plugin_spec.rb b/spec/defines/004_elasticsearch_plugin_spec.rb index 48a99af24..78a49c99f 100644 --- a/spec/defines/004_elasticsearch_plugin_spec.rb +++ b/spec/defines/004_elasticsearch_plugin_spec.rb @@ -8,7 +8,7 @@ :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |_os, facts| diff --git a/spec/defines/006_elasticsearch_script_spec.rb b/spec/defines/006_elasticsearch_script_spec.rb index 84414cd54..b66aa591d 100644 --- a/spec/defines/006_elasticsearch_script_spec.rb +++ b/spec/defines/006_elasticsearch_script_spec.rb @@ -17,7 +17,7 @@ class { "elasticsearch": :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |os, facts| diff --git a/spec/defines/009_elasticsearch_pipeline_spec.rb b/spec/defines/009_elasticsearch_pipeline_spec.rb index e2456fe9a..cae2f07d0 100644 --- a/spec/defines/009_elasticsearch_pipeline_spec.rb +++ b/spec/defines/009_elasticsearch_pipeline_spec.rb @@ -11,7 +11,7 @@ :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |os, facts| diff --git a/spec/defines/012_elasticsearch_index_spec.rb b/spec/defines/012_elasticsearch_index_spec.rb index 62596a2e3..31a5bd467 100644 --- a/spec/defines/012_elasticsearch_index_spec.rb +++ b/spec/defines/012_elasticsearch_index_spec.rb @@ -11,7 +11,7 @@ :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |os, facts| diff --git a/spec/defines/013_elasticsearch_snapshot_repository_spec.rb b/spec/defines/013_elasticsearch_snapshot_repository_spec.rb index 694859cc2..a4da34a95 100644 --- a/spec/defines/013_elasticsearch_snapshot_repository_spec.rb +++ b/spec/defines/013_elasticsearch_snapshot_repository_spec.rb @@ -6,7 +6,7 @@ :supported_os => [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['6'] + 'operatingsystemrelease' => ['7'] } ] ).each do |os, facts| diff --git a/spec/matrix.yml b/spec/matrix.yml index 929d7fcec..85f80a4e8 100644 --- a/spec/matrix.yml +++ b/spec/matrix.yml @@ -1,20 +1,14 @@ --- OS: - amazonlinux-1-x64 - - centos-6-x64 - centos-7-x64 - - debian-8-x64 - debian-9-x64 - oracle-6-x64 - oracle-7-x64 - - ubuntu-server-1404-x64 - ubuntu-server-1604-x64 PUPPET_VERSION: - "" - "~> 6.0" - - "~> 5.0" - - "~> 4.10.0" TEST_TYPE: - latest - 5.6.9 -# - snapshot