下载

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
mkdir hive
cd hive
tar -zxvf apache-hive-3.1.3-bin.tar.gz
cd apache-hive-3.1.3-bin/conf
cp hive-log4j2.properties.template hive-log4j2.properties
vi 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://localhost:3306/hive?createDatabaseIfNotExist=true</value>
 </property>
 <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>root</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value></value>
  </property>
</configuration>

# 下载并拷贝protobuf-java-3.21.9.jar和mysql-connector-java-5.1.46.jar到lib目录,删除已有protobuf-java-2.5.0.jar文件

# hive和mysql服务器都要执行,mysql要重启服务
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cd ../bin
./schematool -dbType mysql -initSchema