๋ฐ˜์‘ํ˜•

ํ•˜๋‘ก ๋ฒ„์ „ 3.1 ๊ธฐ์ค€์œผ๋กœ 

๊ฐœ์ธ์ ์œผ๋กœ ์ •๋ฆฌํ•œ ๋ช…๋ น์–ด์ด๋‹ค.

 

๊ธฐ์กด์— ๋ฆฌ๋ˆ…์Šค์— ๋Œ€ํ•ด ๊ณต๋ถ€ํ–ˆ๋‹ค๋ฉด ํ•˜๋‘ก ๋ช…๋ น์–ด๋ฅผ ๊ณต๋ถ€ํ•˜๋Š”๋ฐ์— ์—„์ฒญ ์–ด๋ ต์ง„์•Š๋‹ค.

 

1.hdfs dfs –cat /tmp/Sample2.txt      #ํŒŒ์ผ ์ฝ๊ธฐ

2.hdfs dfs –checksum /tmp/Sample2.txt ๋ฐ์ดํ„ฐ๋ฌด๊ฒฐ์„ฑ

3.hdfs dfschgrp kyn /tmp/Sample2.txt

4.hdfs dfschown kyn /tmp/Sample2.txt

5.hdfs dfschmod –R 777 /tmp/Sample2.txt

6.hdfs dfscopyFromLocal /tmp/Sample2.txt put์œ ์‚ฌ

7.hdfs dfscopyToLocal /tmp/Sample2.txt

8.hdfs dfs –count /tmp/Sample2.txt

9.hdfs dfs –cp /tmp/Sample2.txt /tmp/rename.txt

10. hdfs dfscreateSnapshot

11. hdfs dfsdeleteSnapshot

12.hdfs dfs -df -h /tmp/ ๋””์Šคํฌ ์—ฌ์œ  ๊ณต๊ฐ„

13.hdfs dfs –du –h /tmp/ ๋””์Šคํฌ ์‚ฌ์šฉ๋Ÿ‰

14.hdfs dfs –expunge ํœด์ง€ํ†ต ๋น„์šฐ๊ธฐ (hdfs ํŒŒ์ผ ์‚ญ์ œ ํ›„ ํœด์ง€ํ†ต์— ์ž„์‹œ์ €์žฅ, ์‹œ๊ฐ„๊ฒฝ๊ณผํ›„ ์‚ญ์ œํ•จ)

15.hdfs dfs –find /temp/Sample2.txt

16.hdfs dfs –get /temp/Sample2.txt

17.hdfs dfs –head /temp/Sample2.txt

18.hdfs dfs –help

20. hdfs dfs –ls /

21. hdfs dfsmkdir /temp/test

22. hdfs dfsmoveFromLocal  (Local ์—์„œ hdfs)

23. hdfs dfsmoveToLocal (hdfs์—์„œ local)

24. hdfs dfs –mv /tmp/Sample2.txt /tmp/test

25. hdfs dfs –put /root/home/Sample.txt /tmp

26. hdfs dfsrenameSnapshot oldname newname

27. hdfs dfsrmdir/test

28. hdfs dfs –rm /tmp/Sample2.txt

29. hdfs dfs –stat ‘%d %o %r %u %n’ /tmp/Sample2.txt

%b  ํŒŒ์ผ ํฌ๊ธฐ %o ํŒŒ์ผ ๋ธ”๋ก ํฌ๊ธฐ $r ๋ณต์ œ ์ˆ˜ %u ์†Œ์œ ์ž %n ํŒŒ์ผ๋ช…

30. hdfs dfs –tail –F /tmp/Sample2.txt

31. hdfs dfs –test ~  true > 0 false > -1

32. hdfs dfs –text /tmp/filename

33. hdfs dfs –touch /tmp/filename

34. hdfs dfstouchz /tmp/filename (0 byte)

35. hdfs dfs –usage command ์‚ฌ์šฉ๋ฐฉ๋ฒ• ์ถœ๋ ฅ

 

File system checking

1.hdfs fsck /

2.hdfs fsck delete

์ปค๋ŸฝํŠธ๋œ ํŒŒ์ผ ์‚ญ์ œ

3. hdfs fsck move

์ปค๋ŸฝํŠธ๋œ ํŒŒ์ผ ์ด๋™

 

