hive的安装和升级
目录
安装
nohup hive –service hiveserver &
启动:
sudo nohup ./hive --service metastore &-----------Startup Hive Embedded(如果metastore配置成 remote方式 那就应该把metastore也启动) 测试standalone,必须用remote mysql那种设置
- 1,hive 命令行模式。
- 直接输入/hive/bin/hive的执行程序
- 或者输入 hive –service cli 用于linux平台命令行查询,查询语句基本跟mysql查询语句类似
- 2, hive web界面的启动方式,hive –service hwi
用于通过浏览器来访问hive,感觉没多大用途 - 3, hive 远程服务 (端口号10000) 启动方式,
nohup hive –service hiveserver &
用java等程序实现通过jdbc等驱动的访问hive就用这种起动方式了,这个是程序员最需要的方式了.启动hive service :$HIVE_HOME/bin/hive --service hiveserver 10001 >/dev/null 2>/dev/null &
参考:调用javaAPI访问hive
参考:
hive-1.2.1安装步骤
升级
目标
- 对hive从0.14.0升级到1.2.1,
- 集群中使用了hue,升级后检查hue是否能够正常。
整个过程如下
- 检查环境、当前配置
- 当前运行情况
- 下载最新版
- 上传并替换现有目录
- 用最新的密码。在金山云主机.XLS
- 在登录生产线的时候选择sftp协议
- 修改配置文件
- 修改权限为hive
- 启动
- 升级参考
检查环境
hive、hue都是只用部署在一个节点上的,只考虑一个节点,确认下安装位置。
配置文件
确定hue安装节点
[kduser@master1 conf]$ netstat -ano | grep 9401
tcp 0 0 0.0.0.0:9401 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.76:60402 TIME_WAIT timewait (14.46/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.76:50811 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.172:8322 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.76:19791 TIME_WAIT timewait (44.73/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.76:39595 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9401 219.133.170.76:2382 ESTABLISHED off (0.00/0/0)
确定hive的安装节点
[kduser@master1 conf]$ netstat -ano | grep 9300
tcp 0 0 10.63.7.30:9300 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:48307 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:64415 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:7435 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 1 0 10.63.7.30:41196 10.63.7.30:9300 CLOSE_WAIT off (0.00/0/0)
tcp 0 0 10.63.7.30:64428 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 1 0 10.63.7.30:34734 10.63.7.30:9300 CLOSE_WAIT off (0.00/0/0)
tcp 0 0 10.63.7.30:53330 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:48307 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 1 0 10.63.7.30:32012 10.63.7.30:9300 CLOSE_WAIT off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:64428 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:64415 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:54545 10.63.7.30:9300 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:7435 ESTABLISHED off (0.00/0/0)
tcp 1 0 10.63.7.30:32153 10.63.7.30:9300 CLOSE_WAIT off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:53330 ESTABLISHED off (0.00/0/0)
tcp 0 0 10.63.7.30:9300 10.63.7.30:54545 ESTABLISHED off (0.00/0/0)
查看hue的目录
[kduser@master1 hue]$ cd hue
[kduser@master1 hue]$ ll
total 80
-rw-rw-r-- 1 hue hue 2782 Jun 17 2015 app.reg
drwxrwxr-x 22 hue hue 4096 Jun 17 2015 apps
drwxrwxr-x 4 hue hue 4096 Jun 17 2015 build
drwxrwxr-x 5 hue hue 4096 Jun 17 2015 desktop
drwxrwxr-x 3 hue hue 4096 May 4 2015 ext
-rw-rw-r-- 1 hue hue 11358 May 4 2015 LICENSE.txt
drwxrwxr-x 2 hue hue 4096 Apr 7 13:56 logs
-rw-rw-r-- 1 hue hue 4715 May 4 2015 Makefile
-rw-rw-r-- 1 hue hue 44 Jun 17 2015 Makefile.buildvars
-rw-rw-r-- 1 hue hue 8505 May 4 2015 Makefile.sdk
-rw-rw-r-- 1 hue hue 3498 May 4 2015 Makefile.vars
-rw-rw-r-- 1 hue hue 2192 May 4 2015 Makefile.vars.priv
-rw-rw-r-- 1 hue hue 1562 May 4 2015 README
drwxrwxr-x 4 hue hue 4096 Jun 17 2015 tools
-rw-rw-r-- 1 hue hue 932 May 4 2015 VERSION
[kduser@master1 hue]$ cd desktop/
[kduser@master1 desktop]$ ll
total 244
drwxrwxr-x 2 hue hue 4096 Nov 28 17:56 conf
drwxrwxr-x 4 hue hue 4096 Jun 17 2015 core
-rw-r--r-- 1 hue hue 227328 Jun 17 2015 desktop.db
drwxrwxr-x 11 hue hue 4096 Jun 17 2015 libs
-rw-rw-r-- 1 hue hue 3400 May 4 2015 Makefile
[kduser@master1 desktop]$ cd conf/
[kduser@master1 conf]$ ll
total 48
-rw-rw-r-- 1 hue hue 37237 Nov 21 20:06 hue.ini
-rw-rw-r-- 1 hue hue 1843 May 4 2015 log4j.properties
-rw-rw-r-- 1 hue hue 1550 May 4 2015 log.conf
[kduser@master1 conf]$ more hue.ini
# Hue configuration file
# ===================================
#
# For complete documentation about the contents of this file, run
# $ <hue_root>/build/env/bin/hue config_help
#
# All .ini files under the current directory are treated equally. Their
# contents are merged to form the Hue configuration, which can
# can be viewed on the Hue at
# http://<hue_host>:<port>/dump_config
###########################################################################
# General configuration for core Desktop features (authentication, etc)
###########################################################################
[desktop]
# Set this to a random string, the longer the better.
# This is used for secure hashing in the session store.
secret_key=
# Webserver listens on this address and port
http_host=0.0.0.0
http_port=9401
# Time zone name
time_zone=UTC
# Enable or disable Django debug mode.
django_debug_mode=false
# Enable or disable database debug mode.
## database_logging=false
# Enable or disable backtrace for server error
http_500_debug_mode=false
# Enable or disable memory profiling.
## memory_profiler=false
# Server email for internal error messages
## django_server_email='hue@localhost.localdomain'
# Email backend
找hue和hive的关系,发现hue.ini中的beeswax就是hive相关的
[kduser@master1 hue]$ find . -name hive
./apps/oozie/examples/unmanaged/hive
./apps/oozie/examples/managed/hive
[kduser@master1 hue]$
[kduser@master1 conf]$ pwd
/mnt/vdc/hue/hue/desktop/conf
[kduser@master1 conf]$ ll
total 48
-rw-rw-r-- 1 hue hue 37237 Nov 21 20:06 hue.ini
-rw-rw-r-- 1 hue hue 1843 May 4 2015 log4j.properties
-rw-rw-r-- 1 hue hue 1550 May 4 2015 log.conf
more hue.ini
[beeswax]
# Host where HiveServer2 is running.
# If Kerberos security is enabled, use fully-qualified domain name (FQDN).
hive_server_host=master1
# Port where HiveServer2 Thrift server runs on.
hive_server_port=9300
# Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/mnt/vdc/hive/conf
# Timeout in seconds for thrift calls to Hive service
## server_conn_timeout=120
# Choose whether to use the old GetLog() thrift call from before Hive 0.14 to retrieve the logs.
# If false, use the FetchResults() thrift call from Hive 1.0 or more instead.
## use_get_log_api=false
# Set a LIMIT clause when browsing a partitioned table.
# A positive value will be set as the LIMIT. If 0 or negative, do not set any limit.
## browse_partitioned_table_limit=250
# A limit to the number of rows that can be downloaded from a query.
# A value of -1 means there will be no limit.
# A maximum of 65,000 is applied to XLS downloads.
## download_row_limit=1000000
# Hue will try to close the Hive query when the user leaves the editor page.
# This will free all the query resources in HiveServer2, but also make its results inaccessible.
## close_queries=false
# Thrift version to use when communicating with HiveServer2.
# New column format is from version 7.
thrift_version=7
解压上传的压缩包
tar -zxvf apache-hive-1.2.1-bin.tar.gz
mv apache-hive-1.2.1-bin hive
把旧版本中conf的配置文件复制到新版本目录中
cp /mnt/vdc/hive/conf/hive-env.sh .
cp /mnt/vdc/hive/conf/hive-site.xml .
添加其他配置文件
cp beeline-log4j.properties.template beeline-log4j.properties
sudo cp beeline-log4j.properties.template beeline-log4j.properties
sudo hive-default.xml.template hive-default.xml
sudo cp hive-default.xml.template hive-default.xml
sudo cp hive-log4j.properties.template hive-log4j.properties
sudo cp hive-exec-log4j.properties.template hive-exec-log4j.properties
因为配置的hive用mysql数据库,需要加连接驱动
cd hive/lib
sudo cp /mnt/vdc/hive_old/lib/mysql-connector-java-5.1.38.jar
修改权限
sudo chown -R hive:hive hive
遇到的问题:
启动hive annot access /mnt/vdc/spark/lib/spark-assembly-*.jar: No such file
在命令行敲入hive启动的时候
- 无法访问/home/ndscbigdata/soft/spark-2.0.0/lib/spark-assembly-*.jar: 没有那个文件或目录。
- 无法找到hadoop相关的类
hive默认了一些类库的位置。说明我在/etc/profile中配置的环境变量没起作用。
解决方法:
在hive/conf的中的hive.env中添加:
参考:无法访问../lib/spark-assembly-*.jar: 没有那个文件或目录的解决办法
参考
HUE配置HIVE - 单行道| - 博客园 http://www.cnblogs.com/one--way/p/5687857.html
hive的安装和升级的更多相关文章
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part2:clusterware安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part2:clusterware安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 3.安装Clus ...
- Database first with EntityFramework (Migration)安装和升级
最近看了国外几个项目,发现用EntityFramework做Code First的项目现在很流行. 最让我有兴趣的一个功能则是,EntityFramework对于数据库的安装和升级的无缝完美支持,且很 ...
- Oracle10G无图形安装及升级
Oracle10.2.0.1静默安装及升级到10.2.0.4 下载及解压好database和Disk1 环境配置: su - oracle vim ~/.bash_profile 保存. vim /d ...
- Hive的安装
Hive的安装 第一步:解压并安装:第二步:配置 1)root用户下,解压后,改名为hive,并将hive文件夹赋给hadoop用户 tar -zxvf hive-0.9.0.tar.gz -C ...
- hive权威安装出现的不解错误!(完美解决)两种方法都可以
以下两种方法都可以,推荐用方法一! 方法一: 步骤一: yum -y install mysql-server 步骤二:service mysqld start 步骤三:mysql -u root - ...
- 转载 在 Linux 虚拟机中手动安装或升级 VMware Tools
http://pubs.vmware.com/workstation-12/index.jsp?lang=zh_CN&topic=/com.vmware.ws.using.doc/GUID-0 ...
- Ubuntu 如何使用apt命令安装、升级、卸载软件
apt-get是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索.安装.升级.卸载软件或操作系统. apt-get命令一般需要root权限执行,所以一般跟着su ...
- Hive的安装配置
Hive的安装配置 Hive的安装配置 安装前准备 下载Hive版本1.2.1: 1.[root@iZ28gvqe4biZ ~]# wget http://mirror.bit.edu.cn/apac ...
随机推荐
- ASP.NET MVC 项目直接预览PDF文件
背景及需求 项目使用的是MVC4框架,其中有一个功能是根据设置生成PDF文件,并在点击时直接预览. 实现过程 1.第一版实现代码: HTML内容 @{ Layout = null; } <!DO ...
- R系列:分词、去停用词、画词云(词云形状可自定义)
附注:不要问我为什么写这么快,是16年写的. R的优点:免费.界面友好(个人认为没有matlab友好,matlab在我心中就是统计软件中极简主义的代表).小(压缩包就几十M,MATLAB.R2009b ...
- .Net Core迁移到MSBuild的多平台编译问题
一.前言 本篇主要讨论.NET Core应用程序项目结构的主题,重点探索.NET Core应用程序的多平台编译问题,这里指的多平台是指.NET Framework..NET Core App..NET ...
- 如何快速的学习selenium工具
分享即快乐. 最近几年,软件测试工程师一度成为热门职业,作为测试员也是倍感压力.作为测试员来说,仅仅会手工测试让职业生涯陷入瓶颈.于是工作之余充电,学习了自动化测试工具selenium,打算进阶中高级 ...
- 【Zookeeper】源码分析之服务器(二)
一.前言 前面阐述了服务器的总体框架,下面来分析服务器的所有父类ZooKeeperServer. 二.ZooKeeperServer源码分析 2.1 类的继承关系 public class ZooKe ...
- javascript的字符串判断方法
Javascript中判断符号主要有:==.!=.===.!== ==.!=这两个符号在判断之前会先对变量类型进行转换,如果类型相同会再比较值; ===.!==这是直接判断两个变量的类型,如果类型不一 ...
- Java垃圾回收学习笔记
通常来说,要写Java代码,你基本上都没必要听说垃圾回收这个概念的.这不,对于已经写了5年多Java代码的我来说,我还没有哪次经历说是需要使用垃圾回收方面的知识来解决问题的.但是,我依然督促自己花了几 ...
- Modbus软件开发实战指南 之 开发自己的Modbus Poll工具 - 2
接上一篇文章的内容. 看了前面需求提到的复杂的命令行解析功能,很多人立马开始发怵,其实大可不必. 我们都知道,Linux下的程序往往都提供了复杂的命令行参数处理机制,因为这是与 其他程序或用户进行交互 ...
- 3390: [Usaco2004 Dec]Bad Cowtractors牛的报复
3390: [Usaco2004 Dec]Bad Cowtractors牛的报复 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 69 Solved: ...
- 1342: [Baltic2007]Sound静音问题
1342: [Baltic2007]Sound静音问题 Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 710 Solved: 307[Submit][ ...