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. CTFshow萌新赛-萌新福利

    下载链接文件 拿到show.bin文件 使用010Editor工具打开文件 做取反操作 取反后可以看到 把show.bin改为show.m4a 使用音频播放软件播放,即可得到flag

  2. BDC应用

    第一步:SHDB或者是SM35进入BDC录制事务.开始录制. 第二部:保存录制的记录. 第三步:在你自己的程序中定义一个内表如:ITAB TYPE TABLE OF BDCDATA. 再定义一个工作空 ...

  3. [Cerc2005]Knights of the Round Table

    题目描述 有n个骑士经常举行圆桌会议,商讨大事.每次圆桌会议至少有3个骑士参加,且相互憎恨的骑士不能坐在圆桌的相邻位置.如果发生意见分歧,则需要举手表决,因此参加会议的骑士数目必须是大于1的奇数,以防 ...

  4. CSS响应式布局学习笔记(多种方法解决响应式问题)

    在做web开发的工作中,会遇到需要我给页面根据设计的要求,进行响应式布局,这里跟大家分享下我对于响应式布局的解决方法: 我主要利用的是CSS3 媒体查询,即media queries,可以针对不同的媒 ...

  5. 试玩 GOWOG ,初探 OpenAI(使用 NeuroEvolution 神经进化)与 Golang 多人在线游戏开发

    GOWOG: 原项目:https://github.com/giongto35/gowog 我调整过的:https://github.com/Kirk-Wang/gowog GOWOG 是一款迷你的, ...

  6. (13)-Python3之--获取当前时间

    1.导入datetime模块 import datetime 2.获取当前日期和时间 import datetime now_time = datetime.datetime.now() print( ...

  7. Property or method "previewUrl" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components,

    Property or method "previewUrl" is not defined on the instance but referenced during rende ...

  8. 借助 AppleScript 一键打开工作空间

    我有个小毛病:同时只能在一个工程里工作. 假如让我开四五个 Webstorm,在工程里 A 改个Bug,然后又到工程 B 里加个需求,再去工程 C 发个版,切来切去一会儿就懵了. 于是有了这个项目:m ...

  9. Markdown 编辑器+同步预览+文件笔记管理+静态博客 metadata 管理

    Leanote: 1. 笔记管理, 支持富文本, markdown, 写作模式.... 编辑器绝对好用. 另外特意为coder制作了一个贴代码的插件, 真是太贴心(因为作者也是coder) 2. 博客 ...

  10. 邮件解析 CNAME记录 A记录 NS记录 MX记录

    域名配置 示例发信配置请至域名 service.i-test.cn DNS服务提供商处添加TXT记录,并保持SPF记录正确,否则会无法发信.*1.所有权验证类型 主机记录 主域名 记录值 状态TXT ...