Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
Presto work. Added upstart config (untested).
Browse files Browse the repository at this point in the history
  • Loading branch information
analytically committed Nov 28, 2013
1 parent 70f0bbd commit 7bc4f0c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 12 deletions.
24 changes: 14 additions & 10 deletions roles/presto_common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,36 @@
file: path=/data/presto state=directory
tags: presto

- name: create the /usr/local/presto directory
file: path=/usr/local/presto state=directory
- name: create the /usr/lib/presto directory
file: path=/usr/lib/presto state=directory
tags: presto

- name: create the /usr/local/presto/etc directory
file: path=/usr/local/presto/etc state=directory
- name: create the /usr/lib/presto/etc directory
file: path=/usr/lib/presto/etc state=directory
tags: presto

- name: create the /usr/local/presto/etc/catalog directory
file: path=/usr/local/presto/etc/catalog state=directory
- name: create the /usr/lib/presto/etc/catalog directory
file: path=/usr/lib/presto/etc/catalog state=directory
tags: presto

- name: install Presto at /usr/local/presto
shell: creates=/usr/local/presto/bin/launcher chdir=/tmp curl http://central.maven.org/maven2/com/facebook/presto/presto-server/0.54/presto-server-0.54.tar.gz | tar xz && mv presto-server-0.54/* /usr/local/presto
- name: install Presto at /usr/lib/presto
shell: creates=/usr/lib/presto/bin/launcher chdir=/tmp curl http://central.maven.org/maven2/com/facebook/presto/presto-server/0.54/presto-server-0.54.tar.gz | tar xz && mv presto-server-0.54/* /usr/lib/presto
tags: presto

- name: configure Presto
template: src={{ item }} dest=/usr/local/presto/etc/{{ item }} owner=root group=root mode=0644
template: src={{ item }} dest=/usr/lib/presto/etc/{{ item }} owner=root group=root mode=0644
with_items:
- node.properties
- jvm.config
tags: presto

- name: configure Presto Hive Catalog
template: src={{ item }} dest=/usr/local/presto/etc/catalog/{{ item }} owner=root group=root mode=0644
template: src={{ item }} dest=/usr/lib/presto/etc/catalog/{{ item }} owner=root group=root mode=0644
with_items:
- jmx.properties
- hive.properties
tags: presto

- name: install upstart config for presto
template: src=upstart.conf dest=/etc/init/presto.conf owner=root group=root mode=0644
tags: presto
17 changes: 17 additions & 0 deletions roles/presto_common/templates/upstart.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description "Facebook Presto"

start on started network-interface INTERFACE=eth0
stop on stopping network-interface INTERFACE=eth0

respawn

# wait 60s between SIGTERM and SIGKILL
kill timeout 60

expect fork

chdir /usr/lib/presto/bin

script
exec su -c "./launcher start"
end script
5 changes: 5 additions & 0 deletions roles/presto_coordinator/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# file: roles/presto_coordinator/handlers/main.yml

- name: restart presto
service: name=presto state=restarted
4 changes: 3 additions & 1 deletion roles/presto_coordinator/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# file: roles/presto_coordinator/tasks/main.yml

- name: configure Presto coordinator
template: src={{ item }} dest=/usr/local/presto/etc/{{ item }} owner=root group=root mode=0644
template: src={{ item }} dest=/usr/lib/presto/etc/{{ item }} owner=root group=root mode=0644
with_items:
- config.properties
notify:
- restart presto
tags: presto
5 changes: 5 additions & 0 deletions roles/presto_worker/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# file: roles/presto_worker/handlers/main.yml

- name: restart presto
service: name=presto state=restarted
4 changes: 3 additions & 1 deletion roles/presto_worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# file: roles/presto_worker/tasks/main.yml

- name: configure Presto worker
template: src={{ item }} dest=/usr/local/presto/etc/{{ item }} owner=root group=root mode=0644
template: src={{ item }} dest=/usr/lib/presto/etc/{{ item }} owner=root group=root mode=0644
with_items:
- config.properties
notify:
- restart presto
tags: presto

0 comments on commit 7bc4f0c

Please sign in to comment.