ITeye博客

Hive

liming495 · 2019-11-21 16:19 · 大数据 · 数据库 · Markdown

系统环境

Mysql

rpm -qa | grep mysql

yum remove xxx

find / -name mysql

rm -rf

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

yum localinstall mysql57-community-release-el7-8.noarch.rpm

yum install -y mysql-community-server

systemctl start mysqld

systemctl enable mysqld

grep 'temporary password' /var/log/mysqld.log

mysql -uroot -p

SHOW VARIABLES LIKE 'validate_password%';

set global validate_password_policy=LOW;

set global validate_password_length=6;

create user hive@'%' identified by 'hive';

grant all on *.* to hive@'%' ;

flush privileges;

 

hadoop-2.10.0

#hadoop

export HADOOP_HOME=/opt/modules/hadoop-2.10.0

export PATH=$PATH:$HADOOP_HOME/bin

 

hive-2.3.6

#hive

export HIVE_HOME=/opt/modules/hive-2.3.6

export PATH=$PATH:$HIVE_HOME/bin

 

cp hive-log4j2.properties.template hive-log4j2.properties

cp hive-env.sh.template hive-env.sh

hive-2.3.6/conf/hive-site.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

 <property>

    <name>javax.jdo.option.ConnectionURL</name>

    <value>jdbc:mysql://192.168.0.189:3306/hive?allowPublicKeyRetrieval=true&useSSL=false</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>hive</value>

    <description>Username to use against metastore database</description>

  </property>

  <property>

    <name>javax.jdo.option.ConnectionPassword</name>

    <value>hive</value>

    <description>password to use against metastore database</description>

  </property>

</configuration>

 

schematool -dbType mysql -initSchema

 

 

图形化

hive --service hiveserver2 &

http://192.168.0.189:10002/

 

修改端口

hiveserver2 --hiveconf hive.server2.thrift.port=14000

 

private static String driverName = "org.apache.hive.jdbc.HiveDriver";
private static String url = "jdbc:hive2://192.168.0.189:10000/hive_1";
private static String user = "root";  //服务器用户名
private static String password = "";

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。