Commit 5f136e1b4de7a0d53eecb00c970b6abdf6940445
1 parent
0f741a6c
Exists in
elasticsearch_filter
and in
1 other branch
Elasticsearch: Fixed elasticsearch service install
Signed-off-by: Arthur Jahn <stutrzbecher@gmail.com> Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
3 changed files
with
33 additions
and
0 deletions
Show diff stats
plugins/elasticsearch/Rakefile
@@ -16,3 +16,18 @@ task :install => :download do | @@ -16,3 +16,18 @@ task :install => :download do | ||
16 | sh 'sudo apt-get install openjdk-7-jdk' | 16 | sh 'sudo apt-get install openjdk-7-jdk' |
17 | sh 'sudo dpkg -i /tmp/elasticsearch.deb || sudo apt-get install -f' | 17 | sh 'sudo dpkg -i /tmp/elasticsearch.deb || sudo apt-get install -f' |
18 | end | 18 | end |
19 | + | ||
20 | +desc "start elasticsearch" | ||
21 | +task :start do | ||
22 | + if not system 'sudo systemctl start elasticsearch > /dev/null' | ||
23 | + Rake::Task['install'].invoke | ||
24 | + end | ||
25 | + sh 'sudo systemctl start elasticsearch' | ||
26 | + sh 'sudo systemctl enable elasticsearch' | ||
27 | +end | ||
28 | + | ||
29 | +desc "stop elasticsearch" | ||
30 | +task :stop do | ||
31 | + sh 'sudo systemctl stop elasticsearch' | ||
32 | + sh 'sudo systemctl disable elasticsearch' | ||
33 | +end |