大数据集群搭建---《hive篇》 --菜鸟小回

大数据集群搭建—《hive篇》 --菜鸟小回


  1. 创建上传解压
  2. 安装好mysql,需要在mysql里面创建一个数据集hive
  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. 测试环境变量:hive --version
enter description here
5. 创建并编辑配置hive-site.xml

cd /opt/hive/apache-hive-2.3.3-bin/conf/
vi hive-site.xml



        
                javax.jdo.option.ConnectionURL
                jdbc:mysql://192.168.80.128:3306/hive
        

        
                javax.jdo.option.ConnectionDriverName
                com.mysql.jdbc.Driver
        

        
                javax.jdo.option.ConnectionUserName
                root
        

        
                javax.jdo.option.ConnectionPassword
                HBQ521521cf*
        

        
                hive.metastore.schema.verification
                false
        


大数据集群搭建---《hive篇》 --菜鸟小回_第1张图片

  1. 把mysql的jar包放到hive/lib目录下
    大数据集群搭建---《hive篇》 --菜鸟小回_第2张图片
  2. 启动hive(先启动zookeeper和hadoop)
cd /opt/hive/apache-hive-2.3.3-bin/bin
//初始化
./schematool -initSchema -dbType mysql
./hive 

  • 附:
  • 创建表:create table t1(id int,name String,age int ) row format delimited fields terminated by ',';
  • 创建分区表:create table t3(id int,name String,age int) partitioned by(stuid int ) row format delimited fields terminated by ',';

你可能感兴趣的:(大数据)