-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslaves.yml
57 lines (52 loc) · 1.91 KB
/
slaves.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
- hosts: slaves
tasks:
- name: Update hdfs-site.xml file
blockinfile:
path: /etc/hadoop/hdfs-site.xml
insertafter: "<configuration>"
block: |
<property>
<name>dfs.data.dir</name>
<value>/data</value>
</property>
state: present
- name: Update core-site.xml file
blockinfile:
path: /etc/hadoop/core-site.xml
insertafter: "<configuration>"
block: |
<property>
<name>fs.default.name</name>
<value>hdfs://{{ groups['master'][0] }}:9001</value>
</property>
- name: Updating mapred-site.xml file
blockinfile:
path: /etc/hadoop/mapred-site.xml
insertafter: "<configuration>"
block: |
<property>
<name>mapred.job.tracker</name>
<value>{{ groups['jobtracker'][0] }}:9002</value>
</property>
- name: Allowing specific ports for datanode and tasktracker
firewalld:
port: "{{ item }}"
state: enabled
immediate: yes
permanent: yes
with_items:
- "9001/tcp"
- "50070/tcp"
- "50075/tcp"
- "50475/tcp"
- "50010/tcp"
- "1022/tcp"
- "50020/tcp"
- "1019/tcp"
- "9002/tcp"
- "50060/tcp"
- name: Starting the datanode and tasktracker services
command: "{{ item }}"
with_items:
- hadoop-daemon.sh start datanode
- hadoop-daemon.sh start tasktracker