Git Product home page Git Product logo

puppet-elasticsearch's Introduction

Elasticsearch Puppet Module

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs Apache-2 License Donated by Elastic

Table of Contents

  1. Module description - What the module does and why it is useful
  2. Setup - The basics of getting started with Elasticsearch
  1. Usage - Configuration options and additional functionality
  2. Advanced features - Extra information on advanced usage
  3. Reference - An under-the-hood peek at what the module is doing and how
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module
  6. Support - When you need help with this module
  7. Transfer Notice

Module description

This module sets up Elasticsearch instances with additional resource for plugins, templates, and more.

This module is actively tested against Elasticsearch 2.x, 5.x, and 6.x.

WARNING: The 7.x major release of this module contains breaking changes!

In order to simplify the management of Elasticsearch moving forward, and add support for both Elasticsearch 6.x and 7.x, support for running multiple instances of Elasticsearch has been removed.

This module also does not currently handle the migration from the instance based configuration to the new single deployment model. Therefore in-place upgrades from version 6.x of this module to 7.x, or migrations from multi-instance to single deployment is not currently supported. We hope to add support for this in a future release.

Therefore please ensure that you test this major release in your environment before using it in production!

Setup

The module manages the following

  • Elasticsearch repository files.
  • Elasticsearch package.
  • Elasticsearch configuration file.
  • Elasticsearch service.
  • Elasticsearch plugins.
  • Elasticsearch snapshot repositories.
  • Elasticsearch templates.
  • Elasticsearch ingest pipelines.
  • Elasticsearch index settings.
  • Elasticsearch users, roles, and certificates.
  • Elasticsearch licenses.
  • Elasticsearch keystores.

Requirements

Beginning with Elasticsearch 7.0.0, a Java JDK has been bundled as part of the elasticsearch package. However there still needs to be a version of Java present on the system being managed in order for Puppet to be able to run various utilities. We recommend managing your Java installation with the puppetlabs-java module.

Repository management

When using the repository management, the following module dependencies are required:

Beginning with Elasticsearch

Declare the top-level elasticsearch class (managing repositories) and set up an instance:

include ::java

class { 'elasticsearch': }

Usage

Main class

Most top-level parameters in the elasticsearch class are set to reasonable defaults. The following are some parameters that may be useful to override:

Install a specific version

class { 'elasticsearch':
  version => '7.9.3'
}

Note: This will only work when using the repository.

Automatically restarting the service (default set to false)

By default, the module will not restart Elasticsearch when the configuration file, package, or plugins change. This can be overridden globally with the following option:

class { 'elasticsearch':
  restart_on_change => true
}

Or controlled with the more granular options: restart_config_change, restart_package_change, and restart_plugin_change.

Automatic upgrades (default set to false)

class { 'elasticsearch':
  autoupgrade => true
}

Removal/Decommissioning

class { 'elasticsearch':
  ensure => 'absent'
}

Install everything but disable service(s) afterwards

class { 'elasticsearch':
  status => 'disabled'
}

API Settings

Some resources, such as elasticsearch::template, require communicating with the Elasticsearch REST API. By default, these API settings are set to:

class { 'elasticsearch':
  api_protocol            => 'http',
  api_host                => 'localhost',
  api_port                => 9200,
  api_timeout             => 10,
  api_basic_auth_username => undef,
  api_basic_auth_password => undef,
  api_ca_file             => undef,
  api_ca_path             => undef,
  validate_tls            => true,
}

Each of these can be set at the top-level elasticsearch class and inherited for each resource or overridden on a per-resource basis.

Dynamically Created Resources

This module supports managing all of its defined types through top-level parameters to better support Hiera and Puppet Enterprise. For example, to manage an index template directly from the elasticsearch class:

class { 'elasticsearch':
  templates => {
    'logstash' => {
      'content' => {
        'template' => 'logstash-*',
        'settings' => {
          'number_of_replicas' => 0
        }
      }
    }
  }
}

Plugins

This module can help manage a variety of plugins. Note that module_dir is where the plugin will install itself to and must match that published by the plugin author; it is not where you would like to install it yourself.

From an official repository

elasticsearch::plugin { 'x-pack': }

From a custom url

elasticsearch::plugin { 'jetty':
  url => 'https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-1.2.1.zip'
}

Using a proxy

You can also use a proxy if required by setting the proxy_host and proxy_port options:

elasticsearch::plugin { 'lmenezes/elasticsearch-kopf',
  proxy_host => 'proxy.host.com',
  proxy_port => 3128
}

Proxies that require usernames and passwords are similarly supported with the proxy_username and proxy_password parameters.

Plugin name formats that are supported include:

  • elasticsearch/plugin/version (for official elasticsearch plugins downloaded from download.elastic.co)
  • groupId/artifactId/version (for community plugins downloaded from maven central or OSS Sonatype)
  • username/repository (for site plugins downloaded from github master)

Upgrading plugins

When you specify a certain plugin version, you can upgrade that plugin by specifying the new version.

elasticsearch::plugin { 'elasticsearch/elasticsearch-cloud-aws/2.1.1': }

And to upgrade, you would simply change it to

elasticsearch::plugin { 'elasticsearch/elasticsearch-cloud-aws/2.4.1': }

Please note that this does not work when you specify 'latest' as a version number.

ES 6.x and 7.x official plugins

For the Elasticsearch commercial plugins you can refer them to the simple name.

See Plugin installation for more details.

Scripts

Installs scripts to be used by Elasticsearch. These scripts are shared across all defined instances on the same host.

elasticsearch::script { 'myscript':
  ensure => 'present',
  source => 'puppet:///path/to/my/script.groovy'
}

Script directories can also be recursively managed for large collections of scripts:

elasticsearch::script { 'myscripts_dir':
  ensure  => 'directory,
  source  => 'puppet:///path/to/myscripts_dir'
  recurse => 'remote',
}

Templates

By default templates use the top-level elasticsearch::api_* settings to communicate with Elasticsearch. The following is an example of how to override these settings:

elasticsearch::template { 'templatename':
  api_protocol            => 'https',
  api_host                => $::ipaddress,
  api_port                => 9201,
  api_timeout             => 60,
  api_basic_auth_username => 'admin',
  api_basic_auth_password => 'adminpassword',
  api_ca_file             => '/etc/ssl/certs',
  api_ca_path             => '/etc/pki/certs',
  validate_tls            => false,
  source                  => 'puppet:///path/to/template.json',
}

