开发者社区> 问答> 正文

Sqoop job 报错 requires COLLATION in statement

安装sqoop1.4.7,系统是centos7.3。 sqoop能正常从sqlserver拉取数据进入hbase,job完全不能使用。 调用sqoop job --list,一开始报错Could not load HSQLDB JDBC driver,下载了hsqldb1.8放入lib之后,报错如下:

[root@srv-bd13 sqoop]# sqoop job --list Warning: /usr/local/sqoop/../hcatalog does not exist! HCatalog jobs will fail. Please set $HCAT_HOME to the root of your HCatalog installation. Warning: /usr/local/sqoop/../accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation. 19/12/12 14:42:02 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7 19/12/12 14:42:03 ERROR tool.JobTool: I/O error performing job operation: java.io.IOException: Exception creating SQL connection at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.init(HsqldbJobStorage.java:216) at org.apache.sqoop.metastore.hsqldb.AutoHsqldbStorage.open(AutoHsqldbStorage.java:112) at org.apache.sqoop.tool.JobTool.run(JobTool.java:289) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243) at org.apache.sqoop.Sqoop.main(Sqoop.java:252) Caused by: java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE] at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.jdbcConnection. (Unknown Source) at org.hsqldb.jdbcDriver.getConnection(Unknown Source) at org.hsqldb.jdbcDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.init(HsqldbJobStorage.java:176) ... 8 more

之前还修改过metastore的设置,也是不行。 求问解决,拜谢

展开
收起
dogstar 2019-12-12 15:04:57 1271 0
2 条回答
写回答
取消 提交回答
  • 已解决,sqoop 使用metastore记录job,已经安装hbase的话,metastore默认的16000端口被hbase占用,因此需要在sqoop-site.xml中另外配置 sqoop.metastore.server.location和sqoop.metastore.server.port

    调用 sqoop job 时,需要添加meta-connect参数

    参考:csdn

    2019-12-12 16:44:39
    赞同 展开评论 打赏
  • 精于基础,广于工具,熟于业务。

    把sqoop/bin/configure-sqoop里面的如下两段内容注释掉就可以了。

    #if [ -z "${HCAT_HOME}" ]; then

    if [ -d "/usr/lib/hive-hcatalog" ]; then

    HCAT_HOME=/usr/lib/hive-hcatalog

    elif [ -d "/usr/lib/hcatalog" ]; then

    HCAT_HOME=/usr/lib/hcatalog

    else

    HCAT_HOME=${SQOOP_HOME}/../hive-hcatalog

    if [ ! -d ${HCAT_HOME} ]; then

    HCAT_HOME=${SQOOP_HOME}/../hcatalog

    fi

    fi

    #fi #if [ -z "${ACCUMULO_HOME}" ]; then

    if [ -d "/usr/lib/accumulo" ]; then

    ACCUMULO_HOME=/usr/lib/accumulo

    else

    ACCUMULO_HOME=${SQOOP_HOME}/../accumulo

    fi

    #fi

    Moved to be a runtime check in sqoop.

    #if [ ! -d "${HCAT_HOME}" ]; then

    echo "Warning: $HCAT_HOME does not exist! HCatalog jobs will fail."

    echo 'Please set $HCAT_HOME to the root of your HCatalog installation.'

    #fi

    #if [ ! -d "${ACCUMULO_HOME}" ]; then

    echo "Warning: $ACCUMULO_HOME does not exist! Accumulo imports will fail."

    echo 'Please set $ACCUMULO_HOME to the root of your Accumulo installation.'

    #fi

    2019-12-12 15:30:48
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Major advancements in Apache Hive towards full support of SQL compliance 立即下载
Spark SQL: Past, Present and Future 立即下载
Spark SQL:Past Present &Future 立即下载