Status: HEALTHY

 Number of data-nodes:  3

 Number of racks:               1

 Total dirs:                    950

 Total symlinks:                0

Replicated Blocks:

 Total size:    3664434506 B (Total open files size: 1353 B)  ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ byte

 Total files:   2127 (Files currently being written: 10)

 Total blocks (validated):      1998 (avg. block size 1834051 B)

 (Total open file blocks (not validated): 5)

 Minimally replicated blocks:   1998 (100.0 %)  ์ตœ์†Œ๊ฐœ์ˆ˜๋กœ ๋ณต์ œ๋œ ๋ธ”๋ก

 Over-replicated blocks:        0 (0.0 %)     ์„ค์ • ๊ฐ’๋ณด๋‹ค ๋” ๋ณต์ œ๋œ ๋ธ”๋ก

 Under-replicated blocks:       1998 (100.0 %)     ์„ค์ • ๊ฐ’๋ณด๋‹ค ์•„๋ž˜ ๋ณต์ œ๋ธ”๋ก

 Mis-replicated blocks:         0 (0.0 %)     ๊ทœ์ • ์œ„๋ฐ˜ ๋ธ”๋ก

 Default replication factor:    3     dfs.replication ๊ฐ’

 Average block replication:     1.998999     ๋ณต์ œ๊ฐ’ ํ‰๊ท 

 Missing blocks:                0

 Corrupt blocks:                0     ์˜ค๋ฅ˜๋ฐœ์ƒ

 Missing replicas:              1998 (33.34446 %)       ๋ณต์ œ์กด์žฌX๋ธ”๋ก

 

 

์ปค๋ŸฝํŠธ ์ƒํƒœ

๋ชจ๋“  ๋ธ”๋ก์— ๋ฌธ์ œ ์ƒ๊ฒจ

๋ณต๊ตฌ ๋ชปํ•˜๋Š” ์ƒํƒœ

3copy ๋ฐฉ์‹์œผ๋กœ ๋ฐ์ดํ„ฐ๋…ธ๋“œ ์ค‘ ๋ฌธ์ œ ์ƒ๊ธฐ๋ฉด

Reblancing์„ ํ†ตํ•ด ๋ฐ์ดํ„ฐ์˜ ํฌ๊ธฐ๋ฅผ ๋งž์ถ”๊ฑฐ๋‚˜

์œ ์‹ค๋œ?๋ฐ์ดํ„ฐ๋ฅผ copy

 

 

 

NameNode ์ƒํƒœ ๊ด€๋ฆฌ

Hdsf dfsadminsafemode enter  : Namenode ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝ ๋ชปํ•˜๊ฒŒ safemode

Hdfs dfsadminsafemode get : name node ํ™•์ธ

Hdfs dfsadminsafemode leave : name node๊ฐ€ safemode ๋‚˜๊ฐ

 

hdfs envvars (ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถœ๋ ฅ๋จ)

JAVA_HOME='/usr/java/jdk'

HADOOP_HDFS_HOME='/usr/hdp/3.1.0.0-78/hadoop-hdfs'

HDFS_DIR='./'

HDFS_LIB_JARS_DIR='lib'

HADOOP_CONF_DIR='/usr/hdp/3.1.0.0-78/hadoop/conf'

HADOOP_TOOLS_HOME='/usr/hdp/3.1.0.0-78/hadoop'

HADOOP_TOOLS_DIR='share/hadoop/tools'

HADOOP_TOOLS_LIB_JARS_DIR='share/hadoop/tools/lib'

 

 

hdfs httpfs

HttpFS ์„œ๋ฒ„, HDFS HTTP ๊ฒŒ์ดํŠธ์›จ์ด ์‹คํ–‰

 

1.hdfs version  ์„ค์น˜๋œ ํ•˜๋‘ก ๋ฒ„์ „ ํ™•์ธ

2.hdfs classpath ์„ค์น˜๋œ ํ•˜๋‘ก jar, ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ classpath ์ถœ๋ ฅ

3.hdfs groups  hdfs : hadoop hdfs kyn

4.hdfs lsSnapshottableDir ์Šค๋ƒ…์ƒท ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅ๋จ

5.hdfs jmxget jmx์ •๋ณด ์ถœ๋ ฅ

 

 

