Hive 环境配置 详解
来源:互联网 发布:旧版本ios软件 编辑:程序博客网 时间:2024/06/05 00:43
1、由于hive依赖于Hadoop框架,所以首先启动Hadoop相关守护进程
注 : 需要先安装Hadoop
-> namenode $ sbin/hadoop-daemon.sh start namenode
-> datanode $ sbin/hadoop-daemon.sh start datanode
-> Resourcemanager $ sbin/yarn-daemon.sh start resourcemanager
-> nodemanager $ sbin/yarn-daemon.sh start nodemanager
-> historyserver $ sbin/mr-jobhistory-daemon.sh start historyserver
2、上传hive安装包到系统,在解压安装包
$ tar -zxf apache-hive-0.13.1-bin.tar.gz -C /opt/modules/
$ cd /opt/modules/hive-0.13.1-bin// 此处的 Hive 文件已被重命名
3、在HDFS上创建对应的目录,并赋予权限
$ cd /opt/modules/hadoop-2.5.0
$ bin/hdfs dfs -mkdir /tmp
$ bin/hdfs dfs -mkdir -p /user/hive/warehouse
$ bin/hdfs dfs -chmod g+w /tmp
$ bin/hdfs dfs -chmod g+w /user/hive/warehouse
注: hadoop fs 在 Hadoop1.x 系列版本中使用的命令
metadata -> 元数据
表和数据的关联 -> 都需要存储
数据库和表
元数据默认存储在 -> Derby数据库
一般公司都存储在关系型数据库中: mysql oracle
/user/hive/warehouse -> 数据仓库目录 -> 保存 hive所有的数据
4、.template代表不启用,不生效的文件
$ cd /opt/modules/hive-0.13.1-bin
$ cd conf/
$ ls
5、hive-default.xml 包含了 hive所有的配置项,hive.metastore.warehouse.dir代表hive在HDFS上的默认目录路径
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
6、修改 hive-env.sh.template,将template去掉
1> 指定 Hadoop 的工作目录路径
HADOOP_HOME=/opt/modules/hadoop-2.5.0
2> 指定用户自定义文件的所在目录路径:
export HIVE_CONF_DIR=/opt/modules/hive-0.13.1-bin/conf
7、启动hive
$ cd /opt/modules/hive-0.13.1-bin
$ bin/hive
hive提供了一个可以交互的shell命令行
8、创建一张表
create table student(
num int,
name string
) row format delimited fields terminated by'\t';
注: hive 的命令行中不允许出 Tab键
-> 需要指定分隔符,让数据文件与表的结构对应
->创建一个测试文件
-> 加载数据
load data local inpath '/opt/datas/student.txt' into table student;
0 0
- Hive 环境配置 详解
- Hive环境配置
- HIVE环境配置
- Hive环境配置
- 3.配置hive环境
- Hive安装配置详解
- Hive安装配置详解
- Hive安装配置详解
- Hive安装配置详解
- hive安装配置详解
- Hive的配置项详解
- Hive配置项的含义详解 hive的配置
- 记hadoop hive mysql环境配置
- spark+hive+hdfs windows开发环境配置:
- spark+hive win7开发环境配置
- Hive安装(一)之环境配置
- HIVE+MYSQL+HADOOP环境配置(用于学习)
- Hive安装配置指北(含Hive Metastore详解)
- Android视频裁剪(含裁剪View)
- 最短路径算法 Dijkstra算法 Floyd算法 简述
- ue4-Network相关-组件及数据同步
- 创建 OVS 外部网络 ext_net - 每天5分钟玩转 OpenStack(144)
- 不要过度依赖JQuery(三)
- Hive 环境配置 详解
- JRebel破解及使用方法 在tomcat-maven-plugin及tomcat中的使用
- Leetcode 125. Valid Palindrome
- 1025. PAT Ranking (25)
- C语言上课笔记:第一个C程序Hello World
- word cloud install
- Nodejs 学习笔记-概括(一)
- 对数的理解
- 【t080】遗址