HiveMetaException: Failed to get schema version, Cause:Table 'metastore.VERSION' doesn't exist

CDH6.1安装问题解决

系统: Centos7.5, 数据库:mysql5.7.24, 虚拟机:VMware Workstation12 pro(12.5.5)

在安装集群的最后阶段,hive验证出现问题
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version, Cause:Table 'metastore.VERSION' doesn't exist
出现这个问题是因为/opt/cloudera/cm/schema/scm_prepare_database.sh mysql metastore hive_user创建的库与系统冲突
解决方法: 删除数据库metastore,该数据库的创建由当前集群系统的schematool工具创建,但是要修改配置文件
/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hive/conf/hive-site.xml
添加如下内容:

 
    javax.jdo.option.ConnectionURL
    jdbc:mysql://192.168.44.144:3306/metastore?createDatabaseIfNotExist=true&useSSL=false     这里是是创建数据库metastore,同时&要转义&
   
   
      JDBC connect string for a JDBC metastore.
      To use SSL to encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL.
      For example, jdbc:postgresql://myhost/db?ssl=true for postgres database.
   

 


  javax.jdo.option.ConnectionDriverName       这里使用的是mysql5.7.24
  com.mysql.jdbc.Driver
  Driver class name for a JDBC metastore


  javax.jdo.option.ConnectionUserName
  hive_user                            这里的登录名数据库中要创建好,同时CDH6.1.0集群设置的用户名也是它(CREATE USER 'hive_user'@'%' IDENTIFIED BY 'hadoop';)
  username to use against metastore database


  javax.jdo.option.ConnectionPassword
  hadoop
  password to use against metastore database

/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hive/bin,在此目录下创建hive数据库metastore,开始初始化:
./schematool -initSchema -dbType mysql
创建成功后,验证:
./schematool -verbose -validate -dbType mysql      该语句来自集群调用,这里手工验证也可通过

至此问题解决.

你可能感兴趣的:(bigdata)