189 8069 5689

hive如何进行配置

这篇文章将为大家详细讲解有关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


    javax.jdo.option.ConnectionURL
    jdbc:postgresql://{hostname}:5432/{hivedatabase}?createDatabaseIfNotExist=true


    javax.jdo.option.ConnectionDriverName
    org.postgresql.Driver
    Driver class name for a JDBC metastore


    javax.jdo.option.ConnectionPassword
    {hivepassword}
    password to use against metastore database


    javax.jdo.option.ConnectionUserName
    {hiveusername}
    Username to use against metastore database


    hive.metastore.schema.verification
    false
    
      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.
    

调整临时目录


    hive.exec.local.scratchdir
    /usr/local/hive/tmp
    Local scratch space for Hive jobs


    hive.downloaded.resources.dir
    /usr/local/hive/tmp/resources
    Temporary local directory for added resources in the remote file system.


    hive.querylog.location
    /usr/local/hive/tmp
    Location of Hive run time structured log file


    hive.server2.logging.operation.log.location
    /usr/local/hive/tmp/operation_logs
    Top level directory where operation logs are stored if logging functionality is enabled

第五步:使用schematool 初始化metastore的schema

schematool -dbType postgres -initSchema

第六步:启动hive

# hive

关于hive如何进行配置就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。


文章名称:hive如何进行配置
URL网址:http://cdxtjz.cn/article/gicppp.html

其他资讯