我正在尝试使用sqoop将数据表从mssql导入到hbase,我使用C#语言。我关注了this article
我的代码命令将数据导入到hbase:
连接字符串:
connectionString = "jdbc:sqlserver://" + sqlDatabaseServerName + ";user=" + sqlDatabaseLogin + ";password=" + sqlDatabaseLoginPassword + ";database=" + sqlDatabaseDatabaseName;
sqoop命令:
"import --connect " + connectionString + " --table " + tableName + " -hbase-create-table –hbase-table TestTableHBase -column-family PostID -hbase-row-key PostID -m 1"
我收到了成功的答复,但是没有用。
对于从MYSQL到HBASE:
您可以使用以下命令将Mysql表导入到HBase表:
sqoop import --connect jdbc:mysql://localhost/emp --username root --password cloudera --table employee --hbase-table Academp --column-family emp_id --hbase-row-key id -m 1
参考: How to Import Table from MySQL to HBase
对于SQL SERVER到HBASE
您可以使用以下命令将SQL Server表导入到HBase表:
sqoop import --connect "jdbc:sqlserver://hostname:1433;database=db_name;username=sqoop;password=???" --hbase-create-table --hbase-table table_name_in_hbase --column-family cf_name --hbase-row-key my_ID --table tablename_in_sql_server -m 1