Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

elasticsearch (91) Versions 1.2.0

Installs and configures Elasticsearch

Policyfile
Berkshelf
Knife
cookbook 'elasticsearch', '= 1.2.0', :supermarket
cookbook 'elasticsearch', '= 1.2.0'
knife supermarket install elasticsearch
knife supermarket download elasticsearch
README
Dependencies
Changelog
Quality 100%

Elasticsearch Chef Cookbook

This cookbook has been converted into a library cookbook as of version 1.0.0,
and supports Chef 12.4.1, 12.3.0, 12.2.1, and higher. It implements support for
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.

Default version, download URLs, and checksums

Please consult [attributes/default.rb](attributes/default.rb) for these values.
Both the recipes and resources/providers here source their default values for
Elasticsearch version, download URL, and Checksum from attributes/default.rb.

Please take note that you may use %s in your URL and this cookbook will use
sprintf/format to insert the version parameter as a string into your
download_url.

You may adjust the node attributes to force this cookbook to use different
default values for all three settings.

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).

Examples:

elasticsearch_user 'elasticsearch'
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.

You may always specify a download_url and/or download_checksum, and you may
include %s which will be replaced by the version parameter you supply.

Please be sure to consult the above section 'Default version, download URLs,
and checksums' as that controls how Elasticsearch version, download URL and
checksum are determined if you omit them.

Examples:

elasticsearch_install 'elasticsearch'
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'

  download_url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.2.tar.gz"
  # sha256
  download_checksum "6f81935e270c403681e120ec4395c28b2ddc87e659ff7784608b86beb5223dd2"

  action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
  type :tarball # type of install
  version '1.7.2'
  action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
  type :package # type of install
  download_url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.2.deb"
  # sha256
  download_checksum "791fb9f2131be2cf8c1f86ca35e0b912d7155a53f89c2df67467ca2105e77ec2"
  action :install # could be :remove as well
end
elasticsearch_install 'my_es_installation' do
  type :package # type of install
  version "1.7.2"
  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
# if you override one of these, you probably want to override all
dir '/usr/local/awesome'
path_conf "/usr/local/awesome/etc/elasticsearch"
path_data "/usr/local/awesome/var/data/elasticsearch"
path_logs "/usr/local/awesome/var/log/elasticsearch"

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. Please note that there is currently no way to upgrade an existing
plugin using commandline tools, so we haven't exposed that feature here either.
Furthermore, there isn't a way to determine if a plugin is compatible with ES or
even what version it is. So once we install a plugin to a directory, we
generally assume that is the desired one and we don't touch it further.

See https://github.com/elastic/cookbook-elasticsearch/issues/264 for more info.

When running a single instance per machine (VM, etc), it's typically
sufficient to rely on the default value of plugin_dir:

elasticsearch_plugin 'mobz/elasticsearch-head'

To run multiple instances per machine, an explicit plugin_dir location
has to be provided:

elasticsearch_plugin 'mobz/elasticsearch-head' do
  plugin_dir '/usr/local/awesome/elasticsearch-1.7.2/plugins'
end

NB: You may encounter issues on certain distros with NSS 3.16.1 and OpenJDK 7.x.

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

ark >= 0.0.0
apt >= 0.0.0
yum >= 0.0.0
chef-sugar >= 0.0.0
curl >= 0.0.0

Contingent cookbooks

apache-log-analysis Applicable Versions
askbot Applicable Versions
bigdesk Applicable Versions
chamber-kibana Applicable Versions
elastic Applicable Versions
elasticsearch-head Applicable Versions
elk Applicable Versions
elkstack Applicable Versions
et_elk Applicable Versions
nodestack Applicable Versions
paramount Applicable Versions
platformstack Applicable Versions
puncha-kibana Applicable Versions
sudo_elastic Applicable Versions
zammad Applicable Versions

Change Log

Unreleased

1.2.0 (2015-10-16)

Full Changelog

Closed issues:

  • Compile error w/ 1.0.3 and Chef Server 12 #379
  • OS X Support #358
  • Dealing with plugin versions that don't match, Elasticsearch failing to start #330
  • ruby command not found #378

Merged pull requests:

1.0.3 (2015-09-20)

Full Changelog

Closed issues:

  • 1.0.2 Issues with pid files #374

1.0.2 (2015-09-20)

Full Changelog

Implemented enhancements:

  • enhancement : attribut path_xxx and path.xxx #352
  • It would be nice to be able to pass options to elasticsearch_service #334

Closed issues:

  • elasticsearch_install broken with v1.0.1 #371
  • Compile Error #370
  • wrong number of arguments (1 for 0) #369
  • missing chef resource expectations in specs in 1.0.1 #367
  • Rubocop & foodcritic cleanup #365

Merged pull requests:

1.0.1 (2015-09-15)

Full Changelog

Implemented enhancements:

  • Plugin resource's plugin_dir should have a sensible default #345

Fixed bugs:

  • Elasticsearch user homedir deleted #328

Closed issues:

  • Use predictable attributes/values for version, download URL, and checksum #366
  • elasticsearch_plugin installs plugins with the wrong permissions #363
  • Double-dependency on curl #360
  • poise dependency not found #356
  • Documentation for using JSON node configuration #355
  • Hardcoded checksums in library helpers #350
  • Document default values for all resources #348
  • 1.0 should have sensible documentation #344

Merged pull requests:

  • Adds integration test for plugins in default environment #361 (bwvoss)
  • Clarify when overriding plugin_dir is necessary #349 (michaelklishin)
  • Remove duplicate node.max_local_storage_nodes setting from the config template #346 (eheydrick)

v1.0.0 (2015-07-16)

Full Changelog

Implemented enhancements:

  • Rename source method of install #332
  • NEXT: Document the process for submitting PRs #270

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:

v0.3.14 (2015-07-16)

Full Changelog

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:

v0.3.13 (2015-01-13)

Full Changelog

0.3.12 (2015-01-13)

Full Changelog

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:

0.3.11 (2014-10-13)

Full Changelog

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)

Full Changelog

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)

Full Changelog

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)

Full Changelog

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)

Full Changelog

0.3.5 (2013-10-27)

Full Changelog

Closed issues:

  • ES Logging Not Working #151

Merged pull requests:

  • Adding Debian specific init script #98 (remkade)

0.3.4 (2013-10-01)

Full Changelog

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)

Full Changelog

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)

Full Changelog

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)

Full Changelog

0.3.0 (2013-06-10)

Full Changelog

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)

Full Changelog

0.2.6 (2013-03-08)

Full Changelog

Closed issues:

  • Broken attempted aws plugin installation by default #76
  • Using setup with ELB #70

0.2.5 (2013-03-01)

Full Changelog

Closed issues:

  • Elasticsearch with node.client set to true #71

0.2.4 (2013-02-27)

Full Changelog

0.2.3 (2013-02-27)

Full Changelog

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)

Full Changelog

0.2.1 (2013-02-26)

Full Changelog

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)

Full Changelog

Closed issues:

  • Failing installation test on master #56
  • Error message when running start script #48

0.1.0 (2013-01-28)

Full Changelog

0.0.1 (2013-01-28)

Full Changelog

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)

Full Changelog

Closed issues:

  • Cannot find a resource for create_ebs on amazon version 2012.09 #44

0.0.5 (2012-12-20)

Full Changelog

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)

Full Changelog

0.0.3 (2012-10-14)

Full Changelog

Closed issues:

  • min_mem should be the same as max_mem #35
  • The elasticsearch::proxy\_nginx should declare dependency on nginx 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.2.0 passed this metric