Label:My name is Farooq and I am with HDinsight support team here at Microsoft. In this blog I'll try to give some brief overview of Sqoop on HDinsight and then use an example of importing data from a Windows Azure SQL Database table to HDInsight cluster to demonstrate how can I get stated with Sqoop in HDInsight.What is Sqoop?
Tags: Big Data eraSqoop as a Hadoop The bridge between the traditional database and the data import and export plays an important role. by expounding the basic grammar and function of Sqoop, the paper deeply decrypts the function and value of Sqoop. First, what is Apache Sqoop?Clouderadeveloped byApacheOpen Source p
jdbc:mysql://192.168.1.187:3306/trade_dev--username mysql--password 1 11111--table tb_dictionary-m 1--target-dir/sqoop/mysql/trade_dev/tb_dic--incremental append--check-column DIC_ID-- Last-value 287Bin/sqoop Job--exec Incjob
6.4 Verification
Select COUNT (*) from Tb_dic;
Return Data:First time
Time taken:0.068 seconds, fetched:489 row (s)
Second time
Time taken:0.
successfully by following the command:Sqoop Job--list Lists all jobSqoop Job--show jobname Display jobname InformationSqoop Job--delete JobName Delete JobNameSqoop job--exec jobname Execution JobName(3) After performing the job, see if the tables in hive have data. Of course, there must be data in the accident.And in the process of execution, we can see the corresponding execution log as follows:Slf4j:see
the data keywords in the post-import and the data in the MySQL database exist the same, the row record is updated, The latter indicates that data that originally did not exist in the target database is also imported into the database table, that is, there is data retention, new data is inserted, and it is followed by another option, updateonly, which updates only the data and does not insert new data. Detailed introduction to another blog post (Sqoop
Tags: file uri ora shel ACL created address multiple arcBasic useAs in the shell script below: #Oracle的连接字符串, which contains the Oracle's address, SID, and port numberConnecturl=jdbc:oracle:thin:@20.135.60.21:1521:dwrac2#使用的用户名Oraclename=kkaa#使用的密码Oraclepassword=kkaa123#需要从Oracle中导入的表名Oralcetablename=tt#需要从Oracle中导入的表中的字段名Columns=area_id,team_name#将Oracle中的数据导入到HDFS后的存放路径hdfspath=apps/as/hive/$oralceTableName#执行导入逻辑. Importing data from Oracle into HDFSSqoop
destination schema.②REMAP_TABLESPACE Specifies the source tablespace and destination tablespace.③table_exists_action=replace overwrites a table with duplicate names.Before importing, be careful to back up the data of UserB, avoid the data loss caused by export error.EXPDP Userb/password Directory=tmp_bak dumpfile=userb-170504-expdp.dmp logfile=userb-170504-expdp.logFormally import the table beginning with SYS into the UserB user.IMPDP userb/password
Import and export statements for all tables in the DB2 Automatic Generation mode objective: to facilitate data migration between different databases. SQL code www.2cto.com SELECT 'db2 EXPORT TO '| tabname | '. del of del modified by coldel @ CODEPAGE = 1208 MESSAGES '| tabname | '. expout SELECT * FROM '| tabname AS Exports, '
://10.120.10.11:3306/--username sqoop--password sqoopLists the names of all databases in MySQLimport from MySQL to HDFs Sqoop # #sqoop commandImport # # indicates an imported--connect Jdbc:mysql://ip:3306/sqoop # # tell jdbc, connect MySQL URL--username
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://loc
Step One: Enter the client shell
fulong@fbi008:~$ sqoop.sh Client
Sqoop Home directory:/home/fulong/sqoop/sqoop-1.99.3-bin-hadoop200
Sqoop shell:type ' help ' or ' \h ' for help.
Sqoop:000> Set server--host FBI003--port 12000--webapp
Sqoop is a tool used for data import and export, typically used in the framework of Hadoop, where common scenarios include importing data from a MySQL database into HDFs or hive, Hbase, or exporting it to a relational database. The following sections show the process of importing and exporting several pieces of code.
Import data from MySQL into the Hadoop cluste
SQOOP2
The SQOOP1 architecture, which uses only one Sqoop client, SQOOP2 architecture, introduces Sqoop server centralized management connector, as well as rest Api,web,ui, and introduces a privilege security mechanism.
SQOOP1 Advantages Architecture Simple Deployment
Sqoop1 the shortcomings of the command line way error-prone, format tightly coupled, unable to support
table in hbase.-- Username 'root' indicates that the user root is used to connect to MySQL.
Note:
All hbase nodes must be able to access the MySQL database. Otherwise, the following error occurs:Java. SQL. sqlexception: NULL, message from server: "host '10. 10.104.3 'is not allowed to connect to this MySQL Server"
Run the following command on the MySQL database server node to allow remote machines to access the local database server: [root @ gc01vm6
Tags: lin replace tell database hang CAs install prompt relationshipThe sqoop1.4.6 how to import MySQL data into the Sqoop installation of Hadoop is described in the previous article , and the following is a simple use command for data interoperability between the two. Display MySQL database information, General Sqoop installation testSqoop list-databases--connec
$ sqoop Import--connect jdbc:mysql://192.168.80.128/hive--username Hive-password Hive--table Employees--hi Ve-import--hive-table Employees In more detail, see import tables and data from MySQL into hive with Sqoop Export dat
Sqoop use Hsql to store job information, open Metastor service to share job information, Sqoop on all node can run the same job
One, sqoop configuration file in Sqoop.site.xml:
1, Sqoop.metastore.server.location
Local storage path, default under TMP, change to other path
2, Sqoop.metastore.server.port
Metastore Service
1. Install sqoop
Download sqoop-1.2.0.tar.gz (version 1.20 is compatible with Hadoop0.20)
Put the hadoop-core-0.20.2-cdh3u3.jar, hadoop-tools-0.20.2-cdh3u3.jar into the sqoop/lib directory, the two jar packages are out of cloudera company, you can go to its official website to download.
2. import data from mysql
Go to
First of all, we need to install sqoop. I use sqoop1. Secondly, we need ojdbc6.jar. The jar package is as follows: The www.oracle.comtechnetworkdatabaseenterprise-editionjdbc-112010-090769.html will copy the decompressed package to the lib directory under the sqoop installation directory and finally execute our import
Tags: Import table temp mapred pre should export JDBC default modification The reason for this error is that a delimiter error is used between table fields in the specified hive for Sqoop read parsing to be incorrect. If the result of the MapReduce operation Rollup is performed by hive, the default delimiter is ' \001 ', otherwise the delimiter should be ' \ t ' if imported from an HDFs file. Here I am the
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.