hive安装及元数据库更改成mysql

tar -zxvf hive-0.11.0.tar.gz
mv hive-0.11.0 /home/hadoop-1.0.1/contrib/
cd /home/hadoop-1.0.1/contrib/hive-0.11.0/bin
gedit hive-env.sh
#添加
export HADOOP_HOME=/home/hadoop-1.0.1
export HIVE_HOME=$HADOOP_HOME/contrib/hive-0.11.0
#复制生成hive-site.xml
cp /home/hadoop-1.0.1/contrib/hive-0.11.0/conf/hive-default.xml.template /home/hadoop-1.0.1/contrib/hive-0.11.0/conf/hive-site.xml
#编辑gedit 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>  
         </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>password</value>
      <description>password to use against metastore database</description>
    </property>

猜你喜欢

转载自ganliang13.iteye.com/blog/1736274