Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Are custom configs required everywhere? #391

Closed
spuder opened this issue Nov 20, 2015 · 5 comments
Closed

Question - Are custom configs required everywhere? #391

spuder opened this issue Nov 20, 2015 · 5 comments
Milestone

Comments

@spuder
Copy link
Contributor

spuder commented Nov 20, 2015

I noticed the following comment

These are the default settings. Most of the time, you want to override

the configuration attribute below. If you do override the defaults, you

must supply ALL needed defaults, and don't use nil as a value in the hash.

https://github.com/elastic/cookbook-elasticsearch/blob/2.0.0_wip/libraries/resource_configure.rb#L76-L78

Does this mean that you need to supply all possible configs?

In other words, here only the cluster.name is set. Is that bad?

elasticsearch_configure 'nd-elasticsearch' do
  allocated_memory '123m'
  thread_stack_size '512k'

  gc_settings <<-CONFIG
                -XX:+UseParNewGC
                -XX:+UseConcMarkSweepGC
                -XX:CMSInitiatingOccupancyFraction=75
                -XX:+UseCMSInitiatingOccupancyOnly
                -XX:+HeapDumpOnOutOfMemoryError
                -XX:+PrintGCDetails
              CONFIG
  configuration ({
    'cluster.name' => node['nd-elasticsearch']['config']['cluster_name']
    })
  action :manage
end
@spuder
Copy link
Contributor Author

spuder commented Nov 20, 2015

As a side note, I find that the default values listed in the comments, aren't correct (atleast if using :package 📦 installation)

https://github.com/elastic/cookbook-elasticsearch/blob/2.0.0_wip/libraries/resource_configure.rb#L85-L87

@martinb3
Copy link
Contributor

That note is specifically on attribute(:default_configuration... (not the configuration attribute that you're asking about setting). It's saying that those defaults are merged with values you supply in attribute(:configuration.... If you override the entire default hash, you get zero default settings. If you override the configuration hash, you get those merged in on top of the defaults.

@martinb3
Copy link
Contributor

As a side note, I find that the default values listed in the comments, aren't correct (atleast if using :package 📦 installation)

You can see the default values that will be used here:
https://github.com/elastic/cookbook-elasticsearch/blob/2.0.0_wip/libraries/resource_configure.rb#L12-L40

Before packages existed, the default values were for the tarball (non-packaged) install. Some of the comments definitely need to be updated, but the code itself is accurate. Thank you for pointing that out -- I'll fix those comments before release.

@martinb3 martinb3 added the doc label Nov 21, 2015
@martinb3 martinb3 added this to the 2.0.0 release milestone Nov 21, 2015
@spuder
Copy link
Contributor Author

spuder commented Nov 21, 2015

Thanks for the info. As another side note, the correct paths in the packages were revealed when I commented out the lines in the recipe.

         +path.conf: /etc/elasticsearch
         +path.data: /usr/share/elasticsearch
         +path.logs: /var/log/elasticsearch

@martinb3
Copy link
Contributor

@spuder I'm not sure what you mean by your last update. When you commented out what lines and in which recipe? I only see links to libraries and an elasticsearch_configure recipe snippet that didn't contain any paths to start with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants