这篇文章主要讲解了“sqoop使用mysql做为metastore的方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“sqoop使用mysql做为metastore的方法”吧!
<property>
<name>sqoop.metastore.client.enable.autoconnect</name>
<value>false</value>
<description>If true, Sqoop will connect to a local metastore
for job management when no other metastore arguments are
provided.
</description>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.url</name>
<value>jdbc:mysql://<mysql-Server-IP>:<mysql-port>/sqoop?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.username</name>
<value>sqoop</value>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.password</name>
<value>sqoop</value>
</property>
CREATE TABLE SQOOP_ROOT (
version INT,
propname VARCHAR(128) NOT NULL,
propval VARCHAR(256),
CONSTRAINT SQOOP_ROOT_unq UNIQUE (version, propname)
);
— Inserted the following row (** this did the trick)
INSERT INTO
SQOOP_ROOT
VALUES(
NULL,
'sqoop.hsqldb.job.storage.version',
'0'
);
#增量导入
sqoop job –create job3 –meta-connect 'jdbc:mysql://172.18.1.1:3306/sqoop?user=root&password=test' — import –connect 'jdbc:mysql://172.18.1.1:3306/test' –username 'root' –password 'test' –table 'test1' –columns 'id,name,age' –hive-import –hive-table default.jnincr1 –incremental append –check-column 'id' –last-value 0
sqoop job –meta-connect 'jdbc:mysql://172.18.1.1:3306/sqoop?user=root&password=test' –list
sqoop job –meta-connect 'jdbc:mysql://172.18.1.1:3306/sqoop?user=root&password=test' –exec job3 — –username root –password test –append
sqoop job –create job3 –meta-connect 'jdbc:hsqldb:hsql://172.18.1.1:16000/sqoop' — import –connect 'jdbc:mysql://172.18.1.1:3306/test' –username 'root' –password '123456' –table 'test_001' –columns 'id,name' –hive-import –hive-table default.a3 –incremental append –check-column 'id' –last-value 0
sqoop job –meta-connect 'jdbc:hsqldb:hsql://172.18.1.1:16000/sqoop' –exec job3 -verbose
此方法需要修改sqoop源码,解决事务锁表问题
感谢各位的阅读,以上就是“sqoop使用mysql做为metastore的方法”的内容了,经过本文的学习后,相信大家对sqoop使用mysql做为metastore的方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是云搜网,小编将为大家推送更多相关知识点的文章,欢迎关注!