hive的mysql配置筆記

來源:互聯網
上載者:User

標籤:hive

配置hive使用mysql資料庫

------------------------

1.下載並加壓hive.tar.gz

2.配置環境變數

HIVE_HOME=...

PATH=..:$HIVE_HOME/bin:$HIVE_HOME/conf


$>source /etc/environment

3.建立設定檔

$>cd conf

$ cp hive-default.xml.template hive-site.xml

$ cp hive-env.sh.template hive-env.sh

$ cp hive-exec-log4j.properties.template hive-execlog4j.properties

$ cp hive-log4j.properties.template hive-log4j.properties

4.修改conf/hive-env.sh設定檔

export HADOOP_HOME=/soft/hadoop

export HIVE_CONF_DIR=/soft/hive/conf

5.修改conf/hive-site.xml檔案

hive.metastore.warehourse.dir=/user/hive/warehouse//hdfs系統

hive.exec.scratchdir=/tmp/hive-${user.name}//hdfs系統

6.配置使用mysql資料庫

0.在mysql上建立myhive資料庫

create database myhive ;

1.配置hive-ste.xml

[conf/hive-site.xml]

#javax.jdo.option.ConnectionURL // the database URL

#javax.jdo.option.ConnectionDriverName // the JDBC driver name

#javax.jdo.option.ConnectionUserName // database username

#javax.jdo.option.ConnectionPassword // database password

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://myhost:3306/myhive?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>hive</value>

<description>username to use against metastore database</description>

</property>

<property>

<name>javax.jdo.option.ConnectionPassword</name>

<value>hive</value>

<description>password to use against metastore database</description>

</property>

7.複製mysql驅動程式到${hive_home}\lib下


本文出自 “11009607” 部落格,請務必保留此出處http://11019607.blog.51cto.com/11009607/1832275

hive的mysql配置筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.