HIVE 链接报错?

问答 123456789987654321 ⋅ 于 2021-03-24 20:54:17 ⋅ 最后回复由 123456789987654321 2021-03-24 21:17:54 ⋅ 96 阅读
Caused by: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3414)
    at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3386)
    at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3640)
    ... 10 more

    在hive bion目录下执行[hadoop@nn1 bin]$ ./schematool -initSchema -dbType mysql
which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/java/jdk1.8.0_144/bin:/usr/java/jdk1.8.0_144/bin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/usr/local/hbase/bin:/usr/local/hive/bin:/usr/local/zookeeper/bin:/home/hadoop/.local/bin:/home/hadoop/bin)
Metastore connection URL:        jdbc:mysql://nn1.hadoop:3306/hive_meta
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:       hive
Starting metastore schema initialization to 2.1.0
Initialization script hive-schema-2.1.0.mysql.sql
Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

也报错,百度的方法试了,不知道是什么原因

点赞
成为第一个点赞的人吧 :bowtie:
回复数量: 2
  • 青牛 国内首批大数据从业者,就职于金山,担任大数据团队核心研发工程师
    2021-03-24 20:59:12

    hive-site.xml里面的mysql配置对了吗?

  • 123456789987654321 单身狗
    2021-03-24 21:17:54

    @青牛 配对了,解决了

暂无评论~~
  • 请注意单词拼写,以及中英文排版,参考此页
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
  • 支持表情,可用Emoji的自动补全, 在输入的时候只需要 ":" 就可以自动提示了 :metal: :point_right: 表情列表 :star: :sparkles:
  • 上传图片, 支持拖拽和剪切板黏贴上传, 格式限制 - jpg, png, gif,教程
  • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
Ctrl+Enter