This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdfs dfsadmin -allowSnapshot contents | |
Allowing snapshot on contents succeeded | |
hdfs lsSnapshottableDir | |
drwxr-xr-x 0 training supergroup 0 2020-06-12 01:23 0 65536 /user/training/contents | |
hdfs dfs -createSnapshot /user/training/contents snapshotv1 | |
Created snapshot /user/training/contents/.snapshot/snapshotv1 | |
hdfs dfs -ls /user/training/contents/.snapshot/ | |
Found 1 items | |
drwxr-xr-x - training supergroup 0 2020-06-12 01:23 /user/training/contents/.snapshot/snapshotv1 | |
hdfs dfs -ls /user/training/contents/.snapshot/snapshotv1/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Hadoop 3.1.1. (CDP7.1.1) | |
$ hdfs dfsadmin | |
Usage: hdfs dfsadmin | |
Note: Administrative commands can only be run as the HDFS superuser. | |
[-report [-live] [-dead] [-decommissioning] [-enteringmaintenance] [-inmaintenance]] | |
[-safemode <enter | leave | get | wait>] | |
[-saveNamespace [-beforeShutdown]] | |
[-rollEdits] | |
[-restoreFailedStorage true|false|check] | |
[-refreshNodes] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******************** | |
test start | |
******************** | |
mkdir/rmdir | |
******************** | |
hdfs dfs -mkdir /tmp/testdir | |
hdfs dfs -mkdir -p /tmp/subdir1/subdir2/subdir3 | |
hdfs dfs -mkdir testdirhome | |
hdfs dfs -ls /tmp | |
Found 7 items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hostName": "datanode-100", | |
"Port": 50010, | |
"adminState": "NORMAL" | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namenode-host# echo $((`date +%s` * 1000 + 60 * 60 * 1000)) | |
1492543534000 | |
namenode-host# cat /etc/hadoop/conf/maintenance | |
{ | |
"hostName": "datanode-100", | |
"Port": 50010, | |
"adminState": "IN_MAINTENANCE", | |
"maintenanceExpireTimeInMS": 1492543534000 | |
} | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property> | |
<name>dfs.hosts</name> | |
<value>/etc/hadoop/conf/maintenance</value> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property> | |
<name>dfs.namenode.hosts.provider.classname</name> | |
<value>org.apache.hadoop.hdfs.server.blockmanagement.CombinedHostFileManager | |
</value> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property> | |
<name>dfs.namenode.maintenance.replication.min</name> | |
<value>1</value> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hostName": <DataNode hostname>, | |
"Port": <DataNode port>, | |
"upgradeDomain": <upgrade domain>, | |
"adminState": <DataNode admin state>, | |
"maintenanceExpireTimeInMS": <timeout in epoch millis> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# df -h | |
Filesystem Size Used Avail Use% Mounted on | |
…. | |
/var/disk1 5.8G 2.1G 3.5G 37% /mnt/disk1 | |
/var/disk2 5.8G 1.6G 4.0G 29% /mnt/disk2 |
NewerOlder