Contents

1 MySQL 覃ろ れ
2 谿瑚


1 MySQL 覃ろ れ #

1. mysql れ 覦
sudo apt-get install mysql-server mysql-client
/etc/init.d/mysqld start

2. mysql れ mysql 螻 覦 一危磯伎
mysql -u root -p
grant all privileges on *.* to huser@localhost identified by '9999' with grant option;
create database hive; 

3. mysql connector [http]れ企(http://www.mysql.com/downloads/connector/j/) mysql-connector-java-5.1.26.tar.gz
4. 豢 蠍
tar xzf mysql-connector-java-5.1.26.tar.gz

5. mysql-connector-java-5.1.26-bin.jar襯 HIVE_HOME/lib/ 覲旧

6. hive-site.xml
<?xml version="1.0"?>
<?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>
      <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>huser</value>
      <description>username to use against metastore database</description>
    </property>


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

hwi蟯 豢螳
<?xml version="1.0"?>
<?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>
      <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>huser</value>
      <description>username to use against metastore database</description>
    </property>

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

    <property>
        <name>hive.hwi.listen.host</name>
        <value>0.0.0.0</value>
    </property>

    <property>
        <name>hive.hwi.listen.port</name>
        <value>9999</value>
    </property>

    <property>
        <name>hive.hwi.war.file</name>
        <value>/lib/hive-hwi-0.11.0.war</value>
    </property>
</configuration>   

2 谿瑚 #