Skip to content

Commit

Permalink
support es 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdamiano committed May 23, 2017
1 parent 0b253cc commit 0bf564d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
default.elasticsearch[:index][:mapper][:dynamic] = true
default.elasticsearch[:action][:auto_create_index] = true
default.elasticsearch[:action][:disable_delete_all_indices] = true
default.elasticsearch[:action][:destructive_requires_name] = true
default.elasticsearch[:node][:max_local_storage_nodes] = 1

default.elasticsearch[:discovery][:zen][:ping][:multicast][:enabled] = true
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
license "Apache"
description "Installs and configures elasticsearch"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.markdown'))
version "1.2.0"
version "5.0.0"

depends 'ark', '>= 0.2.4'

Expand Down
7 changes: 7 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

Chef::Log.debug "Installation mode #{node[:elasticsearch][:installation][:mode]}"

if node.elasticsearch[:esmajor] >= 5
default.elasticsearch[:bootstrap][:memory_lock] = node.elasticsearch[:bootstrap][:mlockall]
if node.elasticsearch[:limits][:nofile] < 65536
default.elasticsearch[:limits][:nofile] = 65536
end
end

if node[:elasticsearch][:installation][:mode] == 'pkg'
case node['platform']
when "ubuntu","debian"
Expand Down
16 changes: 15 additions & 1 deletion templates/default/elasticsearch.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
<%= print_value 'index.number_of_shards' -%>
<%= print_value 'index.number_of_replicas' -%>
<%= print_value 'index.auto_expand_replicas' -%>
<%= print_value 'index.mapper.dynamic' -%>
<%= print_value 'action.auto_create_index' -%>
<% if node.elasticsearch[:esmajor] < 1 %>
<%= print_value 'action.disable_delete_all_indices' -%>
<% else %>
<%= print_value 'action.destructive_requires_name' -%>
<% end %>

#################################### Paths ####################################

Expand All @@ -50,7 +53,12 @@

################################### Memory ####################################


<% if node.elasticsearch[:esmajor] < 5 %>
<%= print_value 'bootstrap.mlockall' -%>
<% else %>
<%= print_value 'bootstrap.memory_lock' -%>
<% end %>

############################## Network And HTTP ###############################

Expand Down Expand Up @@ -98,7 +106,9 @@

<%= print_value 'discovery.zen.minimum_master_nodes' -%>
<%= print_value 'discovery.zen.ping.timeout' -%>
<% if node[:elasticsearch][:esmajor].to_i < 2 %>
<%= print_value 'discovery.zen.ping.multicast.enabled' -%>
<% end %>
<%= print_value 'discovery.zen.ping.unicast.hosts' -%>

<%- if node.elasticsearch[:cloud] -%>
Expand All @@ -124,6 +134,9 @@ discovery.ec2.tag.<%= key %>: <%= value %>

################################## Slow Log ###################################


<% if node.elasticsearch[:esmajor] < 5 %>
<%= print_value 'index.mapper.dynamic' -%>
<%= print_value 'index.search.slowlog.threshold.query.warn' -%>
<%= print_value 'index.search.slowlog.threshold.query.info' -%>
<%= print_value 'index.search.slowlog.threshold.query.debug' -%>
Expand All @@ -138,6 +151,7 @@ discovery.ec2.tag.<%= key %>: <%= value %>
<%= print_value 'index.indexing.slowlog.threshold.index.info' -%>
<%= print_value 'index.indexing.slowlog.threshold.index.debug' -%>
<%= print_value 'index.indexing.slowlog.threshold.index.trace' -%>
<% end %>

################################## GC Logging #################################

Expand Down

0 comments on commit 0bf564d

Please sign in to comment.