From version 7.8 elasticserch provides a new composable templates functionality, both legacy templates api and new composable templates api are supported using different data types.

Data types & defines

For legacy templates template is used.

For composable templates component_template and index_template are used.

Both types can be used at the same time

Add a new template using a file

This will install and/or replace the template in Elasticsearch:

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

Add a new template using content

This will install and/or replace the template in Elasticsearch:

elasticsearch::template { 'templatename':
  content => {
    'template' => "*",
    'settings' => {
      'number_of_replicas' => 0
    }
  }
}

Plain JSON strings are also supported.

elasticsearch::template { 'templatename':
  content => '{"template":"*","settings":{"number_of_replicas":0}}'
}

Delete a template

elasticsearch::template { 'templatename':
  ensure => 'absent'
}

Ingestion Pipelines

Pipelines behave similar to templates in that their contents can be controlled over the Elasticsearch REST API with a custom Puppet resource. API parameters follow the same rules as templates (those settings can either be controlled at the top-level in the elasticsearch class or set per-resource).

Adding a new pipeline

This will install and/or replace an ingestion pipeline in Elasticsearch (ingestion settings are compared against the present configuration):

elasticsearch::pipeline { 'addfoo':
  content => {
    'description' => 'Add the foo field',
    'processors' => [{
      'set' => {
        'field' => 'foo',
        'value' => 'bar'
      }
    }]
  }
}

Delete a pipeline

elasticsearch::pipeline { 'addfoo':
  ensure => 'absent'
}

Index Settings

This module includes basic support for ensuring an index is present or absent with optional index settings. API access settings follow the pattern previously mentioned for templates.

Creating an index

At the time of this writing, only index settings are supported. Note that some settings (such as number_of_shards) can only be set at index creation time.

elasticsearch::index { 'foo':
  settings => {
    'index' => {
      'number_of_replicas' => 0
    }
  }
}

Delete an index

elasticsearch::index { 'foo':
  ensure => 'absent'
}

Snapshot Repositories

By default snapshot_repositories use the top-level elasticsearch::api_* settings to communicate with Elasticsearch. The following is an example of how to override these settings:

elasticsearch::snapshot_repository { 'backups':
  api_protocol            => 'https',
  api_host                => $::ipaddress,
  api_port                => 9201,
  api_timeout             => 60,
  api_basic_auth_username => 'admin',
  api_basic_auth_password => 'adminpassword',
  api_ca_file             => '/etc/ssl/certs',
  api_ca_path             => '/etc/pki/certs',
  validate_tls            => false,
  location                => '/backups',
}

Delete a snapshot repository

elasticsearch::snapshot_repository { 'backups':
  ensure   => 'absent',
  location => '/backup'
}

SLM (Snapshot Lifecycle Management)

By default SLM use the top-level elasticsearch::api_* settings to communicate with Elasticsearch. The following is an example of how to override these settings:

elasticsearch::slm_policy { 'policiyname':
  api_protocol            => 'https',
  api_host                => $::ipaddress,
  api_port                => 9201,
  api_timeout             => 60,
  api_basic_auth_username => 'admin',
  api_basic_auth_password => 'adminpassword',
  api_ca_file             => '/etc/ssl/certs',
  api_ca_path             => '/etc/pki/certs',
  validate_tls            => false,
  source                  => 'puppet:///path/to/policy.json',
}

Add a new SLM policy using a file

This will install and/or replace the SLM policy in Elasticsearch:

elasticsearch::slm_policy { 'policyname':
  source => 'puppet:///path/to/policy.json',
}

Add a new SLM policy using content

This will install and/or replace ILM policy in Elasticsearch:

elasticsearch::slm_policy { 'policyname':
  content => {
    name       => '<backup-{now/d}>',
    schedule   => '0 30 1 * * ?',
    repository => 'backup',
    config     => { },
    retention  => {
      expire_after => '60d',
      min_count    => 2,
      max_count    => 10
    }
  }
}

ILM (Index Lifecycle Management)

By default ILM use the top-level elasticsearch::api_* settings to communicate with Elasticsearch. The following is an example of how to override these settings:

elasticsearch::ilm_policy { 'policiyname':
  api_protocol            => 'https',
  api_host                => $::ipaddress,
  api_port                => 9201,
  api_timeout             => 60,
  api_basic_auth_username => 'admin',
  api_basic_auth_password => 'adminpassword',
  api_ca_file             => '/etc/ssl/certs',
  api_ca_path             => '/etc/pki/certs',
  validate_tls            => false,
  source                  => 'puppet:///path/to/policy.json',
}

Add a new ILM policy using a file

This will install and/or replace the ILM policy in Elasticsearch:

elasticsearch::ilm_policy { 'policyname':
  source => 'puppet:///path/to/policy.json',
}

Add a new ILM policy using content

This will install and/or replace ILM policy in Elasticsearch:

elasticsearch::ilm_policy { 'policyname':
  content => {
    policy => {
      phases => {
        warm => {
          min_age => "7d"
          actions => {
            forcemerge => {
              max_num_segments => 1
            }
          }
        }
      }
    }
  }
}

Delete an ILM policy

This will install and/or replace the ILM policy in Elasticsearch:

elasticsearch::ilm_policy { 'policyname':
  ensure => 'absent',
}

Connection Validator

This module offers a way to make sure an instance has been started and is up and running before doing a next action. This is done via the use of the es_instance_conn_validator resource.

es_instance_conn_validator { 'myinstance' :
  server => 'es.example.com',
  port   => '9200',
}

A common use would be for example :

class { 'kibana4' :
  require => Es_Instance_Conn_Validator['myinstance'],
}

Package installation

There are two different ways of installing Elasticsearch:

Repository

Choosing an Elasticsearch major version

This module uses the elastic/elastic_stack module to manage package repositories. Because there is a separate repository for each major version of the Elastic stack, selecting which version to configure is necessary to change the default repository value, like this:

class { 'elastic_stack::repo':
  version => 6,
}

class { 'elasticsearch':
  version => '6.8.12',
}

