๐ŸŒฑ Infra/Hadoop_HDFS

Hadoop ํ•˜๋‘ก! ํ•œ๋ฒˆ ์‚ฌ์šฉํ•ด๋ณด๊ธฐ

mini_world 2021. 3. 5. 22:15
๋ชฉ์ฐจ ์ ‘๊ธฐ

 

์ด ํฌ์ŠคํŒ…์€ ์ด์ „ํฌ์ŠคํŒ…๊ณผ ์ด์–ด์ง‘๋‹ˆ๋‹ค :)

์ž! ์ง€๊ธˆ๊นŒ์ง€ ์•„๋ž˜ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ ์šฐ๋ฆฌ๋Š” Master ํ•œ๋Œ€์™€ Slave ์„ธ๋Œ€๋ฅผ ์ด์šฉํ•ด์„œ ํ•˜๋‘กํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป
์ด์ œ๋ถ€ํ„ฐ๋Š” ์šฐ๋ฆฌ๊ฐ€ ๋งŒ๋“ค์–ด๋†“์€ ์ด ํ•˜๋‘ก ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ํ™œ์šฉํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ˜

 


Hadoop? HDFS? ๋ญ๊ฐ€ ๋‹ค๋ฅธ๊ฐ€?

ํ•˜๋‘ก ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์ด์ œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•˜๋Š”๋ฐ, ๊ทธ ์ „์— ์˜์•„ํ•œ ๋ถ€๋ถ„์ด ์žˆ์Šต๋‹ˆ๋‹ค.
hadoop๊ณผ hdfs๋Š” ๋ญ๊ฐ€ ๋‹ค๋ฅธ๊ฑธ๊นŒ์š”?

๋”๋ณด๊ธฐ
  • ํ•˜๋‘ก์ด๋ž€?
    • ๋Œ€๋Ÿ‰์˜ ์ž๋ฃŒ๋ฅผ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์ปดํ“จํ„ฐ ํด๋Ÿฌ์Šคํ„ฐ์—์„œ ๋™์ž‘ํ•˜๋Š” "ํ”„๋ฆฌ์›จ์–ด ์ž๋ฐ” ์†Œํ”„ํŠธ์›จ์–ด ํ”„๋ ˆ์ž„์›Œํฌ"์ž…๋‹ˆ๋‹ค.
    • Apache Hadoop Framework์—์„œ๋Š” ์•„๋ž˜์˜ ๋ชจ๋“ˆ์„ ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
      - ํ•˜๋‘ก ์ปค๋จผ(Hadoop Common)
      - ํ•˜๋‘ก ๋ถ„์‚ฐ ํŒŒ์ผ ์‹œ์Šคํ…œ(HDFS) - ์Šคํ† ๋ฆฌ์ง€ ๊ณ„์ธต
      - ํ•˜๋‘ก YARN - ์ž์› ๊ด€๋ฆฌ ๊ณ„์ธต
      - ํ•˜๋‘ก ๋งต๋ฆฌ๋“€์Šค - ์ฒ˜๋ฆฌ ๊ณ„์ธต 
    • ์ฐธ๊ณ ๋งํฌ (์œ„ํ‚ค๋ฐฑ๊ณผ)
  • HDFS๋ž€? 
    • ํ•˜๋‘ก ํด๋Ÿฌ์Šคํ„ฐ์˜ ๋ฐ์ดํ„ฐ ์Šคํ† ๋ฆฌ์ง€ ๊ณ„์ธต์ž…๋‹ˆ๋‹ค.
    • ํ•˜๋‘ก ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์œ„ํ•ด ์ž๋ฐ”์–ธ์–ด๋กœ ์ž‘์„ฑ๋œ ๋ถ„์‚ฐ ํ™•์žฅ ํŒŒ์ผ์‹œ์Šคํ…œ ์ž…๋‹ˆ๋‹ค.
    • ๋งค์šฐ ํฐ ํŒŒ์ผ์„ ์ €์žฅํ•˜๋„๋ก ์„ค๊ณ„(๋Œ€์šฉ๋Ÿ‰ํŒŒ์ผ ๋ถ„์‚ฐ ์ €์žฅ)๋˜์—ˆ์œผ๋ฉฐ, ๋ฐ์ดํ„ฐ๋ฅผ ์—ฌ๋Ÿฌ ๋…ธ๋“œ์— ์ค‘๋ณตํ•ด์„œ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