1.init: server=localhost;port=;service=NameNode;localVMUrl=null

2.Domains:

3.        Domain = JMImplementation

4.        Domain = com.sun.management

5.        Domain = java.lang

6.        Domain = java.nio

7.        Domain = java.util.logging

8.MBeanServer default domain = DefaultDomain

9.MBean count = 22

10.Query MBeanServer MBeans:

11.List of all the available keys:

 

JMX - ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ(์†Œํ”„ํŠธ์›จ์–ด)/๊ฐ์ฒด/์žฅ์น˜ (ํ”„๋ฆฐํ„ฐ ๋“ฑ) ๋ฐ ์„œ๋น„์Šค ์ง€ํ–ฅ ๋„คํŠธ์›Œํฌ ๋“ฑ์„ ๊ฐ์‹œ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ ๋„๊ตฌ๋ฅผ ์ œ๊ณตํ•˜๋Š” ์ž๋ฐ” API์ด๋‹ค.

 

 

1.Hdfs oev   Hadoop offline edits viewer editlogs ํŒŒ์ผ ํฌ๋งท ํŒŒ์‹ฑ

2.Hdfs oiv    Hadoop offline image viewer fsImage ์‚ฌ๋žŒ์ด ์ฝ์„ ์ˆ˜ ์žˆ๊ฒŒ ๋ณ€๊ฒฝ

3.Hdfs snapshotDiff [๊ฒฝ๋กœ]

1.A์Šค๋ƒ…์ƒท B ์Šค๋ƒ…์ƒท A์—์„œ B์™€ ๋‹ค๋ฅธ ์  ์ถœ๋ ฅ

 

 

 

Administration Commands

 

Hdfs balancer : ๋ธ”๋ก ์œ„์น˜ ๋ถ„์„, ๋ฐ์ดํ„ฐ ๋…ธ๋“œ๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ ๊ท ํ˜•๋งž์ถค

Hdfs cacheadmin : cache pool๊ณผ ์ƒํ˜ธ์ž‘์šฉ ๊ฐ€๋Šฅ,

Hdfs cypto : ๋ฐฐ์น˜์—์„œ ๋ฐ˜ํ™˜ํ•  ์ˆ˜ ์žˆ๋Š” ์ตœ๋Œ€ enctyption zone ๋ชฉ๋กํ™”, ๋„ค์ž„๋…ธ๋“œ ํผํฌ๋จผ์Šค ํ–ฅ์ƒ

Hdfs datanode : HDFS ๋ฐ์ดํ„ฐ๋…ธ๋“œ ์‹คํ–‰, ๋กค๋ฐฑ

Hdfs dfsrouter : DFS ๋ผ์šฐํ„ฐ ์‹คํ–‰

Hdfs dfsrouteradmin : ๋ผ์šฐํ„ฐ ๊ธฐ๋ฐ˜ ์กฐ์ง ๊ด€๋ฆฌ

Hdfs diskbalancer : diskbalancer ์‹คํ–‰ (๋ชจ๋“  ๋””์Šคํฌ์˜ ๋ฐ์ดํ„ฐ๋…ธ๋“œ์— ๋ฐ์ดํ„ฐ ๋ถ„๋ฐฐํ•˜๋Š” ์—ญํ• )

Hdfs ec : erasure conding _ ์†Œ๊ฑฐ์ฝ”๋“œ ๊ด€๋ จ๋œ ๋ช…๋ น์–ด

Hdfs haadmin : namenode status ํ™•์ธ, namenode active ์„ ์ •

Hdfs journalnode : journalnode ์‹œ์ž‘

Hdfs mover : data migration ์‹คํ–‰

Hdfs namenode : namenode ์‹คํ–‰, ๋ฐฑ์—…, ํšŒ๋ณต, ์—…๊ทธ๋ ˆ์ด๋“œ, ์ด์ „๋ฒ„์ „์œผ๋กœ ๋กค๋ฐฑ,,๋“ฑ

Hdfs nfs3 : HDFS NFS3 ์„œ๋น„์Šค ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด NFS3 ๊ฒŒ์ดํŠธ์›จ์ด ์‹คํ–‰

Hdfs portmap : HDFS NFS3์„œ๋น„์Šค ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด RPS portmap ์‹คํ–‰

