ํ๋ก ๋ฒ์ 3.1 ๊ธฐ์ค์ผ๋ก
๊ฐ์ธ์ ์ผ๋ก ์ ๋ฆฌํ ๋ช ๋ น์ด์ด๋ค.
๊ธฐ์กด์ ๋ฆฌ๋ ์ค์ ๋ํด ๊ณต๋ถํ๋ค๋ฉด ํ๋ก ๋ช ๋ น์ด๋ฅผ ๊ณต๋ถํ๋๋ฐ์ ์์ฒญ ์ด๋ ต์ง์๋ค.
1.hdfs dfs –cat /tmp/Sample2.txt #ํ์ผ ์ฝ๊ธฐ
2.hdfs dfs –checksum /tmp/Sample2.txt ๋ฐ์ดํฐ๋ฌด๊ฒฐ์ฑ
3.hdfs dfs –chgrp kyn /tmp/Sample2.txt
4.hdfs dfs –chown kyn /tmp/Sample2.txt
5.hdfs dfs –chmod –R 777 /tmp/Sample2.txt
6.hdfs dfs –copyFromLocal /tmp/Sample2.txt put์ ์ฌ
7.hdfs dfs –copyToLocal /tmp/Sample2.txt
8.hdfs dfs –count /tmp/Sample2.txt
9.hdfs dfs –cp /tmp/Sample2.txt /tmp/rename.txt
10. hdfs dfs –createSnapshot
11. hdfs dfs –deleteSnapshot
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 dfs –mkdir /temp/test
22. hdfs dfs –moveFromLocal (Local ์์ hdfs)
23. hdfs dfs –moveToLocal (hdfs์์ local)
24. hdfs dfs –mv /tmp/Sample2.txt /tmp/test
25. hdfs dfs –put /root/home/Sample.txt /tmp
26. hdfs dfs –renameSnapshot oldname newname
27. hdfs dfs –rmdir/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 dfs –touchz /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 dfsadmin –safemode enter : Namenode ๋ฐ์ดํฐ ๋ณ๊ฒฝ ๋ชปํ๊ฒ safemode
Hdfs dfsadmin –safemode get : name node ํ์ธ
Hdfs dfsadmin –safemode 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 >> ํด๋ผ์ด์ธํธ์๊ฒ ์ฐ๊ธฐ ์์ ์ ์ํด ํ์ผ ์ฌ๋ ๊ฒ์ ๊ถํ์ ๋ถ์ฌ ๋ฐ์
'BIGDATA > ํ๋ก์์ฝ์์คํ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Hbase] ์ํ์น Hbase ๋ช ๋ น์ด ์ ๋ฆฌ (0) | 2021.05.02 |
---|---|
[Hive] ํ์ด๋ธ ๋ช ๋ น์ด ์ ๋ฆฌ/ Hive ๋ช ๋ น์ด ์ ๋ฆฌ (0) | 2021.05.02 |
[ํ๋ก์์ฝ์์คํ ] ์คํํฌ / apache spark (0) | 2021.03.30 |
[ํ๋ก์์ฝ์์คํ ] Apache Avro / ์ํ์น ์์ด๋ธ๋ก (0) | 2021.03.28 |
[์ค์น ์ ์ค๋น] ํ๋ก์์ฝ์์คํ ์ ์ค์น์ ์ ์ค๋นํด์ผํ ๊ฒ (0) | 2021.03.06 |