Which among the following command is used to copy a directory from one node to another in HDFS?

rcp
distcp
dcp
drcp

The correct answer is: C. dcp

  • rcp is a command-line utility for copying files and 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube
directories between hosts on a local network. It is not specific to HDFS.
  • distcp is a command-line utility for copying large amounts of data between clusters in Hadoop. It is not specific to copying directories.
  • dcp is a command-line utility for copying data between HDFS clusters. It can be used to copy directories, files, or a combination of both.
  • drcp is not a valid command.
  • dcp is a more recent command than distcp and offers a number of advantages, including:

    • It is more efficient, as it uses multiple threads to copy data.
    • It is more reliable, as it can resume a copy that has been interrupted.
    • It is more secure, as it supports encryption.

    To use dcp, you must first install it on the source and destination clusters. You can then use the following command to copy a directory from one cluster to another:

    dcp -r source_directory destination_directory

    For example, to copy the directory /data/foo from the cluster h1 to the cluster h2, you would use the following command:

    dcp -r /data/foo h1:/data/foo

    dcp can also be used to copy files. To do this, you would use the following command:

    dcp source_file destination_file

    For example, to copy the file /data/bar from the cluster h1 to the cluster h2, you would use the following command:

    dcp /data/bar h1:/data/bar

    dcp is a powerful tool that can be used to copy data between HDFS clusters. It is more efficient, reliable, and secure than distcp.

    Exit mobile version