This cookbook installs and configures Opendistroforleasticsearch. Please note that it's not obligatory to install the whole stack, recipes can work independently.
api.rb
: declare API credentials for all manager installedjvm.rb
: declare the amount of memory RAM JVM will usepaths.rb
: initialize different paths used during installationsearch_guard.rb
: declare search guard ZIP filenameversions.rb
: versions for Wazuh, ODFE, ELK and Search Guardelasticsearch.yml.rb
: customize YAML configuration file for Elasticsearchfilebeat.yml.rb
: customize YAML configuration file for Filebeatsearchguard.yml.rb
: customize YAML configuration file for Search Guard
Create a role, opendistro
. Modify attributes to customize the installation.
{
"name": "opendistro",
"description": "Opendistro Role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"chef_type": "role",
"run_list": [
"recipe[opendistro::default]"
],
"env_run_lists": {
}
}
Declares all recipes in the cookbook and installs the whole Elastic Stack.
Installs and configures Elasticsearch. Also install mandatory certificates.
Declares elastic repository and GPG key URI.
Installs and configures Kibana. You can customize the installation by editing the following attributes.
ES implements a big change on how clusters are formed and the communication between them. You can check full details here A-new-era-for-cluster-coordination-in-elasticsearch
Elastic adds new parameters that customize the cluster formation: discovery.seed_hosts
. discovery.host_provider
and cluster.initial_master_nodes
You can find more information about such attributes here: Discovery and cluster formation settings
In order to make Chef compatible Elasticsearch 7.x, two new attributes could be added.
['elastic']['yml']['discovery']
: This option let you set the full line in the elasticsearch.yml file so you can declare it to:
['elastic']['yml']['discovery']['seed_hosts']: <IP>"
['elastic']['yml']['discovery']['seed_providers']: <DNS>"
['elastic']['yml']['discovery']['type']: single-node"
['elastic']['yml']['cluster']['initial_master_nodes']
: Allows to insert the whole line for the initial master nodes. You can declare it like:
['elastic']['yml']['cluster']['initial_master_nodes']: "['<IP>']"
One example of the previously stated configuration would be the following.
If only the declaration of cluster.initial_master_nodes
to 192.168.0.1 would be wanted, the Elastic role needs to be adapted like this:
{
"name": "opendistro",
"description": "Opendistro Role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
"elastic": {
"yml": {
"cluster": {
"initial_master_nodes": "192.168.0.1"
}
}
}
},
"chef_type": "role",
"run_list": [
"recipe[opendistro::default]"
],
"env_run_lists": {
}
}
Check https://documentation.wazuh.com/current/installation-guide/open-distro/distributed-deployment/step-by-step-installation/elasticsearch-cluster/elasticsearch-single-node-cluster.html for more information about how to install step-by-step a Elasticsearch single-node cluster.