hive 搭建和使用

1.首先去hive.apache.org 官网去下载对应版本的gz包
2.解压缩gz tar -zxvf xxxx.tar.gz -C /usr/local/webserver
3.进入 config 创建hive-site.xml 文件

增加

<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value><description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
</configuration>
4.将 hive 的 lib 中的 jline.2.12.jar 替换掉 hadoop2.6.4/share/hadoop/yarn/lib/jline.0.94.jar
5. 执行命令 初始化 mysql的 hive库
./schematool -dbType mysql -initSchema
Last modification:September 18th, 2019 at 10:35 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment