importing data from sql server to hbase

一笑奈何 提交于 2019-12-23 05:17:08

问题


I know that Sqoop allows us to import data from a RDBMS into HDFS. I was wondering if the sql server connector in sqoop also allows us to import it directly into HBase? I know we can do this with mysql. I was wondering if the same can be done with sql server too


回答1:


I am working in the Hortonworks Sandbox, and I was able to pull data from a SQL Server instance into an HBase table by doing the following steps:

  1. Get the SQL Server JDBC driver onto the Hadoop box.

curl -L 'http://download.microsoft.com/download/0/2/A/02AAE597-3865-456C-AE7F-613F99F850A8/sqljdbc_4.0.2206.100_enu.tar.gz' | tar xz

  1. Copy the driver into the correct location for sqoop to be able to find it:

cp sqljdbc_4.0/enu/sqljdbc4.jar /usr/lib/sqoop/lib

  1. Run a sqoop import

sqoop import --hbase-create-table --hbase-table table_name_in_hbase --column-family cf_name --hbase-row-key my_ID --connect "jdbc:sqlserver://hostname:1433;database=db_name;username=sqoop;password=???" --table tablename_in_sql_server -m 1

I referenced these sites:

http://hortonworks.com/hadoop-tutorial/import-microsoft-sql-server-hortonworks-sandbox-using-sqoop/

http://souravgulati.webs.com/apps/forums/topics/show/8680714-sqoop-import-data-from-mysql-to-hbase




回答2:


It is possible to directly import data into HBase from any relational database using Sqoop. This post how it can be done using a Mysql Database Server and import it directly to HBase.




回答3:


you can import data into HBase from any RDBMS as lons as it provides JDBC driver. Sqoop interface with any other RDBMS is using JDBC.



来源:https://stackoverflow.com/questions/16272422/importing-data-from-sql-server-to-hbase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!