This module defaults to the upstream package repositories, which as of Elasticsearch 6.3, includes X-Pack. In order to use the purely OSS (open source) package and repository, the appropriate oss flag must be set on the elastic_stack::repo and elasticsearch classes:

class { 'elastic_stack::repo':
  oss => true,
}

class { 'elasticsearch':
  oss => true,
}
Manual repository management

You may want to manage repositories manually. You can disable automatic repository management like this:

class { 'elasticsearch':
  manage_repo => false,
}

Remote package source

When a repository is not available or preferred you can install the packages from a remote source:

http/https/ftp
class { 'elasticsearch':
  package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.deb',
  proxy_url   => 'http://proxy.example.com:8080/',
}

Setting proxy_url to a location will enable download using the provided proxy server. This parameter is also used by elasticsearch::plugin. Setting the port in the proxy_url is mandatory. proxy_url defaults to undef (proxy disabled).

puppet://
class { 'elasticsearch':
  package_url => 'puppet:///path/to/elasticsearch-1.4.2.deb'
}
Local file
class { 'elasticsearch':
  package_url => 'file:/path/to/elasticsearch-1.4.2.deb'
}

JVM Configuration

When configuring Elasticsearch's memory usage, you can modify it by setting jvm_options:

class { 'elasticsearch':
  jvm_options => [
    '-Xms4g',
    '-Xmx4g'
  ]
}

Service management

Currently only the basic SysV-style init and Systemd service providers are supported, but other systems could be implemented as necessary (pull requests welcome).

Defaults File

The defaults file (/etc/defaults/elasticsearch or /etc/sysconfig/elasticsearch) for the Elasticsearch service can be populated as necessary. This can either be a static file resource or a simple key value-style hash object, the latter being particularly well-suited to pulling out of a data source such as Hiera.

File source
class { 'elasticsearch':
  init_defaults_file => 'puppet:///path/to/defaults'
}
Hash representation
$config_hash = {
  'ES_HEAP_SIZE' => '30g',
}

class { 'elasticsearch':
  init_defaults => $config_hash
}

Note: init_defaults hash can be passed to the main class and to the instance.

Advanced features

Security

File-based users, roles, and certificates can be managed by this module.

Note: If you are planning to use these features, it is highly recommended you read the following documentation to understand the caveats and extent of the resources available to you.

Roles

Roles in the file realm can be managed using the elasticsearch::role type. For example, to create a role called myrole, you could use the following resource:

elasticsearch::role { 'myrole':
  privileges => {
    'cluster' => [ 'monitor' ],
    'indices' => [{
      'names'      => [ '*' ],
      'privileges' => [ 'read' ],
    }]
  }
}

This role would grant users access to cluster monitoring and read access to all indices. See the Security documentation for your version to determine what privileges to use and how to format them (the Puppet hash representation will simply be translated into yaml.)

Note: The Puppet provider for elasticsearch_user has fine-grained control over the roles.yml file and thus will leave the default roles in-place. If you would like to explicitly purge the default roles (leaving only roles managed by puppet), you can do so by including the following in your manifest:

resources { 'elasticsearch_role':
  purge => true,
}
Mappings

Associating mappings with a role for file-based management is done by passing an array of strings to the mappings parameter of the elasticsearch::role type. For example, to define a role with mappings:

elasticsearch::role { 'logstash':
  mappings   => [
    'cn=group,ou=devteam',
  ],
  privileges => {
    'cluster' => 'manage_index_templates',
    'indices' => [{
      'names'      => ['logstash-*'],
      'privileges' => [
        'write',
        'delete',
        'create_index',
      ],
    }],
  },
}

If you'd like to keep the mappings file purged of entries not under Puppet's control, you should use the following resources declaration because mappings are a separate low-level type:

resources { 'elasticsearch_role_mapping':
  purge => true,
}

Users

Users can be managed using the elasticsearch::user type. For example, to create a user mysuser with membership in myrole:

elasticsearch::user { 'myuser':
  password => 'mypassword',
  roles    => ['myrole'],
}

The password parameter will also accept password hashes generated from the esusers/users utility and ensure the password is kept in-sync with the Shield users file for all Elasticsearch instances.

elasticsearch::user { 'myuser':
  password => '$2a$10$IZMnq6DF4DtQ9c4sVovgDubCbdeH62XncmcyD1sZ4WClzFuAdqspy',
  roles    => ['myrole'],
}

Note: When using the esusers/users provider (the default for plaintext passwords), Puppet has no way to determine whether the given password is in-sync with the password hashed by Elasticsearch. In order to work around this, the elasticsearch::user resource has been designed to accept refresh events in order to update password values. This is not ideal, but allows you to instruct the resource to change the password when needed. For example, to update the aforementioned user's password, you could include the following your manifest:

notify { 'update password': } ~>
elasticsearch::user { 'myuser':
  password => 'mynewpassword',
  roles    => ['myrole'],
}

Certificates

SSL/TLS can be enabled by providing the appropriate class params with paths to the certificate and private key files, and a password for the keystore.

class { 'elasticsearch' :
  ssl                  => true,
  ca_certificate       => '/path/to/ca.pem',
  certificate          => '/path/to/cert.pem',
  private_key          => '/path/to/key.pem',
  keystore_password    => 'keystorepassword',
}

Note: Setting up a proper CA and certificate infrastructure is outside the scope of this documentation, see the aforementioned security guide for more information regarding the generation of these certificate files.

The module will set up a keystore file for the node to use and set the relevant options in elasticsearch.yml to enable TLS/SSL using the certificates and key provided.

System Keys

System keys can be passed to the module, where they will be placed into individual instance configuration directories. This can be set at the elasticsearch class and inherited across all instances:

class { 'elasticsearch':
  system_key => 'puppet:///path/to/key',
}

Licensing

If you use the aforementioned security features, you may need to install a user license to leverage particular features outside of a trial license. This module can handle installation of licenses without the need to write custom exec or curl code to install license data.

You may instruct the module to install a license through the elasticsearch::license parameter:

class { 'elasticsearch':
  license => $license,
}

The license parameter will accept either a Puppet hash representation of the license file json or a plain json string that will be parsed into a native Puppet hash. Although dependencies are automatically created to ensure that the Elasticsearch service is listening and ready before API calls are made, you may need to set the appropriate api_* parameters to ensure that the module can interact with the Elasticsearch API over the appropriate port, protocol, and with sufficient user rights to install the license.

