Install and verify the Sqoop installation and verification environment:
System |
Redhatlinux 6.4 |
HadoopVersion |
1.2.1 |
SqoopVersion |
1.4.4 |
MysqlDatabase version |
5.6.15 |
Implement data http://www.linuxidc.com/Linux/2013-06/85817.htm between Mysql/Oracle and HDFS/Hbase through Sqoop
[Hadoop] Sqoop installation process detailed http://www.linuxidc.com/Linux/2013-05/84082.htm
Using Sqoop for data exchange http://www.linuxidc.com/Linux/2013-04/83447.htm between MySQL and HDFS systems
Hadoop Oozie learning notes Oozie does not support Sqoop problem solving http://www.linuxidc.com/Linux/2012-08/67027.htm
Hadoop ecosystem building (hadoop hive hbase zookeeper oozie Sqoop) http://www.linuxidc.com/Linux/2012-03/55721.htm
Hadoop learning Full History-use Sqoop to import MySQL data to Hive http://www.linuxidc.com/Linux/2012-01/51993.htm
Obtain sqoop: Http://sqoop.apache.org/
Step 1. download and decompress sqoop and mysqlconnector
Step2. copy the jar package in the decompressed ctor to the lib directory of sqoop.
Modify the configure-sqoop file in the bin directory:
Comment out hbase and zookeeper checks because hadoop components such as hbase and zookeeper are not enabled yet.
Step3. set environment variables
Be sure to reconnect to make the environment variable take effect!
Sqoop:
Hadoop_home:
Test sqoop:
You can run the help command to view the help information:
Step 4. test mysql import HDFS:
Create a Test table and insert data:
Use sqoop to import test tables to hdfs:
Note: You can use sqoop help import to view help information.
Log on to mysql to create a user and grant the permission to log on to mysql from any ip address
Create sqoopuser
Grant all privileges on *. * TO 'sqoopuser' @ '%' identified by 'sqoopuser' with grant option;
View the database list:
Sqoop list-databases -- connect jdbc: mysql: // 10.55.15.89: 3306/-- username sqoopuser -- P
Run the import command to import the sqoop_test table to hdfs:
Sqoop import -- connect jdbc: mysql: // 10.55.15.89: 3306/sqoop_db -- username sqoopuser -- P -- table sqoop_test-m 1