feat: new option to set heap size
This commit is contained in:
parent
8f8d6cdb42
commit
dac6a51c1d
6 changed files with 22 additions and 0 deletions
|
@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- new option to set heap size
|
||||||
|
|
||||||
## v1.0.0 - 2019-09-05
|
## v1.0.0 - 2019-09-05
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -12,6 +12,7 @@ Install and configure Elasticsearch
|
||||||
|
|
||||||
## Role variables
|
## Role variables
|
||||||
|
|
||||||
|
* `elasticsearch_heap_size` - set the heap size (default: `1g`)
|
||||||
* `elasticsearch_config` - hash with the configuration (see [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html))
|
* `elasticsearch_config` - hash with the configuration (see [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
elasticsearch_heap_size: 1g
|
||||||
elasticsearch_config: {}
|
elasticsearch_config: {}
|
||||||
elasticsearch_default_config:
|
elasticsearch_default_config:
|
||||||
path.data: /var/lib/elasticsearch
|
path.data: /var/lib/elasticsearch
|
||||||
|
|
|
@ -28,6 +28,17 @@
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
tags: elasticsearch
|
tags: elasticsearch
|
||||||
|
|
||||||
|
- name: set heap size
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/elasticsearch/jvm.options
|
||||||
|
regexp: '^-{{ item }}'
|
||||||
|
line: '-{{ item }}{{ elasticsearch_heap_size }}'
|
||||||
|
loop:
|
||||||
|
- Xms
|
||||||
|
- Xmx
|
||||||
|
notify: restart elasticsearch
|
||||||
|
tags: elasticsearch
|
||||||
|
|
||||||
- name: copy config file
|
- name: copy config file
|
||||||
copy:
|
copy:
|
||||||
content: '{{ elasticsearch_full_config|to_yaml }}'
|
content: '{{ elasticsearch_full_config|to_yaml }}'
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
vars:
|
vars:
|
||||||
|
elasticsearch_heap_size: 512m
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- ansible-role-elasticsearch
|
- ansible-role-elasticsearch
|
||||||
|
|
|
@ -29,3 +29,7 @@ end
|
||||||
describe port(9200) do
|
describe port(9200) do
|
||||||
it { should be_listening }
|
it { should be_listening }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe command('ps faux | grep elasticsearch') do
|
||||||
|
its(:stdout) { should contain('-Xms512m -Xmx512m') }
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue