-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatanode.yml
80 lines (65 loc) · 1.86 KB
/
datanode.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
- hosts: datanode
vars_prompt:
- name: datadir
prompt: "Enter Data Node Directory Name "
private: no
- name: nameip
prompt: "Enter Name Node IP "
private: no
tasks:
- name: "Copying the hadoop File"
copy:
src: "/root/hadoop-1.2.1-1.x86_64.rpm"
dest: "/root/"
- name: "Copying the JDK File"
copy:
src: "/root/jdk-8u171-linux-x64.rpm"
dest: "/root/"
- name: Installing Java Software
command: "rpm -ivh jdk-8u171-linux-x64.rpm"
register: java
- debug:
var: java.stdout
- name: Installing Hadoop Software
command: "rpm -ivh hadoop-1.2.1-1.x86_64.rpm --force"
register: hadoop
when: java.rc == 0
- debug:
var: hadoop.stdout
- name: Creating Name Node Directory
file:
path: "{{ datadir }}"
state: directory
- name: Configuring hdfs-site.xml
blockinfile:
path: /etc/hadoop/hdfs-site.xml
insertafter: "<configuration>"
block:
<property>
<name>dfs.data.dir</name>
<value>{{ datadir }}</value>
</property>
- name: Configuring core-site.xml
blockinfile:
path: /etc/hadoop/core-site.xml
insertafter: "<configuration>"
block:
<property>
<name>fs.default.name</name>
<value>hdfs://{{ nameip }}:9001</value>
</property>
- name: Starting hadoop Data Node services
shell: "hadoop-daemon.sh start datanode"
register: service
- debug:
var: service
- name: Checking status of Data Node Services
shell: "jps"
register: jps
- debug:
var: jps.stdout_lines
- name: Checking hadoop cluster report
shell: "hadoop dfsadmin -report"
register: report
- debug:
var: report