master节点安装元数据库,采用postgres:
#useradd postgres
#password postgres
su - postgres
wget https://ftp.postgresql.org/pub/source/v10beta2/postgresql-10beta2.tar.gz
tar zxvf postgresql-10beta2.tar.gz
cd postgresql-10beta2

./configure
make
su
make install

mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
----------------------------------------------------------------------------------------
#启动数据库方法 /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
#停止数据库的方法 /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile stop
----------------------------------------------------------------------------------------
安装完毕后配置
--以管理员身份登入PG:
psql postgres -U postgres

--创建用户hive_user:
Create user hive_user;

--创建DB metastore_db,owner为hive_user:
Create database metastore_db with owner=hive_user;

--设置hive_user的密码:
\password hive_user
安装hive:
tar zxvf apache-hive-2.3.0-bin.tar.gz
vi .bash_profile
export HADOOP_HOME=$HOME/hadoop-3.0.0-alpha4
export HIVE_HOME=$HOME/apache-hive-2.3.0-bin
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin
. .bash_profile
[hd@master ~]$ $HADOOP_HOME/bin/hadoop fs -mkdir /tmp
[hd@master ~]$ $HADOOP_HOME/bin/hadoop fs -mkdir -p /user/hive/warehouse
[hd@master ~]$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /tmp
[hd@master ~]$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /user/hive/warehouse

cd apache-hive-2.3.0-bin
[hd@master apache-hive-2.3.0-bin]$ ls
bin binary-package-licenses conf examples hcatalog jdbc lib LICENSE NOTICE RELEASE_NOTES.txt scripts
[hd@master apache-hive-2.3.0-bin]$ cd conf
[hd@master conf]$ cp hive-env.sh.template hive-env.sh
[hd@master conf]$ cp hive-default.xml.template hive-site.xml
vi hive-env.sh
HADOOP_HOME
vi hive-site.xml
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:postgresql://master:5432/metastore_db?</value>
jdbc:postgresql://master:5432/metastore_db?
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.postgresql.Driver</value>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive_user</value>
<name>javax.jdo.option.ConnectionPassword</name>
<value>111111</value>

hive.metastore.warehouse.dir:(HDFS上的)数据目录
hive.exec.scratchdir:(HDFS上的)临时文件目录
hive.metastore.warehouse.dir默认值是/user/hive/warehouse
hive.exec.scratchdir默认值是/tmp/hive-${user.name}
以上是默认值,暂时不改。
[hd@master lib]$ pwd
/home/hd/apache-hive-2.3.0-bin/lib
[hd@master lib]$ wget https://jdbc.postgresql.org/download/postgresql-42.1.3.jar

[hd@master ~]$ $HIVE_HOME/bin/schematool -dbType postgres -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hd/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hd/hadoop-3.0.0-alpha4/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:postgresql://master:5432/metastore_db?
Metastore Connection Driver : org.postgresql.Driver
Metastore connection User: hive_user
Starting metastore schema initialization to 2.3.0
Initialization script hive-schema-2.3.0.postgres.sql
Initialization script completed
schemaTool completed