The native provider for licenses will not print license signatures as part of Puppet's changelog to ensure that sensitive values are not included in console output or Puppet reports. Any fields present in the license parameter that differ from the license installed in a cluster will trigger a flush of the resource and new POST to the Elasticsearch API with the license content, though the sensitive signature field is not compared as it is not returned from the Elasticsearch licensing APIs.

Data directories

There are several different ways of setting data directories for Elasticsearch. In every case the required configuration options are placed in the elasticsearch.yml file.

Default

By default we use:

/var/lib/elasticsearch

Which mirrors the upstream defaults.

Single global data directory

It is possible to override the default data directory by specifying the datadir param:

class { 'elasticsearch':
  datadir => '/var/lib/elasticsearch-data'
}

Multiple Global data directories

It's also possible to specify multiple data directories using the datadir param:

class { 'elasticsearch':
  datadir => [ '/var/lib/es-data1', '/var/lib/es-data2']
}

See the Elasticsearch documentation for additional information regarding this configuration.

Elasticsearch configuration

The config option can be used to provide additional configuration options to Elasticsearch.

Configuration writeup

The config hash can be written in 2 different ways:

Full hash writeup

Instead of writing the full hash representation:

class { 'elasticsearch':
  config                 => {
   'cluster'             => {
     'name'              => 'ClusterName',
     'routing'           => {
        'allocation'     => {
          'awareness'    => {
            'attributes' => 'rack'
          }
        }
      }
    }
  }
}
Short hash writeup
class { 'elasticsearch':
  config => {
    'cluster' => {
      'name' => 'ClusterName',
      'routing.allocation.awareness.attributes' => 'rack'
    }
  }
}

Keystore Settings

Recent versions of Elasticsearch include the elasticsearch-keystore utility to create and manage the elasticsearch.keystore file which can store sensitive values for certain settings. The settings and values for this file can be controlled by this module. Settings follow the behavior of the config parameter for the top-level Elasticsearch class and elasticsearch::instance defined types. That is, you may define keystore settings globally, and all values will be merged with instance-specific settings for final inclusion in the elasticsearch.keystore file. Note that each hash key is passed to the elasticsearch-keystore utility in a straightforward manner, so you should specify the hash passed to secrets in flattened form (that is, without full nested hash representation).

For example, to define cloud plugin credentials for all instances:

class { 'elasticsearch':
  secrets => {
    'cloud.aws.access_key' => 'AKIA....',
    'cloud.aws.secret_key' => 'AKIA....',
  }
}
Purging Secrets

By default, if a secret setting exists on-disk that is not present in the secrets hash, this module will leave it intact. If you prefer to keep only secrets in the keystore that are specified in the secrets hash, use the purge_secrets boolean parameter either on the elasticsearch class to set it globally or per-instance.

Notifying Services

Any changes to keystore secrets will notify running elasticsearch services by respecting the restart_on_change and restart_config_change parameters.

Reference

Class parameters are available in the auto-generated documentation pages. Autogenerated documentation for types, providers, and ruby helpers is also available on the same documentation site.

Limitations

This module is built upon and tested against the versions of Puppet listed in the metadata.json file (i.e. the listed compatible versions on the Puppet Forge).

The module has been tested on:

  • Amazon Linux 1/2
  • Debian 8/9/10
  • CentOS 7/8
  • OracleLinux 7/8
  • Ubuntu 16.04, 18.04, 20.04
  • SLES 12

Testing on other platforms has been light and cannot be guaranteed.

Development

Please see the CONTRIBUTING.md file for instructions regarding development environments and testing.

Support

The Puppet Elasticsearch module is community supported and not officially supported by Elastic Support.

Transfer Notice

This module was originally authored by Elastic. The maintainer preferred that Vox Pupuli take ownership of the module for future improvement and maintenance. Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Elastic.

puppet-elasticsearch's People

Contributors

1n avatar acaire avatar bastelfreak avatar baurmatt avatar brucem avatar buzzdeee avatar dansajner avatar electrical avatar fatmcgav avatar flantz avatar ghoneycutt avatar h-haaks avatar hex2a avatar hikerspath avatar igalic avatar jakski avatar jlambert121 avatar kobybr avatar kuermel avatar martinseener avatar mbornoz avatar memberit avatar phaedriel avatar smortex avatar sp-joseluis-ledesma avatar spuder avatar stjmt avatar towo avatar tylerjl avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-elasticsearch's Issues

install curator

Would it be an idea to install curator alongside elasticsearch ? Probably as an option, disabled by default. Not sure if this would belong here or in the puppet-logstash module, actually.

The point is that most people using elasticsearch with logstash probably need & want curator, so I think it makes sense to make its installation and configuration part of the same bundle.

I just wanted to have this discussed... Maybe you have other/better suggestions ?

Thanks !

Plugin directory is not created before plugins are installed

The plugin directory is not required before plugins are installed so the first Puppet run doesn't always work:

(/Stage[main]/Elasticsearch::Plugin[elasticsearch/elasticsearch-cloud-aws/2.1.0]/Exec[install_plugin_elasticsearch/elasticsearch-cloud-aws/2.1.0]/returns) -> Installing elasticsearch/elasticsearch-cloud-aws/2.1.0...
(/Stage[main]/Elasticsearch::Plugin[elasticsearch/elasticsearch-cloud-aws/2.1.0]/Exec[install_plugin_elasticsearch/elasticsearch-cloud-aws/2.1.0]/returns) Failed to install elasticsearch/elasticsearch-cloud-aws/2.1.0, reason: plugin directory /usr/share/elasticsearch/plugins is read only
/usr/share/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.1.0 returned 74 instead of one of [0]
(/Stage[main]/Elasticsearch::Plugin[elasticsearch/elasticsearch-cloud-aws/2.1.0]/Exec[install_plugin_elasticsearch/elasticsearch-cloud-aws/2.1.0]/returns) change from notrun to 0 failed: /usr/share/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.1.0 returned 74 instead of one of [0]
(/Stage[main]/Elasticsearch::Config/File[/usr/share/elasticsearch/plugins]/ensure) created

