Help Center/ MapReduce Service/ Troubleshooting/ Using Sqoop/ An Error Is Reported When a Sqoop Task Is Created Using Hue to Import Data from HBase to HDFS
Updated on 2023-11-30 GMT+08:00

An Error Is Reported When a Sqoop Task Is Created Using Hue to Import Data from HBase to HDFS

Issue

An error is reported when a Sqoop operation is performed on Hue to export data from HBase to HDFS.

Caused by: java.lang.ClassNotFoundException: org.apache.htrace.Trace

This section applies only to MRS 1.9.2 clusters.

Symptom

The Sqoop task is executed successfully, but the CSV file in HDFS is empty.

Cause Analysis

JAR packages conflict or related JAR packages are missing.

Procedure

  1. Go to the Sqoop installation directory and search for files.

    1. Go to the /opt/Bigdata/MRS_1.9.2/install/FusionInsight-Sqoop-1.99.7/FusionInsight-Sqoop-1.99.7/server/lib directory on the Sqoop node and run grep.

    2. Go to the native Yarn web UI and view the error information about the running task.

    3. Copy java.class.path and search for htrace-core.

    4. Copy the JAR package to the following directory:

      cp /opt/Bigdata/MRS_1.9.2/install/FusionInsight-Sqoop-1.99.7/FusionInsight-Sqoop-1.99.7/server/lib/htrace-core-3.1.0-incubating.jar /opt/Bigdata/MRS_1.9.2/install/FusionInsight-Hadoop-2.8.3/hadoop/share/hadoop/common/lib/

    5. Change permissions.

      chmod 777 htrace-core-3.1.0-incubating.jar (the copied JAR package)

      chown omm:ficommon htrace-core-3.1.0-incubating.jar (the copied JAR package)

    6. View the hosts file and perform the same operations to copy the JAR package for all other nodes.

    7. Run the Sqoop task again. The following error information is displayed.

  2. Go to the HBase installation directory and search for files.

    1. Go to the lib directory of HBase and run grep.

    2. Copy the JAR package.

      cp /opt/Bigdata/MRS_1.9.2/install/FusionInsight-HBase-1.3.1/hbase/lib/metrics-core-2.2.0.jar /opt/Bigdata/MRS_1.9.2/install/FusionInsight-Hadoop-2.8.3/hadoop/share/hadoop/common/lib/

    3. Change permissions.

      chmod 777 metrics-core-2.2.0.jar (the copied JAR package)

      chown omm:ficommon metrics-core-2.2.0.jar (the copied JAR package)

    4. View the hosts file and perform the same operations to copy the JAR package for all other nodes.
    5. Run the Sqoop task.

Conclusion

  1. Copy htrace-core-3.1.0-incubating.jar in the lib directory of Sqoop and metrics-core-2.2.0.jar in the lib directory of HBase to /opt/Bigdata/MRS_1.9.2/install/FusionInsight-Hadoop-2.8.3/hadoop/share/hadoop/common/lib/.
  2. Change the permissions for the JAR packages to 777 and omm:ficommon, respectively.
  3. Perform the preceding operations on all nodes and run the Sqoop task again.