用户工具


  • 下载hive,并解压到/usr/loca/
  • 配置环境变量
    export HIVE_HOME=/usr/local/hive-1.2.1
    export PATH=$HIVE_HOME/bin:$KAFKA_HOME/bin:$HBASE_HOME/bin/:$ZOOKEEPER_HOME/bin:$HOME/bin:$JAVA_HOME/bin/:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH

  • 修改配置文件

    cd /usr/local/hive-1.2.1/conf/
    cp hive-default.xml.template hive-site.xml
    cp hive-log4j.properties.template hive-log4j.properties
    
    创建配置文件hive-site.xml这个文件的配置会覆盖hive-default.xml,这个
    文件重要用来配置mysql存放元数据
    
    vim 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>hive</value>
    </property>
    <property>
       <name>javax.jdo.option.ConnectionPassword</name>
       <value>hive</value>
    </property>
    </configuration>