Support Questions
Find answers, ask questions, and share your expertise

Distcp gives the Error: Could not find or load main class distcp

Distcp gives the Error: Could not find or load main class distcp

New Contributor

[hdfs@rohit15 ~]$ hdfs distcp hdfs://ROHIT15:8020/apps/hive/warehouse/test5Gb-a.db hdfs://ROHIT9:8020/apps/hive/warehouse Error: Could not find or load main class distcp [hdfs@rohit15 ~]$

4 REPLIES 4

Re: Distcp gives the Error: Could not find or load main class distcp

New Contributor

[root@rohit15 lib]# hadoop classpath /usr/hdp/2.3.0.0-2557/hadoop/conf:/usr/hdp/2.3.0.0-2557/hadoop/lib/*:/usr/hdp/2.3.0.0-2557/hadoop/.//*:/usr/hdp/2.3.0.0-2557/hadoop-hdfs/./:/usr/hdp/2.3.0.0-2557/hadoop-hdfs/lib/*:/usr/hdp/2.3.0.0-2557/hadoop-hdfs/.//*:/usr/hdp/2.3.0.0-2557/hadoop-yarn/lib/*:/usr/hdp/2.3.0.0-2557/hadoop-yarn/.//*:/usr/hdp/2.3.0.0-2557/hadoop-mapreduce/lib/*:/usr/hdp/2.3.0.0-2557/hadoop-mapreduce/.//*:::/usr/share/java/mysql-connector-java.jar:/usr/hdp/2.3.0.0-2557/tez/*:/usr/hdp/2.3.0.0-2557/tez/lib/*:/usr/hdp/2.3.0.0-2557/tez/conf [root@rohit15 lib]#

Re: Distcp gives the Error: Could not find or load main class distcp

@Rohit kotturu

it seems you are trying to move the data from cluster 1 to cluster 2.

Quick question:

Both HDP stacks are same version?

if yes, please try this

hadoop distcp hdfs://nn1:8020/source hdfs://nn2:8020/destination

If No, try this

hadoop distcp hftp://<hdp 1.3.x namenode host>:50070/<folder path of source> hdfs://<hdp 2.x namenode host>/<folder path of target>

find more info here

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_Sys_Admin_Guides/content/ref-4d13c401-c6...

Re: Distcp gives the Error: Could not find or load main class distcp

@Rohit kotturu

Use this command:

[hdfs@rohit15 ~]$ hadoop distcp -update hdfs://ROHIT15:8020/apps/hive/warehouse/test5Gb-a.db hdfs://ROHIT9:8020/apps/hive/warehouse

Re: Distcp gives the Error: Could not find or load main class distcp

@Rohit kotturu

Did this solved your issue?