-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure_spark.yml
69 lines (55 loc) · 2.23 KB
/
configure_spark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
- name: Setup spark environment variables
template:
src: templates/etc_profile_spark.sh.j2
dest: /etc/profile.d/spark.sh
- name: Ensure we have the spark-defaults file
command:
cmd: "cp {{ spark_home }}/conf/spark-defaults.conf.template {{ spark_home }}/conf/spark-defaults.conf"
creates: "{{ spark_home }}/conf/spark-defaults.conf"
- name: Set spark defaults
lineinfile:
path: "{{ spark_home }}/conf/spark-defaults.conf"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- regexp: '^spark.master\s'
line: "spark.master spark://master:7077"
- regexp: '^spark.driver.memory\s'
line: "spark.driver.memory {{ spark_driver_memory }}"
# note: spark.yarn.executor.memoryOverhead will be added to this
# the sum should be less than yarn container maximum memory value
# yarn.scheduler.maximum-allocation-mb
- regexp: '^spark.executor.memory\s'
line: "spark.executor.memory {{ spark_executor_memory }}"
# enable event logs
- regexp: '^spark.eventLog.enabled\s'
line: "spark.eventLog.enabled true"
- regexp: '^spark.eventLog.dir\s'
line: "spark.eventLog.dir hdfs://master:9000/spark-logs"
- regexp: '^spark.eventLog.dir\s'
line: "spark.eventLog.dir hdfs://master:9000/spark-logs"
# configure history server
- regexp: '^spark.history.provider\s'
line: "spark.history.provider org.apache.spark.deploy.history.FsHistoryProvider"
- regexp: '^spark.history.fs.logDirectory\s'
line: "spark.history.fs.logDirectory hdfs://master:9000/spark-logs"
- regexp: '^spark.history.fs.update.interval\s'
line: "spark.history.fs.update.interval {{ spark_history_update_interval }}"
- regexp: '^spark.history.ui.port\s'
line: "spark.history.ui.port 18080"
- name: Ensure we have a conf dir in spark home
file: "path={{ spark_home }}/conf state=directory"
- name: Specify workers for the launch scripts
template:
src: templates/cluster_workers.j2
dest: "{{ spark_home }}/conf/workers"
- name: Ensure directories are writeable by spark user
file:
path: "{{ spark_home }}/{{ item }}"
state: directory
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
with_items:
- logs
- work