- 安装jdk、hadoop
- 上传解压
- 重命名配置文件
mv hive-default.xml.template hive-site.xml
mv hive-env.sh.template hive-env.sh
- hive-env.sh
JAVA_HOME=/opt/jdk1.8.
HADOOP_HOME=/opt/hadoop-2.6.0-cdh5.7.0/
export HIVE_CONF_DIR=/opt/hive-1.1.0-cdh5.7.0/conf
- hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<!-- 需要mysql数据库 -->
<value>jdbc:mysql://hadoop-senior01.itguigu.com:3306/metastore?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>123456</value>
<description>password to use against metastore database</description>
</property>
<!-- 是否在当前客户端中显示查询出来的数据的字段名称 -->
<property>
<name>hive.cli.print.header</name>
<value>true</value>
<description>Whether to print the names of the columns in query output.</description>
</property>
<!-- 是否在当前客户端中显示当前所在数据库名称 -->
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
<description>Whether to include the current database in the Hive prompt.</description>
</property>
- hive-log4j.properties
hive.log.dir=/opt/modules/cdh/hive-0.13.1-cdh5.3.6/logs
- 拷贝数据库驱动包到Hive根目录下的lib文件夹
cp -a mysql-connector-java-5.1.27-bin.jar /opt/hive-1.1.0-cdh5.7.0/lib/
- 启动Hive
bin/hive
- HiveServer2配置,hive-site.xml
hive.server2.thrift.port --> 10000
hive.server2.thrift.bind.host --> hadoop-senior01.itguigu.com
hive.server2.long.polling.timeout -- > 5000(去掉L)
hive.server2.enable.doAs -- > false hadoop调度可以,false那个用户启动hive2就可以用哪个用户调用
#启动服务
bin/hive --service hiveserver2
#连接服务
bin/beeline
beeline> !connect jdbc:hive2://hadoop-senior01.itguigu.com:10000