Database Reference
In-Depth Information
Distcp offers you the ability to copy within a cluster or between clusters. It uses Map Reduce to do this, and it is
designed for large-scale copying. I can provide only a theoretical example here because I have only a small four-node
cluster for writing this topic with a single name node. Check the website hadoop.apache.org for more information.
The syntax for distcp is as follows:
[hadoop@hc1nn lib]$ hadoop distcp \
hdfs://hc1nn:8020/test2 \
hdfs://hc2nn:8020/test3
This example shows the contents of cluster one HDFS directory /test2 being copied to cluster two directory /
test3. The URIs used here (hdfs://hc1nn:8020/test2 and hdfs://hc2nn:8020/test3) use a scheme of hdfs, but they also
refer to a hostname and port. These are the hosts and port numbers for the name nodes for the two clusters.
Hadoop Administration Commands
This discussion of Hadoop administration commands will let you sample some of the full set of commands available.
For complete details, check hadoop.apache.org . These commands will enable you to format the HDFS, manage
upgrades, set logging levels, and save configuration information.
You already used one of the administration commands ( -format ) when you formatted the file system earlier.
Take a second look:
hadoop namenode -format
The format command starts the name node, executes its command, and then shuts the name node down again.
The name node is the centralized place on the HDFS where metadata concerning files in the file system are stored. If
the Hadoop file system is running when this command is executed, then HDFS data is lost.
I won't run the upgrade command here, but you can use it after releasing a new version of Hadoop, as follows:
hadoop namenode -upgrade
This upgrade command will create new working directories on the data nodes for the new Hadoop version. The
previous checkpoint version is kept to allow for a rollback to the previous version of software in case the upgrade
doesn't work out.
If you need to roll back to the previous version of Hadoop, you can use hadoop namenode -rollback.) This
rollback command will cause Hadoop to revert to the previous version of the working directories.
On the other hand, to finalize the upgrade and remove the old version, you use:
hadoop namenode -finalize
Be sure that the upgrade has worked before you remove the option to roll back.
You can get and set daemon log levels with daemonlog:
[hadoop@hc1nn ~]$ hadoop daemonlog -getlevel hc1nn:8088
 
Search WWH ::




Custom Search