hadoop 操作

hadoop fs -ls /   看根目录下的所有文件

显示HDFS块信息

[email protected]:~$ hdfs fsck / -files
Connecting to namenode via http://node-master:9870/fsck?ugi=hadoop&files=1&path=%2F
FSCK started by hadoop (auth:SIMPLE) from /192.168.56.2 for path / at Sun Oct 27 17:37:28 AEDT 2019
/ <dir>
/alice.txt 173595 bytes, replicated: replication=2, 1 block(s):  OK
/readme.txt 152 bytes, replicated: replication=2, 1 block(s):  OK

Status: HEALTHY
 Number of data-nodes:    3
 Number of racks:        1
 Total dirs:            1
 Total symlinks:        0

Replicated Blocks:
 Total size:    173747 B
 Total files:    2
 Total blocks (validated):    2 (avg. block size 86873 B)
 Minimally replicated blocks:    2 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    0 (0.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    2
 Average block replication:    2.0
 Missing blocks:        0
 Corrupt blocks:        0
 Missing replicas:        0 (0.0 %)

Erasure Coded Block Groups:
 Total size:    0 B
 Total files:    0
 Total block groups (validated):    0
 Minimally erasure-coded block groups:    0
 Over-erasure-coded block groups:    0
 Under-erasure-coded block groups:    0
 Unsatisfactory placement block groups:    0
 Average block group size:    0.0
 Missing block groups:        0
 Corrupt block groups:        0
 Missing internal blocks:    0
FSCK ended at Sun Oct 27 17:37:28 AEDT 2019 in 3 milliseconds

The filesystem under path ‘/‘ is HEALTHY
[email protected]:~$ hdfs fsck / -blocks
Connecting to namenode via http://node-master:9870/fsck?ugi=hadoop&blocks=1&path=%2F
FSCK started by hadoop (auth:SIMPLE) from /192.168.56.2 for path / at Sun Oct 27 17:40:29 AEDT 2019

Status: HEALTHY
 Number of data-nodes:    3
 Number of racks:        1
 Total dirs:            1
 Total symlinks:        0

Replicated Blocks:
 Total size:    173747 B
 Total files:    2
 Total blocks (validated):    2 (avg. block size 86873 B)
 Minimally replicated blocks:    2 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    0 (0.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    2
 Average block replication:    2.0
 Missing blocks:        0
 Corrupt blocks:        0
 Missing replicas:        0 (0.0 %)

Erasure Coded Block Groups:
 Total size:    0 B
 Total files:    0
 Total block groups (validated):    0
 Minimally erasure-coded block groups:    0
 Over-erasure-coded block groups:    0
 Under-erasure-coded block groups:    0
 Unsatisfactory placement block groups:    0
 Average block group size:    0.0
 Missing block groups:        0
 Corrupt block groups:        0
 Missing internal blocks:    0
FSCK ended at Sun Oct 27 17:40:29 AEDT 2019 in 4 milliseconds

The filesystem under path ‘/‘ is HEALTHY
[email protected]:~$ hdfs fsck /readme.txt -files
Connecting to namenode via http://node-master:9870/fsck?ugi=hadoop&files=1&path=%2Freadme.txt
FSCK started by hadoop (auth:SIMPLE) from /192.168.56.2 for path /readme.txt at Sun Oct 27 17:43:58 AEDT 2019
/readme.txt 152 bytes, replicated: replication=2, 1 block(s):  OK

Status: HEALTHY
 Number of data-nodes:    3
 Number of racks:        1
 Total dirs:            0
 Total symlinks:        0

Replicated Blocks:
 Total size:    152 B
 Total files:    1
 Total blocks (validated):    1 (avg. block size 152 B)
 Minimally replicated blocks:    1 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    0 (0.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    2
 Average block replication:    2.0
 Missing blocks:        0
 Corrupt blocks:        0
 Missing replicas:        0 (0.0 %)

Erasure Coded Block Groups:
 Total size:    0 B
 Total files:    0
 Total block groups (validated):    0
 Minimally erasure-coded block groups:    0
 Over-erasure-coded block groups:    0
 Under-erasure-coded block groups:    0
 Unsatisfactory placement block groups:    0
 Average block group size:    0.0
 Missing block groups:        0
 Corrupt block groups:        0
 Missing internal blocks:    0
FSCK ended at Sun Oct 27 17:43:58 AEDT 2019 in 1 milliseconds

The filesystem under path ‘/readme.txt‘ is HEALTHY

原文地址:https://www.cnblogs.com/cschen588/p/11747252.html

时间: 2024-10-10 09:44:48

hadoop 操作的相关文章

本地通过Eclipse链接Hadoop操作Mysql数据库问题小结

前一段时间,在上一篇博文中描述了自己抽时间在构建的完全分布式Hadoop环境过程中遇到的一些问题以及构建成功后,通过Eclipse操作HDFS的时候遇到的一些问题,最近又想进一步学习学习Hadoop操作Mysql数据库的一些知识,在这里网上存在很多分歧,很多人可能会笑话,用那么“笨重”的Hadoop来操作数据库,脑子有问题吧,Hadoop的HDFS优势在于处理分布式文件系统,这种说法没有任何错误,数据库的操作讲究“安全.轻便.快捷”,用Hadoop操作完全是不符合常理啊,那为啥还要学习这个东西呢

hadoop操作

常用命令: https://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html ls命令 /usr/bin/hadoop/software/hadoop/bin/hadoop fs -ls hdfs://machine:9000/home/cloudops/jia/v0001/0001/src/20151230211015.0030381.rank.0001 touch命令 /usr/bin/hadoop/software/hadoop/bin/ha

基本hadoop文件操作

1.启动hadoop工程 2.eclipse导入插件 将hadoop-eclipse-plugin-2.6.0.jar插件导入eclipse中,重启eclipse 3.在Map/Reduce的窗口下建立连接(单机版) 4.创建工程,导入jar,配置文件 提示:工程要用到hadoop的jar包,所以要把hadoop的jar包全部导入建立的工程! core-site.xml: <?xml version="1.0" encoding="UTF-8"?> &l

hadoop - 基础操作

查看文件: [[email protected] hadoop]# hadoop fs -lsr /drwxr-xr-x - root supergroup 0 2016-12-27 10:49 /homedrwxr-xr-x - root supergroup 0 2016-12-27 10:49 /home/hadoopdrwxr-xr-x - root supergroup 0 2016-12-27 10:49 /home/hadoop/tmpdrwxr-xr-x - root super

为Linux集群创建新账户,并配置hadoop集群

转自:http://blog.csdn.net/bluesky8640/article/details/6945776 之前装python.jdk.hadoop都是用的root账户,这是一个绝对的失策,linux对用户访问权限很严格,新创的hod账户根本无法启动hadoop,而root在hod模式下使用torque是不被建议的,所以只能用hod账户再重新装一遍. 创建用户.设置密码.修改用户.删除用户: useradd testuser   创建用户testuserpasswd testuser

Hadoop集群大数据平台搭建

Hadoop集群环境搭建配置 前言 Hadoop的搭建分为三种形式:单机模式.伪分布模式.完全分布模式,只要掌握了完全分布模式,也就是集群模式的搭建,剩下的两种模式自然而然就会用了,一般前两种模式一般用在开发或测试环境下,Hadoop最大的优势就是分布式集群计算,所以在生产环境下都是搭建的最后一种模式:完全分布模式. 硬件选择 须知: 分布式环境中一个服务器就是一个节点 节点越多带来的是集群性能的提升 一个Hadoop集群环境中,NameNode,SecondaryNameNode和DataNo

大数据系列(3)——Hadoop集群完全分布式坏境搭建

前言 上一篇我们讲解了Hadoop单节点的安装,并且已经通过VMware安装了一台CentOS 6.8的Linux系统,咱们本篇的目标就是要配置一个真正的完全分布式的Hadoop集群,闲言少叙,进入本篇的正题. 技术准备 VMware虚拟机.CentOS 6.8 64 bit 安装流程 我们先来回顾上一篇我们完成的单节点的Hadoop环境配置,已经配置了一个CentOS 6.8 并且完成了java运行环境的搭建,Hosts文件的配置.计算机名等诸多细节. 其实完成这一步之后我们就已经完成了Had

部署Hadoop集群为什么优先选择硬件方式而不是虚拟化方式?

刀片服务器.SAN.虚拟化技术 "螺旋式前进"这种东西存在于各个领域,在大规模数据存储与处理上,一样如此. 曾经,当管理人员购买服务器的时候,如需更高的性能,则会购买更高配置的服务器,这种做法称之为 "纵向扩展(Scale up)" :后来当我们意识到纵向扩展会带来更高的开销时,我们开始采用购买更多的服务器来解决问题,而不是购买更高端的服务器,这种做法叫做 "横向扩展(Scale Out)" .今天的数据中心就是如此,由于机架空间是很重要的一个因

关于 Hadoop 的那些事

Hadoop以前是,现在仍然是大数据批处理领域的王者.Hadoop逐渐完善的生态体系,也让Hadoop广泛应用于各行业. 本文首先介绍Hadoop的架构和原理,侧重于Map-Reduce计算部分.再以简单示例带大家入门. 一.Hadoop 介绍 Hadoop 是什么 Hadoop是一个开发和运行大规模数据分析程序的软件平台,是隶属Apache的一个用java语言实现的开源软件框架,在大量普通服务器组成的集群中对海量数据进行分布式计算. a java based software framewor