Home > other >  Sqoop1 in Java from MySQL derivative according to the HDFS failed
Sqoop1 in Java from MySQL derivative according to the HDFS failed

Time:09-21


Data table would not more than 20 megabytes, the task has been stuck, 8088 pages in Hadoop, the task is also stuck not perform
This is the source code:
Private static int importDataFromMysql () throws the Exception {
String [] args=new String [] {
"-- the connect", "JDBC: mysql://10.0.37.43:3306/rocket",
"Driver" and ". Com. Mysql. JDBC driver, "
"Username", "root",
"- the password", "root",
"-- the table", "properties1,"
"-m", "1",
"-- target - dir", "/sqoop properties3"};
String [] expandArguments=OptionsFileUtil. ExpandArguments (args);
SqoopTool tool=SqoopTool. GetTool (" import ");
Configuration conf=new Configuration();
Conf. Set (fs. Default. "name", "HDFS://192.168.88.129:9000");//set the HDFS service address
Conf. Set (hadoop. Job. "user", "root");
The conf. Set (" graphs. The framework. The name ", "yarn");
Yarn. The resourcemanager. Conf. Set (" hostname ", "192.168.88.129");
Yarn. The resourcemanager. Conf. Set (" address ", "192.168.88.129:8032");
The conf. Set (" yarn. The resourcemanager. Resource - tracker. Address ",
"192.168.88.129:8031");
The conf. Set (" yarn. The resourcemanager. Scheduler. Address ", "192.168.88.129:8030");
The conf. Set (" graphs. The app - submission. Cross - platform ", "true");
The Configuration loadPlugins=SqoopTool. LoadPlugins (conf);
Sqoop Sqoop=new Sqoop (com. Cloudera. Sqoop. Tool. SqoopTool) tool, loadPlugins);
Return Sqoop. RunSqoop (Sqoop expandArguments);
}
  • Related