Big data cluster construction --- "hive" - rookie Xiaohui

Big data cluster construction-"hive" - ​​rookie Xiaohui


  1. Create upload decompression
  2. After installing mysql, you need to create a data set hive in mysql
  3. vi /etc/profile
vi /etc/profile
//添加
export HIVE_HOME=/opt/hive/apache-hive-2.3.3-bin
export PATH=$PATH:$HIVE_HOME/bin
//刷新环境变量
source /etc/profile

enter description here
4. Test environment variables: hive --version
enter description here
5. Create and edit configuration hive-site.xml

cd /opt/hive/apache-hive-2.3.3-bin/conf/
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://192.168.80.128:3306/hive</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>HBQ521521cf*</value>
        </property>

        <property>
                <name>hive.metastore.schema.verification</name>
                <value>false</value>
        </property>
</configuration>

enter description here

  1. Put the mysql jar package in the hive/lib directory
    enter description here
  2. Start hive (start zookeeper and hadoop first)
cd /opt/hive/apache-hive-2.3.3-bin/bin
//初始化
./schematool -initSchema -dbType mysql
./hive 

  • Attach:
  • Create a table:create table t1(id int,name String,age int ) row format delimited fields terminated by ',';
  • Create a partition table:create table t3(id int,name String,age int) partitioned by(stuid int ) row format delimited fields terminated by ',';

Guess you like

Origin blog.csdn.net/qq_39231769/article/details/102874435