Recently, when importing data using Sqoop to HDF, the following error was reported:
Find a lot of information on the Internet, found that there is a way to solve
1. You have to be sure that you have to Sqoop to connect to your Linux MySQL database.
2. You have to configure the Sqoop environment, make sure you can connect Hdoop, enter the Sqoop installation directory, go to the bin directory, run
Export hadoop_common_home= $HADDOP _home (installation directory for HADOOP) Export haddop_mapred_home= $HADDOP _home (installation directory for Hadoop)
3. Copy the Hive-common-1.2.2.jar,hive-shi*.jar from the installation directory of Hive to Lib in the Sqoop installation directory
4. mysql service started, if not started, use command service mysqld start
5. Modify the Mapred-site.xml in the Etc/hadoop directory under the Hadoop directory
Add the following sentence:
Problem solving.
Sqoop encounters java.net.ConnectException:to 0.0.0.0:10020 failed on connection