-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup_cluster.yml
121 lines (112 loc) · 2.79 KB
/
setup_cluster.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Ansidoop - Ansible playbook main entry point
# Should be run as follow: ansible-playbook -i hosts setup_cluster.yml
#
# Copyright (C) 2018 JoalTech - https://www.joaltech.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# setup_cluster.yml
---
- name: Add python-netaddr to local repos
hosts: 127.0.0.1
connection: local
become: yes
become_user: root
tags:
- common
gather_facts: no
tasks:
- name: install python-netaddr
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-netaddr)
- name: Setup python on all nodes
hosts: all
become: yes
become_user: root
tags:
- common
gather_facts: no
tasks:
- name: install python2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
- name: Setup other software before cluster install
hosts: all
become: yes
become_user: root
tags:
- common
roles:
- common
#############################
# First install Hadoop
#############################
- name: Install Hadoop master node
hosts: leader
become: yes
become_user: root
tags:
- hadoop
- master
roles:
- hdfs-namenode
- yarn-resourcemanager
- name: Install Hadoop worker nodes
hosts: followers
become: yes
become_user: root
tags:
- hadoop
- worker
roles:
- hdfs-datanode
- yarn-nodemanager
#############################
# Then install Hive and Spark
#############################
- name: Install Hive and Spark on master node
hosts: leader
become: yes
become_user: root
tags:
- hadoop
- master
roles:
- role: hive-server
HIVE_METASTORE_HOST: "{{ hostvars[groups.leader[0]].ansible_fqdn }}"
HIVE_CLIENTS: "{{ groups.all }}"
- spark-master-yarn
- name: Install Hadoop worker nodes
hosts: followers
become: yes
become_user: root
tags:
- hadoop
- worker
roles:
- role: hive
HIVE_METASTORE_HOST: "{{ hostvars[groups.leader[0]].ansible_fqdn }}"
- spark-worker-yarn
#############################
# Finally configure edge
#############################
- name: Install Hadoop-conf on edges
hosts: edges
become: yes
become_user: root
tags:
- hadoop
- edge
roles:
- hadoop-common
- hive
- spark-common