Unable to set number_of_replicas with Puppet ES module

(Alex Harvey) #1

I am trying to build a single-node Elasticsearch 6.3 cluster using the puppet-elasticsearch module.

In the past this worked fine when I declared:

elasticsearch::instance { 'es01':
  config        => {
    'index.number_of_replicas' => 0,

This is apparently no longer valid for ES >= 5.x

Accordingly I tried this:

elasticsearch::template { 'templatename':
  source  => 'puppet:///path/to/template.json',

And my template has:

  "settings": {
    "index": {
      "number_of_replicas": 0

(Amongst other stuff.)

That still doesn't work, and my cluster comes up in yellow state, and I can fix it on the command line using:

curl -XPUT -H'Content-Type: application/json' -d '{"index.number_of_replicas":0}'

If someone can tell me what I'm doing wrong it would be much appreciated.

(Tyler Langlois) #2

I think you may be missing index_patterns in your template to make it a valid index template?

An invalid index template should bubble up from the Puppet catalog run to indicate an invalid elasticsearch_template resource as well; does the Puppet run return any errors when you try and apply the template resource?

(Alex Harvey) #3

Yes, I was actually missing that field, among other problems. After fixing that, I then reverted to the latest default Logstash Elasticsearch 6.x output template, and then I had to fix some quoting, as I documented in this bug here: https://github.com/elastic/puppet-elasticsearch/issues/957 This issue here could be closed.

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.