-
Notifications
You must be signed in to change notification settings - Fork 1
/
A3_ArchitectureYARN.txt
238 lines (116 loc) · 4.79 KB
/
A3_ArchitectureYARN.txt
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
22-JAN-2017:
------------
Hadoop Architecture:
1. HDFS [done]
2. YARN [today]
Revision:
--------
What is Hadoop? [Both]
> Storage
> Processing
What is the default Block size?
> 128 MB in Hadoop2
> 64 MB in Hadoop1
Is the block size configurable? YES
What is the default REPLICATION factor? 3
Is the REPLICATION factor configurable? YES
REPLICATION factor => balance between Fault-Tolerance and Storage-Space
ex: 4 TB HDD scenario
1 TB file => 3 REPLICATION => you need 3 TB space => 1.33 TB is max capacity
1 TB file => 4 REPLICATION => you need 4 TB space => 1 TB is max capacity
HDFS => Hadoop Distributed File System => Virtual File System
What is the Name of master process in HDFS? NameNode
What does it do?
> monitor the slaves
> store the metadata
What is the Name of slave process in HDFS? DataNode
What does it do?
> Store the Data [in the form of blocks]
> a.k.a [hosts the blocks]
What is a BLOCK? tiny unit of quantification in HDFS storage; a memory chunck.
What are the Names of NameNodes in HighAvailability mechanism?
> Active NameNode - currently in service
> StandBy NameNode - waiting to be in service
File => BLOCK => DataNodes => NameNode ---> memorise
Is BLOCK REPLICATION a parallel activity? No; Replication is Sequential
ex: 1 GB file => in hadoop1 => 16 x 64 MB = 1024 MB = 1 GB; 16 Blocks
2 Nodes => 2 writes can happen parallely => compartively slower
16 Nodes => 16 writes can happen parallely => faster
more machines => faster the transfer
YARN => Yet Another Resource Negotiator:
---------------------------------------
Yarn => Processing Layer => in cluster [Distributed Processing]
To process[compute] some thing => we need coputational resources
Like: CPU + RAM + HDD + Network => Container
We have a computer => i3(2 core/4 threads) + 4 GB + 256 GB
4 X container [ 1 logical core + 1 GB + 64 GB]
2 X container [ 1 physical core + 2 GB + 128 GB]
YARN => master(ResourceManager) + slave(NodeManager)
Computer => Containers => NodeManager => ResourceManager ---> memorise
Fun Q: Which layer can exist independently[doesnt need the other one]? HDFS or YARN?
HDFS; "because data comes first then processing"
HDFS Federation: [NameNode Scalability]
Like TableSpace => which has tables and objects related to a db
smillimarly => NameSpace => is for file systems => the inverted tree structure
normal:
------
/home/keshav/marriage-pics ==> / is starting point
/home/dinesh/holiday-pics ==> / is starting point
/home/prem/office-pics ==> / is starting point
divide:
------
/home/keshav/marriage-pics ==> /home/keshav is starting point => NN1
/home/dinesh/holiday-pics ==> /home/dinesh is starting point => NN2
/home/prem/office-pics ==> /home/prem is starting point => NN3
to scale the NameNode Horizontally without down time =>
divide the NameSpace => allocate it to multiple NameNodes
ProTip: dont think about High-Availability Here.
Q: if you put a file in /home/prem/office-pics/boss-pics, this meta goes to which NameNode?
Ans: NN3
Q: if you put a file in /home/bharath/office-pics/boss-pics, this meta goes to which NameNode?
Ans: operation will fail; error will come as file or folder not exists;
Q: if you call a machine/node as a slave machine? What processes does it need to be running?
Ans: DataNode and NodeManager; slave machine is the work horse;
designed to work in isolation
HomeWork:
--------
1. Brush Up Java Skills
Core Java: OOPS, IO (read/write a file), String functions, Generics, Collections
TutorialsPoint for Java;
JavaTpoint.com
Procedural Programming => 2 entities => 1. Function and 2. Data
sum(1,2) => 3
sum() => function; 1,2 => data
Obeject Oriented Programming => 1 entity
=> has 2 parts 1. Method(fancy word for function)
=> 2. data
Object => method + data
String s = "jagadish";
String su = s.upper();
print(su);
-------------
JAGADISH
=================================
select UPPER('jagadish') from dual;
Linux Quiz:
-----------
1. To list files in linux?
$ ls
2. To long list the files in linux?
$ ls -larth
3. To rename a file?
$ mv file1 file2
4. To copy a file?
$ cp file1 /dir
5. To delete a file?
$ rm file1
6. To delete a folder?
$ rm -r dir
7. To display the content of a file?
$ cat file1
8. To see the command history?
$ history
9. To search a file?
$ find
10. To search something inside a file?
$ grep