HDFS

HDFS基本命令的使用

喜夏-厌秋 提交于 2020-01-17 06:40:27
hdfs文件的相关操作主要使用hadoop fs、hadoop dfs、hdfs dfs 命令,以下对最常用的相关命令进行简要说明。 hadoop fs -ls 显示当前目录结构,-ls -R 递归显示目录结构 hadoop fs -mkdir 创建目录 hadoop fs -rm 删除文件,-rm -R 递归删除目录和文件 hadoop fs -put [localsrc] [dst] 从本地加载文件到HDFS hadoop fs -get [dst] [localsrc] 从HDFS导出文件到本地 hadoop fs - copyFromLocal [localsrc] [dst] 从本地加载文件到HDFS,与put一致 hadoop fs -copyToLocal [dst] [localsrc] 从HDFS导出文件到本地,与get一致 hadoop fs -test -e 检测目录和文件是否存在,存在返回值$?为0,不存在返回1 hadoop fs -text 查看文件内容 hadoop fs -du 统计目录下各文件大小,单位字节。-du -s 汇总目录下文件大小,-du -h 显示单位 hadoop fs -tail 显示文件末尾 hadoop fs -cp [src] [dst] 从源目录复制文件到目标目录 hadoop fs -mv [src] [dst]

HDFS - Block Size Related

这一生的挚爱 提交于 2020-01-17 06:07:28
问题 I have files of 10 MB size only.I think in HDFS first file consumes 10 MB and rest 54 MB is freed up to ad to the available space. My question is - The second file of 10 MB (or the next sequence of 10 MB files) would keep on adding to this until it becomes 64 MB? For e.g. -In total if we consume 2 blocks of 64 MB each and 20 MB of 3rd block, then the input split will give 3 outputs 2 64MB and 1 20MB ? Is it true? 回答1: With Reference from Hadoop - The Definitive Guide : HDFS stores small files

HDFS - Block Size Related

蹲街弑〆低调 提交于 2020-01-17 06:06:04
问题 I have files of 10 MB size only.I think in HDFS first file consumes 10 MB and rest 54 MB is freed up to ad to the available space. My question is - The second file of 10 MB (or the next sequence of 10 MB files) would keep on adding to this until it becomes 64 MB? For e.g. -In total if we consume 2 blocks of 64 MB each and 20 MB of 3rd block, then the input split will give 3 outputs 2 64MB and 1 20MB ? Is it true? 回答1: With Reference from Hadoop - The Definitive Guide : HDFS stores small files

【Spark SQL】1、初探大数据及Hadoop的学习

China☆狼群 提交于 2020-01-16 19:41:59
初探大数据 centos 6.4 CDH5.7.0 系列http://archive.cloudera.com/cdh5/cdh/5/ 生产或测试环境选择对应CDH版本时,一定要采用尾号一样的版本 OOPTB apache-maven-3.3.9-bin.tar.gz Jdk-7u51-linux-x64.tar.gz Zeppelin-0.7.1-bin.tgz Hive-1.1.0-cdh5.7.0.tar.gz hadoop-2.6.0-cdh5.7.0.tar.gz Mysql-connector-java.5.1.27.bin.jar Scala-2.11.8.tar.gz spark-2.1.0-bin-2.6.0-cdh5.7.0 大数据概述 数据量 速度 多样性、复杂性 基于高度分析的新价值 Hadoop 一个分布式系统基础架构,由Apache基金会开发。用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力高速运算和存储 Apache顶级项目 访问网站 projetName.apache.org 包括 HSFS/YARN/MapReduce 狭义Hadoop VS 广义Hadoop 狭义的Hadoop:是一个适合大数据分布式存储HDFS、分布式计算MapReduce和资源调度YARN的平台 广义的Hadoop:指的是Hadoop生态系统

HDFS NFS startup error: “ERROR mount.MountdBase: Failed to start the TCP server…ChannelException: Failed to bind…"

和自甴很熟 提交于 2020-01-16 10:31:54
问题 Attempting to use / startup HDFS NFS following the docs ( ignoring the instructions to stop the rpcbind service and did not start the hadoop portmap service given that the OS is not SLES 11 and RHEL 6.2 ), but running into error when trying to set up the NFS service starting the hdfs nfs3 service: [root@HW02 ~]# [root@HW02 ~]# [root@HW02 ~]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI

HDFS NFS startup error: “ERROR mount.MountdBase: Failed to start the TCP server…ChannelException: Failed to bind…"

