将数据从sql server导入到hbase [英] importing data from sql server to hbase
问题描述
$ b
- 获取SQL Server JDBC驱动程序到Hadoop框。
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
- 将驱动程序复制到正确的位置以便sqoop能够找到它:
cp sqljdbc_4.0 / enu / sqljdbc4.jar / usr / lib / sqoop / lib
- 运行一个sqoop导入
sqoop import --hbase-create-table --hbase-table table_name_in_hbase --column-family cf_name --hbase-row-key my_ID --connectjdbc :SQLSERVER://主机名:1433;数据库= DB_NAME;用户名= sqoop;密码= ??? --tabletablename_in_sql_server -m 1
我引用了这些网站:
< a href =http://hortonworks.com/hadoop-tutorial/import-microsoft-sql-server-hortonworks-sandbox-using-sqoop/ =nofollow> http://hortonworks.com/hadoop-tutorial / import-microsoft-sql-server-hortonworks-sandbox-using-sqoop / $ b
http://souravgulati.webs.com/apps/forums/topics/show/8680714 -sqoop-import-data-from-mysql-to-hbase
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
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:
- 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
- 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
- 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
这篇关于将数据从sql server导入到hbase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!