Merge "Add an option to configure the JVM size"
This commit is contained in:
commit
631990de47
|
@ -17,8 +17,9 @@ $elasticsearch_kibana = hiera('elasticsearch_kibana')
|
|||
if $elasticsearch_kibana['node_name'] == hiera('user_node_name') {
|
||||
|
||||
# Params related to Elasticsearch.
|
||||
$es_dir = $elasticsearch_kibana['data_dir']
|
||||
$es_instance = 'es-01'
|
||||
$es_dir = $elasticsearch_kibana['data_dir']
|
||||
$es_instance = 'es-01'
|
||||
$es_heap_size = $elasticsearch_kibana['jvm_heap_size']
|
||||
|
||||
# Java
|
||||
$java = $::operatingsystem ? {
|
||||
|
@ -33,13 +34,18 @@ if $elasticsearch_kibana['node_name'] == hiera('user_node_name') {
|
|||
|
||||
# Install elasticsearch
|
||||
class { 'elasticsearch':
|
||||
datadir => ["${es_dir}/elasticsearch_data"],
|
||||
require => [Package[$java]],
|
||||
datadir => ["${es_dir}/elasticsearch_data"],
|
||||
init_defaults => {
|
||||
'MAX_LOCKED_MEMORY' => 'unlimited',
|
||||
'ES_HEAP_SIZE' => "${es_heap_size}g"
|
||||
},
|
||||
require => Package[$java],
|
||||
}
|
||||
|
||||
# Start an instance of elasticsearch
|
||||
elasticsearch::instance { $es_instance:
|
||||
config => {
|
||||
'bootstrap.mlockall' => true,
|
||||
'http.cors.allow-origin' => '/.*/',
|
||||
'http.cors.enabled' => true
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ attributes:
|
|||
node_name:
|
||||
value: 'elasticsearch'
|
||||
label: 'Node name'
|
||||
description: 'The name of the node where the plugin will be deployed'
|
||||
description: 'The name of the node where the plugin will be deployed.'
|
||||
weight: 10
|
||||
type: "text"
|
||||
|
||||
|
@ -11,13 +11,23 @@ attributes:
|
|||
data_dir:
|
||||
value: '/opt/es-data'
|
||||
label: 'Elasticsearch directory'
|
||||
description: 'Directory used by elasticsearch to store data'
|
||||
description: 'Directory used by elasticsearch to store data.'
|
||||
weight: 15
|
||||
type: "text"
|
||||
restrictions:
|
||||
- condition: "true"
|
||||
action: hide
|
||||
|
||||
jvm_heap_size:
|
||||
value: '1'
|
||||
label: 'JVM heap size'
|
||||
description: 'in GB (between 1 and 32). The amount of memory reserved for the JVM.'
|
||||
weight: 18
|
||||
type: "text"
|
||||
regex:
|
||||
source: '^([1-9]|[12][0-9]|3[0-2])$'
|
||||
error: 'Enter a value between 1 and 32'
|
||||
|
||||
disk1:
|
||||
value: ''
|
||||
label: 'Disk 1'
|
||||
|
|
Loading…
Reference in New Issue