本文介绍了将数据从sql server导入到hbase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我知道Sqoop允许我们将数据从RDBMS导入到HDFS中。我想知道sqoop中的sql server连接器是否也允许我们直接将它导入到HBase中?我知道我们可以用mysql来做到这一点。我想知道是否也可以使用sql server来完成这项工作。 我正在Hortonworks沙盒中工作,通过执行以下步骤将数据从SQL Server实例中提取到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 我引用了这些网站: 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 xzCopy the driver into the correct location for sqoop to be able to find it:cp sqljdbc_4.0/enu/sqljdbc4.jar /usr/lib/sqoop/libRun a sqoop importsqoop 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 1I 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!