HDFS๋Š” ํ•˜๋‘ก์˜ ์Šคํ† ๋ฆฌ์ง€ ๊ณ„์ธต์œผ๋กœ, Hadoop ๋ถ„์‚ฐํŒŒ์ผ์‹œ์Šคํ…œ(hdfs)๋ฅผ ๋งํ•ฉ๋‹ˆ๋‹ค. :)
๋‹ค์‹œ ์ •๋ฆฌํ•ด ๋งํ•˜์ž๋ฉด, hdfs๋Š” ํ•˜๋‘ก ํ”„๋ ˆ์ž„์›Œํฌ์˜ ํ•œ ๋ถ€๋ถ„์ธ๊ฑฐ์ฃ ! ๐Ÿคฉ 

 


Hadoop ๋ช…๋ น์–ด ์‚ฌ์šฉํ•˜๊ธฐ!

hadoop๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
HDFS๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ,  Hadoop fs ๋ช…๋ น์–ด๋Š” hdfs dfs ๋ช…๋ น์–ด์™€ ์™„์ „ํžˆ ๊ฐ™์Šต๋‹ˆ๋‹ค :)

 

๋ชจ๋“  ๋ช…๋ น์–ด๋Š” Master ๋…ธ๋“œ์—์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
๋จผ์ €, ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

[root@master /]# /usr/local/hadoop-2.10.1/bin/hadoop fs -mkdir -p /hadoop-dir/mydir01
[root@master /]# /usr/local/hadoop-2.10.1/bin/hadoop fs -mkdir -p /hadoop-dir/mydir02

๊ทธ๋ฆฌ๊ณ  ํŒŒ์ผ์„ ๋„ฃ์–ด์ค„๊ฑด๋ฐ, ๋จผ์ € ํŒŒ์ผ์„ ๋‘๊ฐœ ๋งŒ๋“ค์–ด์ค์‹œ๋‹ค!

[root@master /]# echo "this is test file 01" > testfile01.txt
[root@master /]# echo "this is test file 02" > testfile02.txt

์ด์ œ ์ด ๋‘๊ฐœ์˜ ํŒŒ์ผ์„ ๊ฐ๊ฐ ๋””๋ ‰ํ† ๋ฆฌ์— ํ•˜๋‚˜์”ฉ ๋„ฃ์„๊ฒŒ์š”!!

[root@master /]# /usr/local/hadoop-2.10.1/bin/hadoop fs -copyFromLocal testfile01.txt /hadoop-dir/mydir01
[root@master /]# /usr/local/hadoop-2.10.1/bin/hadoop fs -copyFromLocal testfile02.txt /hadoop-dir/mydir02

ํŒŒ์ผ์ด ์ž˜ ๋“ค์–ด๊ฐ”๋Š”์ง€ ls ๋ช…๋ น์–ด๋กœ ํ™•์ธํ•ด์ค๋‹ˆ๋‹ค :)
์œ„์—์„œ ์ƒ์„ฑํ•œ ํŒŒ์ผ๋“ค์ด ์ž˜ ๋“ค์–ด๊ฐ”๋„ค์š”!!

[root@master /]# /usr/local/hadoop-2.10.1/bin/hadoop fs -ls -R /

 


์•„์ฃผ์•„์ฃผ ๊ฐ„๋‹จํžˆ ํ•˜๋‘ก๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค!!

๊ณต๋ถ€๊ฐ€ ๋” ํ•„์š”ํ•˜์‹œ๋‹ค๋ฉด, Hadoop FilesystemShell ๊ณต์‹๋ฌธ์„œ๋ฅผ ์ฐธ์กฐํ•˜์…”๋„ ์ข‹์Šต๋‹ˆ๋‹ค.

 

Apache Hadoop 2.10.1 – Overview

 

 

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค!! ๐Ÿ˜Š๐Ÿ˜Š

728x90