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9
- 3.4.8
- 3.4.7
- 3.4.6
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.2.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.3.14
- 0.3.13
- 0.3.12
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.7
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.0
Installs and configures Elasticsearch
cookbook 'elasticsearch', '= 1.0.0', :supermarket
knife supermarket install elasticsearch
knife supermarket download elasticsearch
Elasticsearch Chef Cookbook
This cookbook has been converted into a library cookbook as of version 1.0.0,
and supports Chef 12.x and higher. It implements supports CI as well as more
modern testing with chefspec and test-kitchen. It no longer supports some of
the more extraneous features such as discovery (use chef search
in your wrapper cookbook) or EBS device creation (use
the aws cookbook).
The previous version of this cookbook may be found in the 0.3.x branch.
Recipes
default
The default recipe creates an elasticsearch user and group with the default
options.
Resources
elasticsearch_user
Actions: :create
, :remove
Creates a user and group on the system for use by elasticsearch. Here is an
example with many of the default options and default values (all options except
a resource name may be omitted):
elasticsearch_user 'elasticsearch' do username 'elasticsearch' groupname 'elasticsearch' homedir '/usr/local/elasticsearch' shell '/bin/bash' comment 'Elasticsearch User' action :create end
elasticsearch_install
Actions: :install
, :remove
Downloads the elasticsearch software, and unpacks it on the system. There are
currently two ways to install -- package
, which downloads the appropriate
package from elasticsearch.org and uses the package manager to install it, and
tarball
which downloads a tarball from elasticsearch.org and unpacks it in
/usr/local on the system. The resource name is not used for anything in
particular. This resource also comes with a :remove
action which will remove
the package or directory elasticsearch was unpacked into.
Examples:
elasticsearch_install 'my_es_installation' do
type :tarball # type of install
dir '/usr/local' # where to install
owner 'elasticsearch' # user and group to install under
group 'elasticsearch'
tarball_url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.tar.gz"
tarball_checksum "acf572c606552bc446cceef3f8e93814a363ba0d215b323a2864682b3abfbe45"
action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
type :tarball # type of install
version '1.5.0'
action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
type :package # type of install
package_url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.deb"
package_checksum "15a02a2bea74da2330bb78718efb3a8f83a2b2e040a6ee859e100a6556981f36"
action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
type :package # type of install
version "1.5.0"
action :install # could be :remove as well
end
elasticsearch_configure
Actions: :manage
, :remove
Configures an elasticsearch instance; creates directories for configuration,
logs, and data. Writes files logging.yml, elasticsearch.in.sh and
elasticsearch.yml.
The main attribute for this resource is configuration
,
which is a hash of any elasticsearch configuration directives. The
other important attribute is default_configuration
-- this contains the
minimal set of required defaults.
Note that these are both not a Chef mash, everything must be in a single level
of keys and values. Any settings you pass in configuration will be merged into
(and potentially overwrite) any default settings.
See the examples, [as well as the attributes in the resource file](libraries/resource_configure.rb),
for more.
Examples:
With all defaults -
elasticsearch_configure 'elasticsearch'
More complicated -
```
elasticsearch_configure 'my_elasticsearch' do
dir '/usr/local/awesome'
user 'foo'
group 'bar'
logging({:"action" => 'INFO'})
allocated_memory '123m'
thread_stack_size '512k'
env_options '-DFOO=BAR'
gc_settings <<-CONFIG
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintGCDetails
CONFIG
configuration ({
'node.name' => 'crazy'
})
action :manage
end
```
elasticsearch_service
Actions: :configure
, :remove
Writes out a system service configuration of the appropriate type, and enables
it to start on boot. You can override almost all of the relevant settings in
such a way that you may run multiple instances.
elasticsearch_service 'elasticsearch'
elasticsearch_service 'elasticsearch-crazy' do
node_name 'crazy'
path_conf '/usr/local/awesome/etc/elasticsearch'
pid_path '/usr/local/awesome/var/run'
user 'foo'
group 'bar'
end
elasticsearch_plugin
Actions: :install
, :remove
Installs or removes a plugin to a given elasticsearch instance and plugin
directory.
elasticsearch_plugin 'mobz/elasticsearch-head' do
plugin_dir '/usr/local/awesome/elasticsearch-1.5.0/plugins'
end
Testing
This cookbook is equipped with both unit tests (chefspec) and integration tests
(test-kitchen and serverspec). It also comes with rubocop and foodcritic tasks
in the supplied Rakefile. Contributions to this cookbook should include tests
for new features or bugfixes, with a preference for unit tests over integration
tests to ensure speedy testing runs. All tests and most other commands here
should be run using bundler and our standard Gemfile. This ensures that
contributions and changes are made in a standardized way against the same
versions of gems. We recommend installing rubygems-bundler so that bundler is
automatically inserting bundle exec
in front of commands run in a directory
that contains a Gemfile.
A full test run of all tests and style checks would look like:
bash
$ bundle exec rake style
$ bundle exec rake spec
$ bundle exec rake integration
$ bundle exec rake destroy
The final destroy is intended to clean up any systems that failed a test, and is
mostly useful when running with kitchen drivers for cloud providers, so that no
machines are left orphaned and costing you money.
Fixtures
This cookbook supplies a few different test fixtures (under test/fixtures/
)
that can be shared amongst any number of unit or integration tests: cookbooks,
environments, and nodes. Environments and nodes are automatically loaded into
chef-zero for both chefspec tests that run locally and serverspec tests that run
from test-kitchen.
It also contains 'platform data' that can be used to drive unit testing, for
example, you might read httpd
for some platforms and apache2
for others,
allowing you to write a single test for the Apache webserver. Unfortunately,
without further modifications to busser
and busser-serverspec
, the platform
data will not be available to serverspec tests.
Style and Best Practices
Rubocop and Foodcritic evaluations may be made by running rake style
. There
are no overrides for foodcritic rules, however the adjustments to
rubocop are made using the supplied .rubocop.yml
file and have been documented
by comments within. Most notably, rubocop has been restricted to only apply to
.rb
files.
Rubocop and foodcritic tests can be executed using rake style
.
Unit testing
Unit testing is done using the latest versions of Chefspec. The current default
test layout includes running against all supported platforms, as well as
stubbing data into chef-zero. This allows us to also test against chef search.
As is currently a best practice in the community, we will avoid the use of
chef-solo, but not create barriers to explicitly fail for chef-solo.
Unit tests can be executed using rake spec
.
Integration testing
Integration testing is accomplished using the latest versions of test-kitchen
and serverspec. Currently, this cookbook uses the busser-serverspec plugin for
copying serverspec files to the system being tested. There is some debate in the
community about whether this should be done using busser-rspec instead, and each
busser plugin has a slightly different feature set.
While the default test-kitchen configuration uses the vagrant driver, you may
override this using ~/.kitchen/config.yml
or by placing a .kitchen.local.yml
in the current directory. This allows you to run these integration tests using
any supported test-kitchen driver (ec2, rackspace, docker, etc).
Integration tests can be executed using rake integration
or kitchen test
.
License
This software is licensed under the Apache 2 license, quoted below.
Copyright (c) 2015 Elasticsearch
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
apt ~> 2.7.0 |
yum ~> 3.6.1 |
chef-sugar ~> 3.1.0 |
curl ~> 2.0.1 |
poise ~> 2.0.1 |
ark ~> 0.9.0 |
Contingent cookbooks
Change Log
Unreleased
v1.0.0 (2015-07-16)
Implemented enhancements:
Fixed bugs:
- Travis CI not running on PRs from local branches #337
- Error executing action
install
on resource 'elasticsearch_install' #335
Closed issues:
- Document requirement on Chef 12+ #338
Merged pull requests:
- Add lots of additional documentation #343 (martinb3)
- Add contribution guidelines #342 (martinb3)
- Run CI on master branch again, after rename #341 (martinb3)
- Rename provider source to tarball #340 (martinb3)
v0.3.14 (2015-07-16)
Implemented enhancements:
- NEXT: Model YML config after 'trim' config #322
- NEXT: Create a user resource and provider #269
- If bootstrap.mlockall is true, MAX_LOCKED_MEMORY should be set to unlimited in elasticsearch-env.sh #266
- Installation enhancement #222
Fixed bugs:
- Plugins defined in databag do not get installed #89
Closed issues:
- There is no customize recipe #326
- ES not starting when setting version to 1.5.2 or 1.6.0 #325
- Question - Does cookbook support rolling restarts? #315
- Loading attributes from the data DBI #313
- 0.3.13: service doesn't successfully start #312
- Restart doesn't work the first time if a stale PID exists #310
- Cannot install plugin 2.4.1 #308
- Proxy recipe should include nginx only based on configurabe attribute #307
- Queue capacity #301
- strange behavior with docker :bug: #300
- Vagrant: Undefined method 'provider' #298
- Error after upgrading the cookbook #297
- Setting version triggers java.lang.NoClassDefFoundError #296
- Elasticsearch running but not from service #290
- Elasticsearch throws ElasticsearchIllegalStateException on boot (time based instance) #288
- Prefix Definitions #285
- strange thinks happend if I override elasticsearch version #283
- Chef::Mixin::Template::TemplateError on new ssl attributes #281
- The 0.3.13 release is missing the metadata.rb file #279
- berks upload fails due to .DS_Store files found in 0.3.12 package on supermarket.chef.io #278
- 0.3.11 release #277
- Berkshelf treats 'recommends' as 'depends' #275
- Init Script + Existing PID File #274
- Version change doesn't work #273
- Please add an option to specify the desired shell to pass to the su command #260
- Attaching EBS takes a very long time and doesn't finish? #259
- 1.3.4 startup hangs for 10min and fails #257
- Plugin installation skipping #252
- Can't get Rake task to work (either dependencies or installing Berkshelf) #244
- Don't include build-essential just to be sure apt is up to date #241
- how to specify max_map_count? #239
- Nginx HTTP, Basic Auth and multiple nodes #238
- Installing Marvel #237
- Need help with creating EBS Volume #223
- If elasticsearch fails to extract, it won't be installed later #221
- uninitialized constant Extensions during Vagrant provisioning #212
- config.vm.provider not recognised using Vagrant 1.5.4 #207
- The Vagrant installation instructions are outdated #206
- How to specify path.data and path.logs? #202
- Cannot upgrade from 0.0.92 to 1.0.1 #197
- install_plugin fails to run on initial install #176
- EBS volume clean up #172
- Cookbook default attributes get lifted to normal priority #168
- Fog doesn't respect "delete_on_termination" option in elasticsearch::ebs #146
Merged pull requests:
- Use package options on both providers #336 (martinb3)
- allow options passing to package provider #329 (scalp42)
- set default resource actions #327 (nathwill)
- Add a note about
next
branch #324 (martinb3) - Introduce provider and resource for configure #316 (martinb3)
- First pass at install resource and two providers #309 (martinb3)
v0.3.13 (2015-01-13)
0.3.12 (2015-01-13)
Closed issues:
- Guidance On Upgrading A Running ES Installation #271
- Supermarket release? #262
- version check always adds '-d' flag incorrectly. #255
- Version 0.3.11 not available on supermarket #250
- Missed multicast settings in template #248
- Data bags for test? #246
Merged pull requests:
- Introduce user provider and resource #268 (martinb3)
- First pass at framework with testing, rake, etc #249 (martinb3)
0.3.11 (2014-10-13)
Fixed bugs:
- The init script should use the Chef embedded Ruby? #215
- Quick Fix for version update issues #178
- Don't seem to be able to change the version #100
Closed issues:
- Multiple EBS mounting #232
- Just changing elasticsearch version attribute doesn't install intended version #225
- plugins not being loaded #171
0.3.10 (2014-06-19)
Closed issues:
- Single node cofiguration #220
- can we use apt_repository resource to install a particular version #217
- Version attribute effect on download_url is misleading #214
- Make config template configurable #153
0.3.9 (2014-05-22)
Closed issues:
- 1.1.1 doesn't work #210
- Why does this cookbook set the es max heap size to 60% of available memory? #209
- Failure when adding elasticsearch service #204
- New release? #203
0.3.8 (2014-03-27)
Fixed bugs:
- Avoid using
recommends "monit"
in metadata.rb #162 - Problem with ownership of pid in /var/run/ on restart of ubuntu #108
Closed issues:
- SSL support with Nginx proxy #226
- Compatibility with 1.0.1 #195
- pid_path is owned by elasticsearch #193
- [Install plugin: merge!] (elasticsearch::plugins line 35) #187
- Cookbook doesn't work with 1.0.0RCx versions - Startup broken based on behavior change #185
- Failure to locate 'elasticsearch.conf.erb' template #184
- Question on attributes "methodology" #180
- print_value docs don't mention elasticsearch #169
- update readme file with default attributes #166
- Index template config files #164
- Issues configuring unicast cluster #158
- elasticsearch default /usr/local/elasticsearch is no good for elasticsearch-env.sh #157
0.3.7 (2013-10-28)
0.3.5 (2013-10-27)
Closed issues:
- ES Logging Not Working #151
Merged pull requests:
0.3.4 (2013-10-01)
Closed issues:
- first install with plugins fails #138
- Custom Params for init.d start #134
- elasticsearch-cloud-aws plugin - fails to install, restarts service anyway #131
- init script - improvements needed #130
- Configure HTTP port range #129
- Elasticsearch fails to start with 0.90.3 and cloud-aws 1.12.0 #126
- Install plugin failure does not stop script execution #124
- search_discovery causes unnecessary restarts #122
- chef-solo needs the 'cookbook' folder to have the same name as the cookbook #121
- Plugins not working if aws recipe is used #105
0.3.3 (2013-08-01)
Fixed bugs:
- BREAKING: Fog version does not create EBS volumes properly #94
Closed issues:
- ulimit settings not used with start-stop-daemon #109
- mismatch in aws endpoint attributes #106
- Elasticsearch service restart at each chef run #104
- Installation fails: Error executing action
start
on resource 'service[elasticsearch]' #96
0.3.2 (2013-08-01)
Closed issues:
- role attributes ignored? #112
- Mismatched Data Dir permissions #111
- Changing nofile attribute is not idempotent #101
- Configure unicast_hosts dynamically on non-AWS clusters via
search
#40
0.3.1 (2013-06-18)
0.3.0 (2013-06-10)
Closed issues:
- Fog >= 1.11.0 breaks run with elasticsearch::ebs #93
- elasticsearch::ebs fails if apt package cache is out of date #88
- Document bare minimum configuration for default recipe #87
- Centos 5 / RHEL 5 Support #86
- Proxy recipe has hardcoded localhost which fails if elasticsearch is not bound to that IP #85
- AJAX requests and nginx proxy #84
- Readme link to Chef-solo+elasticsearch tutorial doesn't work #83
- You must set ES_CLASSPATH var #82
- Setting a custom installation directory doesn't work #79
0.2.7 (2013-03-18)
0.2.6 (2013-03-08)
Closed issues:
0.2.5 (2013-03-01)
Closed issues:
- Elasticsearch with node.client set to true #71
0.2.4 (2013-02-27)
0.2.3 (2013-02-27)
Closed issues:
- When updating versions, the wrong version can be installed unless you manually clear node attributes (chef server only) #69
- The version of elasticsearch can only be set via elasticsearch/settings databag #68
0.2.2 (2013-02-26)
0.2.1 (2013-02-26)
Closed issues:
- Unable to change elasticsearch version via role and version tag #61
- Creating new ebs volume is taking forever #60
0.2.0 (2013-02-01)
Closed issues:
0.1.0 (2013-01-28)
0.0.1 (2013-01-28)
Fixed bugs:
- Update Gists for Ark change #28
Closed issues:
- Conflict with nginx cookbook #46
- version bump the metadata #42
- elasticsearch::test doesn't work in ec2 with chef server #41
- Nginx rpm install doesn't support chunkin module #38
0.0.6 (2013-01-15)
Closed issues:
- Cannot find a resource for create_ebs on amazon version 2012.09 #44
0.0.5 (2012-12-20)
Closed issues:
- Add
discovery.ec2.tag
and similar to elasticsearch.yml #36 - Add support for setting cloud.aws.region using node.json #33
- Elasticsearch doesn't start after run 'sudo chef-client' over knife ssh #32
- Can't find Monit template? #29
- Monit doesn't start after machine reboot #14
- Probable bugs in install_plugin.rb #12
0.0.4 (2012-10-15)
0.0.3 (2012-10-14)
Closed issues:
- min_mem should be the same as max_mem #35
- The
elasticsearch::proxy\_nginx
should declare dependency onnginx
cookbook #24 - Appears to install nginx even in cases when it's not requested (no proxy) #23
0.0.2 (2012-08-18)
Closed issues:
- -Xss128k is too low #25
- Ubuntu Tests Failing #22
- getting an error trying to install plugin #21
- you must set ES_CLASSPATH #20
- Need a more comprehensive max_mem calculation #15
- Missing support for status command of the elasticsearch service #11
- Discovery settings in elasticsearch.yml.erb #9
- Monit issues (template file name, internal issues) #8
- Align elasticsearch-env.sh.erb with elasticsearch.in.sh #3
* This Change Log was automatically generated by github_changelog_generator
Foodcritic Metric
1.0.0 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:28
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:32
FC002: Avoid string interpolation where not required: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/provider_user.rb:31
FC002: Avoid string interpolation where not required: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/provider_user.rb:32
FC019: Access node attributes in a consistent manner: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:8
FC019: Access node attributes in a consistent manner: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:19
FC031: Cookbook without metadata file: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/metadata.rb:1
1.0.0 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:32
FC002: Avoid string interpolation where not required: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/provider_user.rb:31
FC002: Avoid string interpolation where not required: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/provider_user.rb:32
FC019: Access node attributes in a consistent manner: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:8
FC019: Access node attributes in a consistent manner: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/libraries/helpers.rb:19
FC031: Cookbook without metadata file: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/aef3cb18654658556e4871d3/elasticsearch/metadata.rb:1