Subsequent runs work. Possibly with the change to installing plugins as the Elasticsearch user the plugin directory can't be created automatically now.

Add force option to template define

The force option will allow you to replace the template in elasticsearch even if the json file it self hasn't been replaced.
Any use for this?

Dependency Cycle Error

When testing I noticed that the following setting caused a dependency error.

$ensure = 'absent'

Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/elasticsearch/elasticsearch.yml] => Class[Elasticsearch::Service] => File[/etc/sysconfig/elasticsearch] => Class[Elasticsearch::Service] => Class[Elasticsearch::Package] => Package[elasticsearch] => Class[Elasticsearch::Package] => File[/etc/elasticsearch/elasticsearch.yml])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz

I was just testing a build and wanted to remove the software before re-installing.

operatingsystem => OracleLinux
operatingsystemrelease => 6.3
puppetversion => 3.2.3

Latest version of elasticsearch can't be installed

I've installed your package under Vagrant and tried to install elasticsearch 0.90.2 on a precise64 box with a configuration like this:

class { 'elasticsearch':
  version => '0.90.2'
}

During vagrant provision i get this error:

err: /Stage[main]/Elasticsearch::Package/Package[elasticsearch]/ensure: change from purged to 0.90.2 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install elasticsearch=0.90.2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package elasticsearch
 at /tmp/vagrant-puppet/modules-0/elasticsearch/manifests/package.pp:82

I have to admit that i'm quite new to puppet, so maybe i miss a basic step. But isn't the main idea that the module should take care of the complete installation process and add apt repos if neccessary?

Sorry if this is an invalid bug. I'd appreciate any help.

Module does not install on CentOS

Tried provisioning a blank Vagrant box (CentOS 6.2 x64) and get the following error:

err: /Stage[main]/Elasticsearch::Package/Package[elasticsearch]/ensure: change from absent to present failed: 

Execution of '/usr/bin/yum -d 0 -e 0 -y install elasticsearch' returned 1: Error: Nothing to do

This makes sense, since when I try simply running "yum install elasticsearch" inside the VM it returns "Nothing to do."

Any tips for proceeding with CentOS?

Input validation for the init file parameters

Following the discussion of this PR:
https://github.com/electrical/puppet-elasticsearch/issues/21

Set of variables should be based on:
https://github.com/elasticsearch/elasticsearch/blob/master/src/deb/default/elasticsearch
https://github.com/elasticsearch/elasticsearch/blob/master/src/rpm/sysconfig/elasticsearch

From what I know, there is no official RPM provided by elasticsearch and therefore I don't understand why the above file (rpm/sysconfig/elasticsearch) is not based on the same variables names as Debian? I see some differences.

Perhaps we should start by having a single reference file for all distributions?

@electrical what do you think?

service provider init required on ubuntu when using elasticsearch installed from deb

otherwise start/stop/status does not work.

diff -wurN ../testing/elasticsearch/manifests/service.pp ../development/elasticsearch/manifests/service.pp
--- ../testing/elasticsearch/manifests/service.pp 2013-02-16 14:07:41.000000000 +1100
+++ ../development/elasticsearch/manifests/service.pp 2013-02-19 18:05:08.762583248 +1100
@@ -80,6 +80,7 @@
hasstatus => $elasticsearch::params::service_hasstatus,
hasrestart => $elasticsearch::params::service_hasrestart,
pattern => $elasticsearch::params::service_pattern,

  • provider => init,
    }

}

Setting a value to false is commented out.

Reported on IRC:

[10:09.54] Electrical: quick question about puppet-elasticsearch. what's the reasoning behind- commenting out lines if the value is false?
[10:11.30] surfichris: hi. in which part?
[10:12.18] specifically this: https://github.com/electrical/puppet-elasticsearch/blob/master/templates/etc/ elasticsearch/elasticsearch.yml.erb#L6
[10:13.00] just curious about the context - i just switched my new infra over to your module (yay), but- for defaults that are true (i.e, node.data), me setting the value to false just results in the default being used
[10:13.02] if that makes sense
[10:13.11] (because it's commented out)


Think its because of the if statement that is in the template.

using init_defaults introduces augeas module as dependency

If I'm doing something like

class { 'elasticsearch':
  init_defaults => {
    'ES_MIN_MEM' => '1gb',
    'ES_MAX_MEM' => '1gb',
  },
}

Then puppet apply fails for my saying that it doesnt find a provider for augeas because this module uses it internally to set these config values. Either we put this in the README or add the module camptocamp/augeas to the dependencies. What do you think?

💖

Two nodes running on host after clean install on Ubuntu 12

After removing the existing installation and installing a new one using puppet, I sometimes get two nodes running after the install completes. The pid file matches the second node, not the first. From the debug logs of the puppet agent, it looks like after the initial start, the pidfile is not created or is incorrect, and the '/etc/init.d/elasticsearch status' check fails, which seems to trigger starting the second copy. Debug log attached.

Installing on Ubuntu 10.04 fails

I tried to use this module, but it fails with this error:
Error: /Stage[main]/Elasticsearch::Service/Service[elasticsearch]: Could not evaluate: Could not find init script for 'elasticsearch'

My puppet version is 3.2.4.

config.pp -> mkdir_templates should have a path

It'd be good to have a path set in mkdir_templates to avoid errors if there aren't default paths specified elsewhere.

I think the following line should sort it:
path => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],

Jetty plugin install fails on subsequent runs

I'm trying to install the Jetty plugin for Elasticsearch, so I have the following in my manifests, (as per the example):

elasticsearch::plugin { "elasticsearch-jetty":
    module_dir => "elasticsearch-jetty",
    url        => "https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.0.zip",
}

This seems to work fine on the first run to install the plugin, but on subsequent runs I get the following error:

