当前位置:   article > 正文

Flink SQL Client 问题_configured default database cdpma doesn't exist in

configured default database cdpma doesn't exist in catalog hivecatalog

1、Flink SQL Client 启动失败 Java版本问题

启动flink sql client报错

[chb@test1 flink-1.12.1]$ ./bin/sql-client.sh embedded

2021-08-09 15:02:16,169 ERROR org.apache.hadoop.hive.metastore.utils.MetaStoreUtils        [] - Got exception: java.lang.ClassCastException class [Ljava.lang.Object; cannot be cast to class [Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in module java.base of loader 'bootstrap')
java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in module java.base of loader 'bootstrap')

Exception in thread "main" org.apache.flink.table.client.SqlClientException: Unexpected exception. This is a bug. Please consider filing an issue.
        at org.apache.flink.table.client.SqlClient.main(SqlClient.java:215)
Caused by: org.apache.flink.table.client.gateway.SqlExecutionException: Could not create execution context.
Caused by: org.apache.flink.table.catalog.exceptions.CatalogException: Failed to create Hive Metastore client
Caused by: MetaException(message:Got exception: java.lang.ClassCastException class [Ljava.lang.Object; cannot be cast to class [Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in module java.base of loader 'bootstrap'))
   
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

解决方法
在官网的教程上看到了如下信息:
在这里插入图片描述
关键就在"have a working Java8.x installation",这句话中并没有"or higher"之类的字眼,所以我推断当前版本的flink只能在Java8上工作,而我的JDK版本是Java11,抱着试一试的心态把JDK版本降为了Java8,再次启动flink,成功。所以遇到类似问题的朋友可以检查一下你们的JDK版本是否匹配。

在这里插入图片描述

2、sql client 启动报错ClassNotFoundException: org.apache.hadoop.conf.Configuration

参考:
https://stackoverflow.com/questions/60968006/classnotfoundexception-org-apache-hadoop-conf-configuration-starting-flink-sql

if you not add the HADOOP_HOME in you env, you can export the HADOOP_CLASSPATH, before run the ./bin/sql-client.sh embedded

export HADOOP_CLASSPATH=`hadoop classpath`
  • 1
  • 2
  • 3

又报错Configured default database myhivedb doesn't exist in catalog myhive

在这里插入图片描述

default-database 需要在 hive 中创建。

3、Connection refused: localhost/127.0.0.1:8081

执行 Flink SQL 报错 [ERROR] Could not execute SQL statement. Reason: java.net.ConnectException: Connection refused

在这里插入图片描述日志
上面无法看到正确错误,总是以为 是 Mysql 数据库连接错误, 最后日志flink-root-sql-client-chb1.log

Connection refused: localhost/127.0.0.1:8081
  • 1

错误的原因:没有启动flink

启动 flink ./bin/start-cluster.sh

关注我的公众号【宝哥大数据】

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/484109
推荐阅读
相关标签
  

闽ICP备14008679号