假如想象 提交于 2020-01-16 10:31:08
问题 Attempting to use / startup HDFS NFS following the docs ( ignoring the instructions to stop the rpcbind service and did not start the hadoop portmap service given that the OS is not SLES 11 and RHEL 6.2 ), but running into error when trying to set up the NFS service starting the hdfs nfs3 service: [root@HW02 ~]# [root@HW02 ~]# [root@HW02 ~]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI

【Hive】Hive基础知识

我怕爱的太早我们不能终老 提交于 2020-01-16 08:18:10
文章目录 1. hive产生背景 2. hive是什么 3. hive的特点 3.1优点: 3.2 缺点: 4. Hive 和 RDBMS 的对比 5. hive架构 5.1 用户接口层 5.2 Thrift Server层 5.3 元数据库层 5.4 Driver核心驱动层 6. hive的数据存储(整理一) 7. hive的数据组织形式(整理二) 7.1 库 7.2 表 7.2.1 从数据的管理权限分 7.2.1.1 内部表(管理表、managed_table) 7.2.1.2 外部表(external_table) 7.2.2 从功能上分 7.2.2.1 分区表 7.2.2.2 分桶表 7.3 视图 7.4 数据存储 7.4.1 元数据 7.4.2 表数据(原始数据) 1. hive产生背景 先分析mapreduce: mapreduce主要用于数据清洗或统计分析工作 并且绝大多数的场景都是针对的结构化数据的分析 而对于结构化的数据处理我们想到sql 但数据量非常大时,没办法使用mysql等,只能使用mapreduce 可是 mapreduce 的 缺点 是: 编程不便、成本太高 hive的诞生: 如果有一个组件可以针对大数据量的结构化数据进行数据分析,但是又不用写mapreduce,直接用sql语句实现就完美了 所以hive就诞生了 直接使用 MapReduce

hdfs put/moveFromLocal not distributing data across data nodes?

跟風遠走 提交于 2020-01-16 08:06:24
问题 I found similar question Hadoop HDFS is not distributing blocks of data evenly but my ask is when replication factor = 1 I still want to understand why HDFS is not evenly distributing file blocks across the cluster nodes? This will result in data skew from start, when I load/run dataframe ops on such files. Am I missing something? 回答1: Even if replication factor is one, files are still split and stored in multiples of the HDFS block size. Block placement is on best effort, AFAIK, not purely

hive基本结构与数据存储

孤者浪人 提交于 2020-01-16 05:06:28
一、Hive简介 Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供类SQL查询功能。还可以将 SQL 语句转换为 MapReduce 任务进行运行,通过自己的 SQL 去 查询分析需要的内容,这套 SQL 简称 HQL。使用hive的优点是学习成本低,可以通过类SQL语句快速实现简单的MapReduce统计,不必开发专门的MapReduce应用,十分适合 数据仓库 的统计分析。 Hive将元数据存储在数据库(RDBMS)中,比如MySQL、Derby中。Hive有三种模式连接到数据,其方式是:单用户模式,多用户模式和远程服务模式。(也就是内嵌模式、本地模式、远程模式)。 Hive特点: 1.可扩展 Hive可以自由的扩展集群的规模,一般情况下不需要重启服务。 2. 延展性 Hive支持用户自定义函数,用户可以根据自己的需求来实现自己的函数。 3.容错 良好的容错性,节点出现问题SQL仍可完成执行。 二、Hive架构 Hive体系结构如下图: 再来一张中文的图: 其中第一张图中的Jobtracker是hadoop1.x中的组件,它的功能相当于hadoop2.x中的: Resourcemanager+AppMaster TaskTracker 相当于: Nodemanager + yarnchild 从上图可以看出

用Docker在一台笔记本电脑上搭建一个具有10个节点7种角色的Hadoop集群(下)-搭建Hadoop集群

一世执手 提交于 2020-01-16 02:14:36
上篇: 用Docker在一台笔记本电脑上搭建一个具有10个节点7种角色的Hadoop集群(上)-快速上手Docker 上篇介绍了快速上手Docker部分,下面接着介绍搭建Hadoop集群部分。 六、搭建Hadoop伪分布模式 我们先用前面创建的这个容器来搭建Hadoop伪分布模式做测试,测试成功后再搭建完全分布式集群。 1.SSH 这个centos容器可以看做是一个非常精简的系统,很多功能没有,需要自己安装。 Hadoop需要SSH,但容器没有自带,需要我们安装。 ①安装SSH # yum -y install openssh-clients openssh-server ②生成3个key文件 # ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key一路回车 # ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key 一路回车 # ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key 一路回车 ③启动sshd # /usr/sbin/sshd ④修改root密码 因为默认的密码不知道,我们重新设置一下。 # passwd root ⑤设置ssh免密登录到本机 # ssh-keygen一路回车 # ssh-copy-id localhost