[hd@master ~]$ hive
which: no hbase in (/usr/java/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hd/.local/bin:/home/hd/bin:/home/hd/hadoop-3.0.0-alpha4/bin:/home/hd/hadoop-3.0.0-alpha4/sbin:apache-hive-2.3.0-bin/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hd/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hd/hadoop-3.0.0-alpha4/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/home/hd/apache-hive-2.3.0-bin/lib/hive-common-2.3.0.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. hive-on-spark
hive> show tables;
OK
Time taken: 6.186 seconds
hive> select * from test;
FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'test'
hive> create table tt (a char(3),b char(4));
OK
Time taken: 0.737 seconds
hive> show tables;
OK
tt
Time taken: 0.078 seconds, Fetched: 1 row(s)
hive>

hive+postgres安装部署过程的更多相关文章

  1. SCCM 2012 R2安装部署过程和问题(三)

    上篇 SCCM 2012 R2安装部署过程和问题(二) 个人认为对于使用SCCM 2012的最重要的经验是耐心. SCCM采用分布式部署的架构,不同的站点角色可以部署在不同的服务器上,站点角色之间的通 ...

  2. SCCM 2012 R2安装部署过程和问题(二)

    上篇:SCCM 2012 R2安装部署过程和问题(一) 在上篇我们已经完成了SCCM 2012 R2安装前的准备,其中有许多细节,关于数据库的准备和权限的设置是需要特别注意的.那么接下来我们开始安装S ...

  3. SCCM 2012 R2安装部署过程和问题(一)

    在进行Windows Server 2012 R2虚拟化测试前,由于需要安装,部署和管理很多的服务器,自然会想到该如何提高效率和有效的管理.在Windows Server 2008的时代微软已经提供称 ...

  4. 【Hadoop离线基础总结】Hive的安装部署以及使用方式

    Hive的安装部署以及使用方式 安装部署 Derby版hive直接使用 cd /export/softwares 将上传的hive软件包解压:tar -zxvf hive-1.1.0-cdh5.14. ...

  5. 免费开源的客服系统 Linux 服务器环境安装部署过程

    最近因为项目需要,要找一款在线客服系统集成在 APP 中使用,而且涉及到生意开单,客服系统必须稳定可靠.另外甲方要求,必须支持 Linux 服务器环境. 我们以 Ubuntu 18.04 为例把安装部 ...

  6. 淘宝分布式 key/value 存储引擎Tair安装部署过程及Javaclient測试一例

    文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...

  7. k8s安装部署过程个人总结及参考文章

    以下是本人安装k8s过程 一.单机配置 1. 环境准备 主机名 IP 配置 master1 192.168.1.181 1C 4G 关闭所有节点的seliux以及firewalld sed -i 's ...

  8. rocketmq安装部署过程(4.0.0版本)

    准备工作 3个虚拟机节点的构成如下 : 安装步骤 操作过程 1.安装包已经上传至其中1个节点. 2.解压缩安装包 命令:unzip rocketmq-all-4.0.0-incubating-bin- ...

  9. VS2013安装部署过程详解

    注意:缺少安装部署的小伙伴,看上一篇有详细介绍 程序在“Release”平台下编译运行没有错误 第一步:“新建”------“项目”------“其他项目类型”------“安装部署”------“I ...

随机推荐

  1. Windows程序通用自动更新模块(C#,.NET4.5以上)

    本通用自动更新模块适合所有Windows桌面程序的自动更新,不论语言,无论Winform还是wpf. 一.工作流程:1. 主程序A调起升级程序B2. B从服务器获取更新程序列表,打印更新信息.3. B ...

  2. linux7下修改主机名的方式

    在基于linux发行版的众多linux kernel 3.0以上,包括rhel7,centos7等提供多种修改linux主机名的方式 1.通过编辑/etc/hostname文件 2.命令hostnam ...

  3. 聊一聊:Service层你觉得有用吗?

    前段日子在社群(点击加入)里看到有人讨论关于Service层接口的问题,DD也经常碰到周围的新人有问过一些类似的问题:一定要写个Service层的接口吗?Service层的接口到底用做什么用的呢?好像 ...

  4. 一键配置 github 可用的 hosts

    最近发现访问 Github 各种不畅通, 静态资源经常加载不出来. 写了一个一键脚本修改本机 /etc/hosts 文件, 切换到可用的 IP (数据来自 https://gitee.com/xuew ...

  5. 亿级用户下的新浪微博平台架构 前端机(提供 API 接口服务),队列机(处理上行业务逻辑,主要是数据写入),存储(mc、mysql、mcq、redis 、HBase等)

    https://mp.weixin.qq.com/s/f319mm6QsetwxntvSXpKxg 亿级用户下的新浪微博平台架构 炼数成金前沿推荐 2014-12-04 序言 新浪微博在2014年3月 ...

  6. status http status code 状态码

    RFC 6585 - Additional HTTP Status Codes https://tools.ietf.org/html/rfc6585 https://developer.mozill ...

  7. 使用nodejs构建Docker image最佳实践

    目录 简介 准备nodejs应用程序 创建Dockerfile文件 创建.dockerignore文件 创建docker image 运行docker程序 node的docker image需要注意的 ...

  8. 一个实体对象不能由多个 IEntityChangeTracker 实例引用

    因为需求需要EF 实现批量的删除后插入,所以出现了这个报错, 这个报错的原因是,EF查询是有带跟踪的,跟踪后其他上下文想操作这个实体就会报错. 所以,查询使用 ef AsNoTracking 查后无追 ...

  9. 后端API接口的错误信息返回规范

    前言 最近我司要制定开发规范.在讨论接口返回的时候,后端的同事询问我们前端,错误信息的返回,前端有什么意见? 所以做了一些调研给到后端的同事做参考. 错误信息返回 在使用API时无可避免地会因为各种情 ...

  10. Treap——堆和二叉树的完美结合,性价比极值的搜索树

    大家好,今天和大家聊一个新的数据结构,叫做Treap. Treap本质上也是一颗BST(平衡二叉搜索树),和我们之前介绍的SBT是一样的.但是Treap维持平衡的方法和SBT不太一样,有些许区别,相比 ...