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

How to define discovery.zen.ping.unicast.hosts #426

Closed
UnderGreen opened this issue Jan 18, 2016 · 6 comments
Closed

How to define discovery.zen.ping.unicast.hosts #426

UnderGreen opened this issue Jan 18, 2016 · 6 comments

Comments

@UnderGreen
Copy link

I did't see documentation here about defining parameter discovery.zen.ping.unicast.hosts.
If I understood - need to define string like '["host1", "host2"]'. But I want to do it via chef search. I should write my own lwrp for this goal?

@martinb3
Copy link
Contributor

Hi @UnderGreen -- I apologize I didn't respond sooner. Right now, this is just a single string, e.g. host1, host2, .... There are some issues parsing YAML lists in ES itself, see #419 (as well as elastic/elasticsearch#13592 and elastic/elasticsearch#13954).

As far as using Chef search, this cookbook doesn't currently have an opinion about the best way to derive the list of unicast hosts. If we included a Chef search recipe that did so, we'd get into a few different problems -- how to find other nodes (tags? runlists? etc), should it be a default behavior, as well as how to override the behavior. We had this in a previous version and it was fraught with peril :)

@martinb3
Copy link
Contributor

I'd like to leave this open so we can provide an example in the docs of using Chef search, even if we don't provide an implementation 👍

@paulheijman
Copy link

This is how we do it at the moment:

default.rb
elk_nodes = '["' + search(:node, 'role:elasticsearch-datanode').map(&:ipaddress).sort.uniq.join('", "') + '"]'
elasticsearch_configure 'elasticsearch' do
    configuration ({
        'cluster.name' => 'cluster-01',
        'path.data' => '/es/data',
        'path.logs' => '/es/logs',
        'network.host' => '_bond0_',
        'discovery.zen.ping.multicast.enabled' => 'false',
        'discovery.zen.ping.unicast.hosts' => elk_nodes
    })
end

Make sure your chef nodes have the correct role (elasticsearch-datanode in this case). To verify which hosts are being included run
knife search node 'roles:elasticsearch-datanode'

@UnderGreen
Copy link
Author

Thank you!

@wheelq
Copy link

wheelq commented Oct 29, 2018

How does this work with password protected ES nodes?

@martinb3
Copy link
Contributor

martinb3 commented Nov 6, 2018

Hi @wheelq -- can you open a new issue? This one has been closed for more than 2 years. Please cite exactly what setting you're asking about, too. Thanks!

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

4 participants