Import and Export database1) List all database commands in the MySQL database# sqoop list-databases--connect jdbc:mysql://localhost:3306/--username root--password 1234562) Connect MySQL and list the table commands in the database# sqoop List-tables--connect jdbc:mysql://localhost:3306/test--username root--password 123
The Sqoop tool connects to a relational database in a Hadoop environment and serves as a bridge to the hadoop storage system. It supports the import of multiple relational data sources and hive, hdfs, and hbase. Generally, relational data tables exist in the backup environment of the online environment. data needs to be imported every day. sqoop can import the entire table based on the amount of data per da
Label:First, what is Sqoop Sqoop is an open source tool that is used primarily in Hadoop (Hive) and traditional databases (MySQL, PostgreSQL ...) Data can be transferred from one relational database (such as MySQL, Oracle, Postgres, etc.) to the HDFs in Hadoop, or the data in HDFs can be directed into a relational database. Second, the characteristics of Sqoop On
etc/profile
2. Decompress MySQL and put the mysql-connector-java-5.1.24-bin.jar in $ sqoop_home/lib.
After extracting sqoop, add the sqoop-1.4.3.jar under the root directory to the hadoop-2.2.0/lib.
3. list all database commands in the MySQL database
./Sqoop list-databases -- connect JDBC: mysql: // 222.99.11.52: 3322
: Sqoop import--append--connect $CONNECTURL--username $ORACLENAME--password $ORACLEPASSWORD--target-dir $hdfsPath--m --split-by clientip--table $oralceTableName--columns $columns--fields-terminated-by ' \001 '--where "data_desc= ' 201 1-02-26 ' " This execution of this command, you can see, the time consumed is: 20mins, 35sec, imported 33,222,896 data. Also, if you feel that this split is not good enough for our needs, you can execute multiple
These are from the official website of Sqoop, is 1.4.3 version of the document, if there is a mistake, I hope you will correct me. 1. Import data using Sqoop
Sqoop import--connect jdbc:mysql://localhost/db--username foo--table TEST2. Account password
Sqoop import--connect jdbc:mysql://database.example.com/employees \
Sqoop is a tool used to transfer data from Hadoop and relational databases. It can be used to transfer data from a relational database (such as MySQL, Oracle, and S)
Sqoop is a tool used to transfer data from Hadoop and relational databases. It can be used to transfer data from a relational database (such as MySQL, Oracle, and S)
Sqoop is a tool used to tran
You need to use sqoop to import data from the original MySQL database to hbase. The steps and problem records for installing and configuring sqoop are as follows:
1. The project uses hadoop version 1.0.3, so the corresponding sqoop is sqoop-1.4.3.bin _ hadoop-1.0.0, MySQL JDBC is mysql-connector-java-5.1.24
2. Decompre
);arg = List.toarray (new string[0]);int result = Sqoop.runsqoop (Sqoop, ARG);System.out.println ("Res:" + result); Print execution results.
Finally, run in the main method, and the resulting table data is shown in the following figure:
Through the above operation and code can be implemented in Java to the HDFS data generated corresponding table data;
However, in addition to being able to implement it in Java, it is possible to use basic
An error is reported when Sqoop is used to migrate data between Hive and MySQL databases.
An error is reported when Sqoop is used to migrate data between Hive and MySQL databases.
Run./sqoop create-hive-table -- connect jdbc: mysql: // 192.168.1.10: 3306/ekp_11 -- table job_log -- username root -- password 123456 -- hive-table job_log
Prepare to copy the tab
Mysql/oracle and Hdfs/hbase mutual data via SqoopThe following will focus on the implementation of MySQL and HDFS interoperability data through Sqoop, and the mutual guidance between MySQL and Hbase,oracle and HBase gives the final command.One, MySQL and HDFS Mutual guidance dataEnvironment:Host machine operating system for Win7,mysql installed on host, host address is 192.168.66.963 Virtual machine operating systems are ubuntu-12.04.1-32 bitThree vir
master HBase Enterprise-level development and management• Ability to master pig Enterprise-level development and management• Ability to master hive Enterprise-level development and management• Ability to use Sqoop to freely convert data from traditional relational databases and HDFs• Ability to collect and manage distributed logs using Flume• Ability to master the entire process of analysis, development, and deployment of Hadoop complete projects
Test The use of Mysql database Prerequisite: Import the MySQL jdbc jar package ① Testing the database connection Sqoop list-databases–connect jdbc:mysql://192.168.10.63–username Root–password 123456 use of ②sqoopAll of the following commands have a space after each line, and do not forget(None of the following 6 commands have been successfully tested)
1. Sqoop installed on Hadoop.client
2. Duplicate a copy of sqoop-env-template.sh, named sqoop-env.sh
3. Modify the contents of sqoop-env.sh:
Export Hadoop_common_home=/home/hadoopuser/hadoop
Export Hadoop_mapred_home=/home/hadoopuser/hadoop/lib
Export Hive_home=/home/hadoopuser/hive
4. Duplicate a copy of
front-facing conditionsThe configuration of the Hadoop and MySQL database servers has been successfully installed, and if you import the data or export it from hbase, you should also have successfully installed HBase. Download the JDBC driver for sqoop and MySQL sqoop-1.2.0-cdh3b4.tar.gz :http://archive.cloudera.com/cdh/3/sqoop-1.2.0-CDH3B4.tar.gz mysql-connecto
Sqoop is a tool that extracts data from relational databases to hadoop. You can also import hive, pig, and other query results to a relational database for storage.Because the author deploys the hadoop version is 2.2.0, so sqoop version is: sqoop-1.99.3-bin-hadoop2001. Download sqoop wget http://mirrors.cnnic.cn/apache
Overview
Sqoop is a top-level Apache project used to transmit data in hadoop and relational databases. Through sqoop, we can easily import data from a relational database to HDFS, or export data from HDFS to a relational database.Sqoop architecture: the sqoop architecture is very simple. It integrates hive, hbase, and oozie to transmit data through map-reduce tas
master HBase Enterprise-level development and management• Ability to master pig Enterprise-level development and management• Ability to master hive Enterprise-level development and management• Ability to use Sqoop to freely convert data from traditional relational databases and HDFs• Ability to collect and manage distributed logs using Flume• Ability to master the entire process of analysis, development, and deployment of Hadoop complete projects
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.