hive+postgres安装部署过程
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安装部署过程的更多相关文章
- SCCM 2012 R2安装部署过程和问题(三)
上篇 SCCM 2012 R2安装部署过程和问题(二) 个人认为对于使用SCCM 2012的最重要的经验是耐心. SCCM采用分布式部署的架构,不同的站点角色可以部署在不同的服务器上,站点角色之间的通 ...
- SCCM 2012 R2安装部署过程和问题(二)
上篇:SCCM 2012 R2安装部署过程和问题(一) 在上篇我们已经完成了SCCM 2012 R2安装前的准备,其中有许多细节,关于数据库的准备和权限的设置是需要特别注意的.那么接下来我们开始安装S ...
- SCCM 2012 R2安装部署过程和问题(一)
在进行Windows Server 2012 R2虚拟化测试前,由于需要安装,部署和管理很多的服务器,自然会想到该如何提高效率和有效的管理.在Windows Server 2008的时代微软已经提供称 ...
- 【Hadoop离线基础总结】Hive的安装部署以及使用方式
Hive的安装部署以及使用方式 安装部署 Derby版hive直接使用 cd /export/softwares 将上传的hive软件包解压:tar -zxvf hive-1.1.0-cdh5.14. ...
- 免费开源的客服系统 Linux 服务器环境安装部署过程
最近因为项目需要,要找一款在线客服系统集成在 APP 中使用,而且涉及到生意开单,客服系统必须稳定可靠.另外甲方要求,必须支持 Linux 服务器环境. 我们以 Ubuntu 18.04 为例把安装部 ...
- 淘宝分布式 key/value 存储引擎Tair安装部署过程及Javaclient測试一例
文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...
- k8s安装部署过程个人总结及参考文章
以下是本人安装k8s过程 一.单机配置 1. 环境准备 主机名 IP 配置 master1 192.168.1.181 1C 4G 关闭所有节点的seliux以及firewalld sed -i 's ...
- rocketmq安装部署过程(4.0.0版本)
准备工作 3个虚拟机节点的构成如下 : 安装步骤 操作过程 1.安装包已经上传至其中1个节点. 2.解压缩安装包 命令:unzip rocketmq-all-4.0.0-incubating-bin- ...
- VS2013安装部署过程详解
注意:缺少安装部署的小伙伴,看上一篇有详细介绍 程序在“Release”平台下编译运行没有错误 第一步:“新建”------“项目”------“其他项目类型”------“安装部署”------“I ...
随机推荐
- tail -f 在对文件进行动态追踪时失效的问题
在我是用 tail -f file.txt 对这个文件进行动态追踪时: 我重新打开一个新的终端进行vim编辑这个文件并且保存 这是我们发现,tail -f file.txt'动态追踪的这个文件没有任何 ...
- 转 12 jmeter性能测试实战--web程序
12 jmeter性能测试实战--web程序 项目背景 项目:XX网站环境:Windows需求:并发登录的性能测试场景:1s增加2个线程,运行2000次(线程数20,Ramp-Up seconds ...
- Java并发组件三之Semaphore
使用场景:常用于使用有限的资源,限制线程并发的最大数量.默认情况下,信号量是非公平性的(先等待先执行为公平.类似于买东西的时候大家排队付款,先来的先付款是公平的.但是这时候有人插队,那就是非公平的)设 ...
- E4.IO.pry/0-IO.break!/1动态打点调试
IO.pry/0 IO.inspect只能在静态地打印指定的变量,Elixir的shell还可以使用IO.pry/0与IO.break!/1实现更灵活的调试方法. 假如你想查看一下函数的某个位置到底发 ...
- Qt 使用tablib获取多媒体tag信息
最近项目需要, 要获取音乐文件tag信息. 有两个方式, 本人偏向第二种方式. 效率比较高,可控性比较好. 一.QML方式 使用QML Audio component 进行解析. 将多媒体文件都放到P ...
- vue开发中的"骚操作"
前言 在与同事协作开发的过程中,见识到了不少"骚操作".因为之前都没用过,所以我愿称之为"高级技巧"! Vue.extend 在交互过程中,有个需求就是点击图标 ...
- react报错 TypeError: Cannot read property 'setState' of undefined
代码如下: class test extends Component { constructor(props) { super(props); this.state = { liked: false ...
- Dockerfile,Dockerfile 参考文档
Dockerfile,Dockerfile 参考文档 1.Dockerfile 1.1Usage 1.2Format 1.3Parser directives 1.4escape 1.5Environ ...
- CentOS 7 使用pyenv安装python3.6
安装pyenv 1.安装git yum install -y git 2.安装pyenv curl -L https://raw.githubusercontent.com/yyuu/pyenv-in ...
- python模块----pymysql模块 (连接MySQL数据库)
pymysql模块是专门用来连接mysql数据库的模块,是非标准库模块,需要pip下载 下载 pip install pymysql 查询 import pymysql # 打开数据库连接 db = ...