目录

  1. 安装
  2. 升级

安装

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的安装和升级的更多相关文章

  1. 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. ...

  2. 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 ...

  3. Database first with EntityFramework (Migration)安装和升级

    最近看了国外几个项目,发现用EntityFramework做Code First的项目现在很流行. 最让我有兴趣的一个功能则是,EntityFramework对于数据库的安装和升级的无缝完美支持,且很 ...

  4. Oracle10G无图形安装及升级

    Oracle10.2.0.1静默安装及升级到10.2.0.4 下载及解压好database和Disk1 环境配置: su - oracle vim ~/.bash_profile 保存. vim /d ...

  5. Hive的安装

    Hive的安装   第一步:解压并安装:第二步:配置 1)root用户下,解压后,改名为hive,并将hive文件夹赋给hadoop用户 tar -zxvf hive-0.9.0.tar.gz -C ...

  6. hive权威安装出现的不解错误!(完美解决)两种方法都可以

    以下两种方法都可以,推荐用方法一! 方法一: 步骤一: yum -y install mysql-server 步骤二:service mysqld start 步骤三:mysql -u root - ...

  7. 转载 在 Linux 虚拟机中手动安装或升级 VMware Tools

    http://pubs.vmware.com/workstation-12/index.jsp?lang=zh_CN&topic=/com.vmware.ws.using.doc/GUID-0 ...

  8. Ubuntu 如何使用apt命令安装、升级、卸载软件

    apt-get是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索.安装.升级.卸载软件或操作系统. apt-get命令一般需要root权限执行,所以一般跟着su ...

  9. Hive的安装配置

    Hive的安装配置 Hive的安装配置 安装前准备 下载Hive版本1.2.1: 1.[root@iZ28gvqe4biZ ~]# wget http://mirror.bit.edu.cn/apac ...

随机推荐

  1. nodemailer中的几个坑

    nodemailer是什么 nodemailer是一个nodejs的邮件服务模块 如何用nodemailer发邮件 1.先安装nodemailer npm i --save nodemailer 2. ...

  2. iOS开发学习路径的一些建议

    结合自己情况聊下iOS学习建议,这里不讲大道理,说说具体怎么做.欢迎大家拍砖. 1.第一点要求 ,能比较顺畅的阅读官方的文档 如果你连官方的文档读起来都非常困难,那你还谈什么提高和进阶,咱们学习iOS ...

  3. 使用OpenCL

    //函数原型举例 cl_int clGetPlatformInfo(cl_platform_id platform, cl_platform_info param_name, size_t param ...

  4. JAVA开发环境搭建 - JDK安装及环境变量配置

    1.前提条件 系统:本教程以WIN7系统为例 JDK:本教程以jdk-7u79-windows-x64为例 2.安装步骤 双击运行JDK安装程序

  5. Android性能测试工具Emmagee

    下面介绍一个简单实用的Android性能软件 ~~欢迎加入测试群574875837一起讨论研究 一.Emmagee 简介 Emmagee主要用于监控单个App的CPU,内存,流量,启动耗时,电量,电流 ...

  6. [Selenium With C#学习笔记] Lesson-06 单选按钮

    作者:Surpassme 来源:http://www.jianshu.com/p/08ee1929875f 声明:本文为原创文章,如需转载请在文章页面明显位置给出原文链接,谢谢. 单选按钮通常用在需要 ...

  7. BOM基础(一)

    学完了js的基础语法和DOM之后,就要要看看javascript中最后一项BOM了.BOM,全称brower document model,翻译过来就是浏览器对象模型.DOM是文档对象模型,属于BOM ...

  8. leetcode HouseRobber Dp Code

    #include <malloc.h> int MAX(int x,int y){ return x>y?x:y;} int rob(int* nums, int numsSize) ...

  9. c# 将匿名类或者集合转Json格式数据一些方法

    要说写这个功能呢也是因为工作需要,白天呢上班写个Web页面需要ajax请求后台并将数据以Json格式传会前端,由于公司特殊性吧,不能连外网(很苦比).所以只有等到晚上回家上网边查边写! public ...

  10. Webdriver初探

    1.启动Firefox浏览器失败 package org.coder.demo; import org.openqa.selenium.*; import org.openqa.selenium.We ...