Hdfs secondarynamenode : secondary namenode ์‹คํ–‰

Hdfs storagepolicies : storage policies ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅ, ์„ค์ •  

BlockStoragePolicy{PROVIDED:1, storageTypes=[PROVIDED, DISK], creationFallbacks=[PROVIDED, DISK]

, replicationFallbacks=[PROVIDED, DISK]}

Hdfs zkfc : zookeeper failover(์žฅ์• ๋Œ€๋น„๊ธฐ๋Šฅ) controller process ์‹คํ–‰

 

hdfs dfsadmin -report

Configured Capacity: 248290449920 (231.24 GB)

Present Capacity: 194169229810 (180.83 GB)

DFS Remaining: 183161573874 (170.58 GB)

DFS Used: 11007655936 (10.25 GB)

DFS Used%: 5.67%

Replicated Blocks:

        Under replicated blocks: 0

        Blocks with corrupt replicas: 0

        Missing blocks: 0

        Missing blocks (with replication factor 1): 0

        Low redundancy blocks with highest priority to recover: 0

        Pending deletion blocks: 0

Erasure Coded Block Groups:

        Low redundancy block groups: 0

        Block groups with corrupt internal blocks: 0

        Missing block groups: 0

        Low redundancy blocks with highest priority to recover: 0

        Pending deletion blocks: 0

-------------------------------------------------

 

Live datanodes (3):

Name: 192.168.56.131:50010 

Hostname: bdd.co.kr

Decommission Status : Normal

Configured Capacity: 76060626432 (70.84 GB)

DFS Used: 3599179776 (3.35 GB)

Non DFS Used: 21608422912 (20.12 GB)

DFS Remaining: 50584588454 (47.11 GB)

DFS Used%: 4.73%

DFS Remaining%: 66.51%

Configured Cache Capacity: 0 (0 B)

Cache Used: 0 (0 B)

Cache Remaining: 0 (0 B)

Cache Used%: 100.00%

Cache Remaining%: 0.00%

Xceivers: 6

Last contact: Fri Sep 04 12:14:34 KST 2020

Last Block Report: Fri Sep 04 08:00:09 KST 2020

Num of Blocks: 2003

 

 

Hdfs dfsadmin –report –live : ์‚ด์•„์žˆ๋Š” ๋ฐ์ดํ„ฐ ๋…ธ๋“œ ํฌํ•จ ํ•˜๋‘ก ์ƒํƒœ

Hdfs dfsadmin –report –dead: ์ฃฝ์€ ๋ฐ์ดํ„ฐ ๋…ธ๋“œ ์ƒํƒœ

 

 

Debug Commands

Hdfs debug verifyMeta : HDFS ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ, ๋ธ”๋ก ํŒŒ์ผ ๊ฒ€์ฆ.

๋ฉ”ํƒ€ํŒŒ์ผ์˜ ์ฒดํฌ์„ฌ๊ณผ ๋ธ”๋กํŒŒ์ผ๊ณผ ๋งค์น˜ํ•˜์—ฌ ๊ฒ€์ฆ

Hdfs debug computeMeta : ๋ธ”๋กํŒŒ์ผ์—์„œ์˜ HDFS ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ณ„์‚ฐ,

๋ธ”๋กํŒŒ์ผ์—์„œ ์ฒดํฌ์„ฌ ๊ณ„์‚ฐํ•˜๊ณ  ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์‚ฐ์ถœ๋ฌผ์— ์ €์žฅํ•จ

Hdfs debug recoverLease : recoverLease๋ฅผ ํด๋ผ์ด์–ธํŠธ๊ฐ€ recoverLease๋ฅผ ๋ช‡ ๋ฒˆ ํ˜ธ์ถœํ• ์ง€ ์„ค์ •(default = 1),

์ง€์ •๋œ path์—์„œ lease ํšŒ๋ณต

HDFS lease >> ํด๋ผ์ด์–ธํŠธ์—๊ฒŒ ์“ฐ๊ธฐ ์ž‘์—…์„ ์œ„ํ•ด ํŒŒ์ผ ์—ฌ๋Š” ๊ฒƒ์„ ๊ถŒํ•œ์„ ๋ถ€์—ฌ ๋ฐ›์Œ

728x90
๋ฐ˜์‘ํ˜•

+ Recent posts