您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關hive如何進行配置,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
安裝Hive的前提條件是已經部署了Hadoop和PostgreSQL。PostgreSQL是一種特性非常齊全的自由軟件的對象-關系型數據庫管理系統(ORDBMS)
安裝步驟
第一步:下載安裝包apache-hive-2.3.6-bin.tar.gz并上傳到服務器;
第二步:解壓縮后,將安裝文件拷貝到/usr/local/目錄下。
tar xzvf apache-hive-2.3.6-bin.tar.gz mv apache-hive-2.3.6-bin /usr/local/hive
第三步:打開/etc/profile,配置環境變量。
vi /etc/profile
輸入以下內容:
export HIVE_HOME=/usr/local/hive export PATH=$HIVE_HOME/bin:$PATH
保存后生效:
source /etc/profile
第四步:配置PostgreSQL作為元數據庫
進入/usr/local/hive/conf/目錄,執行如下操作
cp hive-default.xml.template hive-site.xml vi hive-site.xml
找到如下內容的name并修改對應的value
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:postgresql://{hostname}:5432/{hivedatabase}?createDatabaseIfNotExist=true</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>org.postgresql.Driver</value> <description>Driver class name for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>{hivepassword}</value> <description>password to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>{hiveusername}</value> <description>Username to use against metastore database</description> </property> <property> <name>hive.metastore.schema.verification</name> <value>false</value> <description> Enforce metastore schema version consistency. True: Verify that version information stored in is compatible with one from Hive jars. Also disable automatic schema migration attempt. Users are required to manually migrate schema after Hive upgrade which ensures proper metastore schema migration. (Default) False: Warn if the version information stored in metastore doesn't match with one from in Hive jars. </description> </property>
調整臨時目錄
<property> <name>hive.exec.local.scratchdir</name> <value>/usr/local/hive/tmp</value> <description>Local scratch space for Hive jobs</description> </property> <property> <name>hive.downloaded.resources.dir</name> <value>/usr/local/hive/tmp/resources</value> <description>Temporary local directory for added resources in the remote file system.</description> </property> <property> <name>hive.querylog.location</name> <value>/usr/local/hive/tmp</value> <description>Location of Hive run time structured log file</description> </property> <property> <name>hive.server2.logging.operation.log.location</name> <value>/usr/local/hive/tmp/operation_logs</value> <description>Top level directory where operation logs are stored if logging functionality is enabled</description> </property>
第五步:使用schematool 初始化metastore的schema
schematool -dbType postgres -initSchema
第六步:啟動hive
# hive
關于hive如何進行配置就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。