Hive安装和配置

    准备软件:

    hive-0.12.0.tar.gz    

    MySQL-server-5.6.25-1.rhel5.i386.rpm

    MySQL-client-5.6.25-1.rhel5.i386.rpm

    mysql-connector-java-5.1.28.jar   

    1、解压hive:

    #tar -zxvf hive-0.12.0.tar.gz

    2、修改配置文件:

        2.1、#cp $HIVE_HOME/conf/hive-default.xml.template $HIVE_HOME/conf/hive-site.xml

        2.2、删除hive-site.xml所有数据,添加如下内容:

<property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</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>root</value>
      <description>username to use against metastore database</description>
    </property>

    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>root</value>
      <description>password to use against metastore database</description>
    </property>

    3、安装MySQL,参考:http://my.oschina.net/u/2377453/blog/425674

    4、拷贝mysql-connector-java-5.1.28.jar到$HIVE_HOME/lib

        4.1、可能面临权限问题,解决方法:

            >GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
            >FLUSH PRIVILEGES;

    5、修改/etc/profile配置文件(类似修改WINDOWS的PATH)

        export HIVE_HOME=/root/app/hive

        export PATH=$HIVE_HOME/bin:$PATH

        退出之后source /etc/profile        

    6、启动Hive

        #hive

    搭建环境完成了!

    

你可能感兴趣的:(mapreduce,mysql,hadoop,hive,安装,配置,database)