Fixes issue 70, Improves plugin management, Refactoring, Updates tests, Introduces multiple data dir support
This commit is contained in:
parent
40fd3516c4
commit
0fd1f34852
16 changed files with 216 additions and 49 deletions
|
|
@ -4,7 +4,7 @@
|
|||
hosts: localhost
|
||||
roles:
|
||||
#expand to all available parameters
|
||||
- { role: elasticsearch, es_instance_name: "node1", es_data_dir: "/opt/elasticsearch/data", es_log_dir: "/opt/elasticsearch/logs", es_work_dir: "/opt/elasticsearch/temp", es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
|
||||
- { role: elasticsearch, es_instance_name: "node1", es_data_dirs: ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"], es_log_dir: "/opt/elasticsearch/logs", es_work_dir: "/opt/elasticsearch/temp", es_config: {node.name: "node1", cluster.name: "custom-cluster", discovery.zen.ping.unicast.hosts: "localhost:9301", http.port: 9201, transport.tcp.port: 9301, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
|
||||
vars:
|
||||
es_scripts: false
|
||||
es_templates: false
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ shared_examples 'config::init' do |es_version|
|
|||
it { should contain 'bootstrap.mlockall: true' }
|
||||
it { should contain 'discovery.zen.ping.unicast.hosts: localhost:9301' }
|
||||
it { should contain 'path.conf: /etc/elasticsearch/node1' }
|
||||
it { should contain 'path.data: /opt/elasticsearch/data/localhost-node1' }
|
||||
it { should contain 'path.data: /opt/elasticsearch/data-1/localhost-node1,/opt/elasticsearch/data-2/localhost-node1' }
|
||||
it { should contain 'path.work: /opt/elasticsearch/temp/localhost-node1' }
|
||||
it { should contain 'path.logs: /opt/elasticsearch/logs/localhost-node1' }
|
||||
end
|
||||
|
|
@ -41,7 +41,12 @@ shared_examples 'config::init' do |es_version|
|
|||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/opt/elasticsearch/data/localhost-node1') do
|
||||
describe file('/opt/elasticsearch/data-1/localhost-node1') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/opt/elasticsearch/data-2/localhost-node1') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
|
@ -82,6 +87,27 @@ shared_examples 'config::init' do |es_version|
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
describe file('/etc/init.d/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/default/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/sysconfig/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
#Not copied on Debian 8
|
||||
#describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
|
||||
# it { should be_file }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ shared_examples 'multi::init' do |es_version,plugins|
|
|||
it { should contain 'node.name: localhost-node1' }
|
||||
it { should_not contain 'bootstrap.mlockall: true' }
|
||||
it { should contain 'path.conf: /etc/elasticsearch/node1' }
|
||||
it { should contain 'path.data: /var/lib/elasticsearch/localhost-node1' }
|
||||
it { should contain 'path.data: /opt/elasticsearch/data-1/localhost-node1,/opt/elasticsearch/data-2/localhost-node1' }
|
||||
it { should contain 'path.work: /tmp/elasticsearch/localhost-node1' }
|
||||
it { should contain 'path.logs: /var/log/elasticsearch/localhost-node1' }
|
||||
end
|
||||
|
|
@ -46,7 +46,7 @@ shared_examples 'multi::init' do |es_version,plugins|
|
|||
it { should contain 'node.name: localhost-master' }
|
||||
it { should contain 'bootstrap.mlockall: true' }
|
||||
it { should contain 'path.conf: /etc/elasticsearch/master' }
|
||||
it { should contain 'path.data: /opt/elasticsearch/localhost-master' }
|
||||
it { should contain 'path.data: /opt/elasticsearch/master/localhost-master' }
|
||||
it { should contain 'path.work: /tmp/elasticsearch/localhost-master' }
|
||||
it { should contain 'path.logs: /var/log/elasticsearch/localhost-master' }
|
||||
end
|
||||
|
|
@ -129,16 +129,18 @@ shared_examples 'multi::init' do |es_version,plugins|
|
|||
end
|
||||
|
||||
#Confirm that the data directory has only been set for the first node
|
||||
describe file('/opt/elasticsearch/localhost-master') do
|
||||
describe file('/opt/elasticsearch/master/localhost-master') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/opt/elasticsearch/localhost-node1') do
|
||||
it { should_not exist }
|
||||
describe file('/opt/elasticsearch/data-1/localhost-node1') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
||||
describe file('/var/lib/elasticsearch/localhost-node1') do
|
||||
|
||||
describe file('/opt/elasticsearch/data-2/localhost-node1') do
|
||||
it { should be_directory }
|
||||
it { should be_owned_by 'elasticsearch' }
|
||||
end
|
||||
|
|
@ -203,6 +205,25 @@ shared_examples 'multi::init' do |es_version,plugins|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/etc/init.d/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/default/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/sysconfig/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,5 +83,25 @@ shared_examples 'package::init' do |es_version,plugins|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/etc/init.d/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/default/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/sysconfig/elasticsearch') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -63,5 +63,9 @@ shared_examples 'standard::init' do |es_version|
|
|||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
- name: Elasticsearch Multi tests
|
||||
hosts: localhost
|
||||
roles:
|
||||
- { role: elasticsearch, es_instance_name: "master", es_data_dir: "/opt/elasticsearch", es_heap_size: "1g", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
|
||||
- { role: elasticsearch, es_instance_name: "node1", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false, discovery.zen.ping.multicast.enabled: false } }
|
||||
- { role: elasticsearch, es_instance_name: "master", es_data_dirs: ["/opt/elasticsearch/master"], es_heap_size: "1g", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9200, transport.tcp.port: 9300, node.data: false, node.master: true, bootstrap.mlockall: true, discovery.zen.ping.multicast.enabled: false } }
|
||||
- { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data-1,/opt/elasticsearch/data-2", es_config: { "discovery.zen.ping.multicast.enabled": false, discovery.zen.ping.unicast.hosts: "localhost:9300", http.port: 9201, transport.tcp.port: 9301, node.data: true, node.master: false, discovery.zen.ping.multicast.enabled: false } }
|
||||
vars:
|
||||
es_scripts: true
|
||||
es_templates: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue