Install and verify Sqoop _ MySQL

Source: Internet
Author: User
Tags mysql import hadoop ecosystem sqoop
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.