(/Stage[main]//Node[elasticsearch.example.com]/Elasticsearch::Plugin[elasticsearch-jetty]/Exec[install-plugin-elasticsearch-jetty]/returns) -> Installing elasticsearch-jetty...
(/Stage[main]//Node[elasticsearch.example.com]/Elasticsearch::Plugin[elasticsearch-jetty]/Exec[install-plugin-elasticsearch-jetty]/returns) Failed to install elasticsearch-jetty, reason: plugin directory /usr/share/elasticsearch/plugins/jetty already exists. To update the plugin, uninstall it first using -remove elasticsearch-jetty command
/usr/share/elasticsearch/bin/plugin -install elasticsearch-jetty -url https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.0.zip returned 74 instead of one of [0,1]
(/Stage[main]//Node[elasticsearch.example.com]/Elasticsearch::Plugin[elasticsearch-jetty]/Exec[install-plugin-elasticsearch-jetty]/returns) change from notrun to 0 1 failed: /usr/share/elasticsearch/bin/plugin -install elasticsearch-jetty -url https://oss-es-plugins.s3.amazonaws.com/elasticsearch-jetty/elasticsearch-jetty-0.90.0.zip returned 74 instead of one of [0,1]
(/Stage[main]/Elasticsearch::Service/Elasticsearch::Service::Init[elasticsearch]/Service[elasticsearch]) Dependency Exec[install-plugin-elasticsearch-jetty] has failures: true
(/Stage[main]/Elasticsearch::Service/Elasticsearch::Service::Init[elasticsearch]/Service[elasticsearch]) Skipping because of failed dependencies
(/Stage[main]/Elasticsearch/Anchor[elasticsearch::end]) Dependency Exec[install-plugin-elasticsearch-jetty] has failures: true
(/Stage[main]/Elasticsearch/Anchor[elasticsearch::end]) Skipping because of failed dependencies
Finished catalog run in 0.98 seconds

I'm using Elasticsearch 0.90.7 via the vendor RPM.

spec/fixtures/modules/boilerplate

File "spec/fixtures/modules/boilerplate" is a symlink to your homedir: /home/richard/puppet/modules/shared/elasticsearch. Could you maybe share (or remove) this file?

Add support for supplying other repositories

At the moment when using the repo management it only allows to use our official repo's.
Could come handy at some point for people to supply their own repo servers ( for large setups for example )

Tag next release

Are there any issues blocking a new release? Currently v 0.1.2 is failing completely with puppet version 3.2.4 on Ubuntu.

init_defaults doesn't work properly with java opts values

One of the configs that can be set in the elasticsearch defaults file is ES_JAVA_OPTS. There are 2 issues in this module that cause settings this variable to fail.

First, I think there need to be quotes around the value in the set command - i.e. "set ES_JAVA_OPTS "values here". Right now there are no quotes.

Second, even with quotes it appears the shellvars lens doesn't like the java opts value - probably because there are spaces in it. Being able to set java_opts in this file is critical for us so we can add some GC and JMX options.

Problem using init_defaults with Fedora

Hi,
I have used the module under ubuntu without any problem, using most of the features. Today, under Fedora, I have realized that there are some problems with the init_defaults parameter:

Under ubuntu this configuration is OK:
class { 'elasticsearch':
package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb',
init_defaults => { 'ES_USER' => 'elasticsearch', 'ES_GROUP' => 'elasticsearch' },
}

Running the equivalent under Fedora I got this this error on /var/log/messages:
class { 'elasticsearch':
package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.noarch.rpm',
init_defaults => { 'ES_USER' => 'elasticsearch', 'ES_GROUP' => 'elasticsearch' },
}

Jan 31 18:46:19 localhost systemd[1]: Reloading.
Jan 31 18:46:19 localhost systemd[1]: [/etc/systemd/system/elasticsearch.service:3] Unknown lvalue 'Documentation' in section 'Unit'. Ignoring.
Jan 31 18:46:19 localhost puppet-agent[31868]: (/Stage[main]/Elasticsearch::Service/Elasticsearch::Service::Init[elasticsearch]/Service[elasticsearch]/enable) enable changed 'false' to 'true'
Jan 31 18:46:20 localhost systemd[1]: elasticsearch.service: main process exited, code=exited, status=143
Jan 31 18:46:20 localhost systemd[1]: Unit elasticsearch.service entered failed state.
Jan 31 18:46:20 localhost systemd[1]: PID file /var/run/elasticsearch/elasticsearch.pid not readable (yet?) after start.
Jan 31 18:46:20 localhost puppet-agent[31868]: (/Stage[main]/Elasticsearch::Service/Elasticsearch::Service::Init[elasticsearch]/Service[elasticsearch]) Triggered 'refresh' from 1 events
Jan 31 18:46:21 localhost puppet-agent[31868]: Finished catalog run in 12.80 seconds
Jan 31 18:46:21 localhost elasticsearch[32224]: [2014-01-31 18:46:21,708][WARN ][bootstrap ] jvm uses the client vm, make sure to run java with the server vm for best performance by adding -server to the command line
Jan 31 18:48:53 localhost dhclient[564]: DHCPREQUEST on p2p1 to 10.1.3.19 port 67 (xid=0x374c8d46)
Jan 31 18:48:53 localhost dhclient[564]: DHCPACK from 10.1.3.19 (xid=0x374c8d46)
Jan 31 18:48:53 localhost dhclient[564]: Invalid domain list.
Jan 31 18:48:53 localhost dhclient[564]: suspect value in domain_search option - discarded
Jan 31 18:48:53 localhost dhclient[564]: Invalid domain list.
Jan 31 18:48:53 localhost dhclient[564]: suspect value in domain_search option - discarded
Jan 31 18:48:53 localhost dhclient[564]: Invalid domain list.
Jan 31 18:48:53 localhost dhclient[564]: bound to 10.16.0.92 -- renewal in 5426 seconds.
Jan 31 18:54:28 localhost puppet-agent[32270]: Caching catalog for agent2.search.euromoneyplc.com
Jan 31 18:54:28 localhost puppet-agent[32270]: Applying configuration version '1391190866'
Jan 31 18:54:32 localhost puppet-agent[32270]: (/File[/etc/sysconfig/elasticsearch]/content)
Jan 31 18:54:32 localhost puppet-agent[32270]: FileBucket got a duplicate file {md5}a8f534391bb68fd7c0634f4929ee18ba
Jan 31 18:54:32 localhost puppet-agent[32270]: (/File[/etc/sysconfig/elasticsearch]) Filebucketed /etc/sysconfig/elasticsearch to puppet with sum a8f534391bb68fd7c0634f4929ee18ba
Jan 31 18:54:33 localhost puppet-agent[32270]: (/File[/etc/sysconfig/elasticsearch]/content) content changed '{md5}a8f534391bb68fd7c0634f4929ee18ba' to '{md5}e44f7de19044ffc94dce31df4024283e'
Jan 31 18:54:33 localhost puppet-agent[32270]: (/File[/etc/sysconfig/elasticsearch]) Scheduling refresh of Service[elasticsearch]
Jan 31 18:54:33 localhost systemd[1]: elasticsearch.service: main process exited, code=exited, status=143
Jan 31 18:54:33 localhost systemd[1]: Unit elasticsearch.service entered failed state.
Jan 31 18:54:33 localhost systemd[1]: PID file /var/run/elasticsearch/elasticsearch.pid not readable (yet?) after start.
Jan 31 18:54:34 localhost puppet-agent[32270]: (/Stage[main]/Elasticsearch::Service/Elasticsearch::Service::Init[elasticsearch]/Service[elasticsearch]) Triggered 'refresh' from 1 events
Jan 31 18:54:34 localhost puppet-agent[32270]: Finished catalog run in 5.81 seconds
Jan 31 18:54:34 localhost elasticsearch[32558]: {0.90.10}: Setup Failed ...
Jan 31 18:54:34 localhost elasticsearch[32558]: - SettingsException[Failed to load settings from [file:/]]
Jan 31 18:54:34 localhost elasticsearch[32558]: JsonParseException[Unrecognized token 'bin': was expecting
Jan 31 18:54:34 localhost elasticsearch[32558]: at [Source: bin
Jan 31 18:54:34 localhost elasticsearch[32558]: boot
Jan 31 18:54:34 localhost elasticsearch[32558]: dev
Jan 31 18:54:34 localhost elasticsearch[32558]: etc
Jan 31 18:54:34 localhost elasticsearch[32558]: home
Jan 31 18:54:34 localhost elasticsearch[32558]: install
Jan 31 18:54:34 localhost elasticsearch[32558]: lib
Jan 31 18:54:34 localhost elasticsearch[32558]: lost+found
Jan 31 18:54:34 localhost elasticsearch[32558]: media
Jan 31 18:54:34 localhost elasticsearch[32558]: mnt
Jan 31 18:54:34 localhost elasticsearch[32558]: opt
Jan 31 18:54:34 localhost elasticsearch[32558]: proc
Jan 31 18:54:34 localhost elasticsearch[32558]: root
Jan 31 18:54:34 localhost elasticsearch[32558]: run
Jan 31 18:54:34 localhost elasticsearch[32558]: sbin
Jan 31 18:54:34 localhost elasticsearch[32558]: srv
Jan 31 18:54:34 localhost elasticsearch[32558]: sys
Jan 31 18:54:34 localhost elasticsearch[32558]: tmp
Jan 31 18:54:34 localhost elasticsearch[32558]: usr
Jan 31 18:54:34 localhost elasticsearch[32558]: var
Jan 31 18:54:34 localhost elasticsearch[32558]: ; line: 1, column: 4]]
Jan 31 18:54:34 localhost systemd[1]: elasticsearch.service: main process exited, code=exited, status=3
Jan 31 18:54:34 localhost systemd[1]: Unit elasticsearch.service entered failed state.

I have spend all the day without being able to sort out from the problem.
It looks like some strings are not in the correct Json format, but I haven't been able to discover more..
Thanks
Niccolo'

Manage templates in ES

Possibility to manage Templates.

Adding from json file
Replacing from json file
Remove template from ES

data directory setting ignored

I'm trying to set the data directory path, but it seems to be ignored. Here's my current settings:

/etc/elasticsearch/elasticsearch.yml

### MANAGED BY PUPPET ###

---
path:
  data: /usr/local/elasticsearch/data

when I try to start elasticsearch:

$ sudo service elasticsearch start
$ log4j:WARN No appenders could be found for logger (node).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
{0.90.2}: Initialization Failed ...
- ElasticSearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/usr/share/elasticsearch/data/elasticsearch]]
        IOException[failed to obtain lock on /usr/share/elasticsearch/data/elasticsearch/nodes/49]
                IOException[Cannot create directory: /usr/share/elasticsearch/data/elasticsearch/nodes/49]

You can see it's referencing the default /usr/share/elasticsearch and not my custom setting.

I'm running CentOS 6.4. The init script references $DATA_DIR. I'm not sure if this needs to be set at the top of the init script, or if it should be set in some other elasticsearch config?

Thanks!

elasticsearch.yml content overwritten

$ puppet --version
2.7.11
$ puppet agent -t
[...]
info: Applying configuration version '1382691240'
notice: /Stage[main]/Elasticsearch::Config/File[/etc/elasticsearch/elasticsearch.yml]/content: 
--- /etc/elasticsearch/elasticsearch.yml        2013-10-25 09:28:35.347013788 +0000
+++ /tmp/puppet-file20131025-30659-i56xx9-0     2013-10-25 09:59:47.335013627 +0000
@@ -1 +1,4 @@
 ### MANAGED BY PUPPET ###
+---
+network: 
+  host: 127.0.0.1

info: FileBucket got a duplicate file {md5}3f3f7990c4393603160cf4c8b3232b0d
info: /Stage[main]/Elasticsearch::Config/File[/etc/elasticsearch/elasticsearch.yml]: Filebucketed /etc/elasticsearch/elasticsearch.yml to puppet with sum 3f3f7990c4393603160cf4c8b3232b0d
notice: /Stage[main]/Elasticsearch::Config/File[/etc/elasticsearch/elasticsearch.yml]/content: content changed '{md5}3f3f7990c4393603160cf4c8b3232b0d' to '{md5}e51927159a0cd681bf03d0e55577fc45'
info: /Stage[main]/Elasticsearch::Config/File[/etc/elasticsearch/elasticsearch.yml]: Scheduling refresh of Class[Elasticsearch::Service]
info: Class[Elasticsearch::Service]: Scheduling refresh of Service[elasticsearch]
notice: /Stage[main]/Elasticsearch::Service/Service[elasticsearch]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 18.71 seconds

Provider must have features 'versionable' to set

Based on this issue #44 with the 0.2.0 version I'm getting the following error

Error: Parameter ensure failed on Package[elasticsearch]: Provider must have features 'versionable' to set 'ensure' to '0.90.10' at /etc/puppet/modules/elasticsearch/manifests/package.pp:143
Wrapped exception:
Provider must have features 'versionable' to set 'ensure' to '0.90.10'

With the following configuration:

class { 'elasticsearch':
   package_url => 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb'
 }

dpkg provider is not versionable

Specifying the version does not work with the dpkg provider (it is not versionable) on Ubuntu/Debian systems. This:

class { "elasticsearch": 
  version => "0.90.2",
}

results in this:

Error: Parameter ensure failed on Package[elasticsearch]: Provider must have features 'versionable' to set 'ensure' to '0.90.2' at /tmp/vagrant-puppet/modules-0/elasticsearch/manifests/package.pp:111

Missing config hash

I'm getting this error when trying to use the Elasticsearch module.

Error: Missing config hash at /tmp/vagrant-puppet-1/modules-0/elasticsearch/manifests/init.pp:240 on node awesome.dev

I'm using CentoOS and haven't a clue what to do to remove this error. Can anyone help?

Default user / group not written to /etc/sysconfig/elasticsearch

Currently, it appears that /etc/sysconfig/elasticsearch is only written out with the values passed in for init_defaults, meaning that user and group are not defined if not provided explicitly (such as when using the defaults). This seems to cause the initscript to fail starting the service, as $ES_USER is not defined prior to the call to daemon.

This causes the following message when attempting to start the service via the initscript:

$ service elasticsearch start
Starting elasticsearch: runuser: unrecognized option '--pidfile'
Try `runuser --help' for more information.

This is triggered by templates/etc/init.d/elasticsearch.RedHat.erb, line 85.

I can work around it for now by handing ES_USER in init_defaults, but it seems like it's necessary to make sure that it is set properly in advance of launching the daemon in the initscript.

README is incorrect

The readme suggests the class can be implemented without parameters, yet the config parameter is required.

Need to add more testing

Rspec tests

None planned yet

System tests

  • When using a remote package via package_url
    • http source
      • Run twice for idom check
      • Check if package is installed correctly
    • local file source
      • Run twice for idom check
      • Check if package is installed correctly
    • puppet source
      • Run twice for idom check
      • Check if package is installed correctly

Could not apply complete catalogue

I have found the issue where really don't know how move forward. I have read the issue https://github.com/electrical/puppet-elasticsearch/issues/39 which helped me a lot but look at this please:

err: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/default/elasticsearch] => Class[Elasticsearch::Service] => Class[Elasticsearch::Package] => File[/tmp/elasticsearch-0.90.3.deb] => Class[Elasticsearch::Package] => File[/etc/elasticsearch/elasticsearch.yml] => Class[Elasticsearch::Service] => File[/etc/default/elasticsearch])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz

Thanks

Allow shorter keys in the config hash

Currently the config hash needs to be completely written out like

{ 'cluster' => { 'name' => 'somename', 'routing' => { 'allocation' => { 'awareness' => { 'attributes' => 'rack' } } } } }

Would be nice if we can rewrite that to:

{ 'cluster' => { 'name' => 'somename', 'routing.allocation.awareness.attributes' => 'rack' } }

Puppet 3.2 requires the qualification or path of executables

Error: Failed to apply catalog: Validation of Exec[mkdir_templates] failed: 'mkdir -p /etc/elasticsearch/templates_import' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/modules/elasticsearch/manifests/config.pp:57

[Discussion] multi-instance support

Im thinking of adding multi instance support to this module when people have hardware that are strong enough to run more then 1 instance.

Any specific functions that would need to be in there?

In some cases /etc/elasticsearch dir doesn't exists

Reported on IRC

err: /Stage[main]/Elasticsearch::Config/File[/etc/elasticsearch/elasticsearch.yml]/ensure: change from absent to file failed: Could not set 'file on ensure: No such file or-
directory - /etc/elasticsearch/elasticsearch.yml.puppettmp_6029 at /etc/puppet/modules/elasticsearch/manifests/config.pp:42

Solution: Make sure we manage the existence of that directory just in case.

Change default port 9200

Hello, all,

I'm deploying an elasticsearch service. However, I would like to change the default port 9200 that kibana is connecting to a different value. I saw this in the README but it doesn't address my needs:

 elasticsearch::template { ’templatename’:
   host => $::ipaddress,
   port => 9200
 }

The file that needs changed is /etc/elasticsearch/elasticsearch.yml and the "http.port = xyz" added to it.
Does the recipe come with the capability to change the default port?

Plugins installed with wrong permissions

I just attempted to install Marvel with the following:

elasticsearch::plugin {
    'elasticsearch/marvel/latest':
        module_dir  => 'marvel'
}

It installed the plugin files into the proper place (/usr/share/elasticsearch/plugins), however, everything gets created and owned by the root user, so ES is unable to load the plugin. In fact, ES won't start up at all with the following:

[2014-03-26 17:17:23,282][INFO ][plugins                  ] [localhost.local] loaded [], sites []
....
[2014-03-26 17:54:31,516][INFO ][node                     ] [localhost.local] initializing ...
[2014-03-26 17:54:31,522][ERROR][bootstrap                ] {1.0.1}: Initialization Failed ...

I'm able to fix this by manually running the following:

chmod -R a+rX /usr/share/elasticsearch/plugins/; service elasticsearch restart

This allows the ES user to read the plugins dir and load it properly.

We can fix this in Puppet by specifying the user as an attribute to the exec command: jsnod@aaa59a7

Let me know if this is OK and I can issue a pull request.

ES 1.0.1
Marvel 1.1.0

Upgrading to a new elasticsearch version does not restart the service

In package.pp, the package resource should notify the service or the new version will not take effect.

Steps to reproduce:

  1. Set version to 0.90.9 on the elasticsearch class
  2. Run puppet to install and start elasticsearch
  3. Change the version to 0.90.10 on the elasticsearch class
  4. Rerun puppet. Notice that the package version gets changed to 0.90.10
  5. Do a GET on _cluster/nodes/. Observe that the version still says 0.90.9
  6. Restart elasticsearch manually. Do a GET on _cluster/nodes/. Observe that the version now says 0.90.10

Expected behavior:
Step 6 of manually restarting elasticsearch should not be necessary for the node to have the specified version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.