ubuntu

粗略步骤:

详细参考https://www.2cto.com/net/201804/735478.html

环境:ubunut  jdk  hadoop   mysql

一、下载hive

二、解压(到指定目录)

三、配置 /etc/profile [环境变量] -  执行: source /etc/profile

四、编写hive-env.sh [ 绑定hadoop ]

  注:原文件中没有 hive-env.sh 文件,可以自己创建,也可以通过 hive-env.sh.template  cp一个

五、配置mysql为hive的外部数据服务器 [ 用来存储元数据 ]

  1 编写 hive-site.xml

       注:hive没有这个文件,只有 hive-defualt.xml.template,可以自己创建,也可以通过 hive-defualt-site.xml  cp一个

   2 导入mysql的驱动包 到hive/lib

   3 创建配置文件中的mysql数据库

   4 hive元数据库初始化schematool -dbType mysql -initSchema

六、查看hive是否安装成功:

  预先:start-all.sh

                 service mysql start

  接着:hive --version (查看版本)  /   hive (进入hive)

七、测试使用hive

  hive  -> show databases;

  报错: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

  解决:需要hive元数据库初始化,执行 schematool -dbType mysql -initSchema

  警告:mysql的驱动包版本低与mysql不匹配(但是让然能用)需要用 com.mysql.cj.jdbc.driver

  解决:使用mysql相应的驱动包(自己查看mysqll版本,在查看驱动包的版本)

  警告: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

  分析:高版本mysql使用ssl技术加密数据,需要配置ssl设置 

  解决:(1)不使用SSL,在url中一局useSSL=false;(2)使用ssl,useSSL=true,并提供服务器认证证书---待定[ 没有尝试,没有发言权,]

  疑惑:Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
  疑点:MR不适合hive?hive高版本放弃用MR?

  影响:暂无。

...................................................
原文地址:https://www.cnblogs.com/floakss/p/10204249.html