HDFS重启集群导致数据损坏,使用fsck命令修复过程
HDFS重启集群导致数据损坏,使用fsck命令修复过程
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
我们先看一组输出
[root@flume112 ~]# hdfs fsck /user/kuaikan/report_new////
Connecting to namenode via http://calculation111.aggrx:50070
FSCK started by root (auth:SIMPLE) from /10.1.2.112 for path /user/kuaikan/report_new//// at Sat May :: CST
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................Status: HEALTHY
Total size: B (Total open files size: B)
Total dirs:
Total files:
Total symlinks: (Files currently being written: )
Total blocks (validated): (avg. block size B) (Total open file blocks (not validated): ) #注意,这个26没有进行验证,说明有26个存在问题!
Minimally replicated blocks: (100.0 %)
Over-replicated blocks: (0.0 %)
Under-replicated blocks: (0.0 %)
Mis-replicated blocks: (0.0 %)
Default replication factor:
Average block replication: 3.0
Corrupt blocks:
Missing replicas: (0.0 %)
Number of data-nodes:
Number of racks:
FSCK ended at Sat May :: CST in milliseconds The filesystem under path '/user/kuaikan/report_new/2019/05/23/' is HEALTHY
[root@flume112 ~]#
官方关于fsck命令有对应的解释,我们查看更详细的信息,官方链接:https://hadoop.apache.org/docs/r2.9.1/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#fsck。
[root@flume112 ~]# hdfs fsck /user/kuaikan/report_new//// -openforwrite
Connecting to namenode via http://calculation111.aggrx:50070
FSCK started by root (auth:SIMPLE) from /10.1.2.112 for path /user/kuaikan/report_new//// at Sat May :: CST
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
................................................/user/kuaikan/report_new////report.log.----45.10---160.1558554302405.txt bytes, block(s), OPENFORWRITE: ../user/kuaikan/report_new////report.log.----45.10---248.1558554301696.txt bytes, block(s), OPENFORWRITE: ....../user/kuaikan/report_new////report.log.----45.10---71.1558554301576.txt bytes, block(s), OPENFORWRITE: .........................................
/user/kuaikan/report_new////report.log.----55.10---208.1558554901562.txt bytes, block(s), OPENFORWRITE: .../user/kuaikan/report_new////report.log.----55.10---248.1558554901949.txt bytes, block(s), OPENFORWRITE: ...../user/kuaikan/report_new////report.log.----55.10---233.1558554901647.txt bytes, block(s), OPENFORWRITE: .........................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
................................................................/user/kuaikan/report_new////report.log.----30.10---208.1558575001741.txt bytes, block(s), OPENFORWRITE: ...................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
......................./user/kuaikan/report_new////report.log.----55.10---93.1558587301545.txt bytes, block(s), OPENFORWRITE: ........../user/kuaikan/report_new////report.log.----55.10---88.1558587301803.txt bytes, block(s), OPENFORWRITE: .........................../user/kuaikan/report_new////report.log.----01.10---88.1558587709627.txt bytes, block(s), OPENFORWRITE: .....................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
.........................................................................../user/kuaikan/report_new////report.log.----45.10---35.1558601101874.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---40.1558601102383.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---46.1558601101876.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---58.1558601102255.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---93.1558601102225.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---38.1558601101874.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---208.1558601101557.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---160.1558601101782.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---33.1558601102283.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---150.1558601101668.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---248.1558601101427.txt bytes, block(s), OPENFORWRITE: ./user/kuaikan/report_new////report.log.----45.10---226.1558601101904.txt bytes, block(s), OPENFORWRITE: ./user/kuaikan/report_new////report.log.----45.10---96.1558601101582.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---88.1558601101302.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---233.1558601101531.txt bytes, block(s), OPENFORWRITE: /user/kuaikan/report_new////report.log.----45.10---71.1558601101720.txt bytes, block(s), OPENFORWRITE: .......
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
....................................................................................................
..............................................................Status: HEALTHY
Total size: B
Total dirs:
Total files:
Total symlinks:
Total blocks (validated): (avg. block size B)
Minimally replicated blocks: (99.50153 %)
Over-replicated blocks: (0.0 %)
Under-replicated blocks: (0.0 %)
Mis-replicated blocks: (0.0 %)
Default replication factor:
Average block replication: 2.985046
Corrupt blocks:
Missing replicas: (0.0 %)
Number of data-nodes:
Number of racks:
FSCK ended at Sat May :: CST in milliseconds The filesystem under path '/user/kuaikan/report_new/2019/05/23/' is HEALTHY
[root@flume112 ~]#
[root@flume112 ~]# hdfs fsck /user/kuaikan/report_new/2019/05/23/ -openforwrite
找到损坏的文件后,我们手动进行回复,注意,我们输入的必须是一个文件,并不是一个目录哟!
[root@calculation111 ~]# hdfs debug recoverLease -path /user/kuaikan/report_new////report.log.----45.10---71.1558554301576.txt -retries
recoverLease returned false.
Retrying in ms...
Retry #
recoverLease SUCCEEDED on /user/kuaikan/report_new////report.log.----45.10---71.1558554301576.txt
[root@calculation111 ~]#
HDFS重启集群导致数据损坏,使用fsck命令修复过程的更多相关文章
- Hadoop基础-HDFS集群中大数据开发常用的命令总结
Hadoop基础-HDFS集群中大数据开发常用的命令总结 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本盘博客仅仅列出了我们在实际生成环境中常用的hdfs命令,如果想要了解更多, ...
- Hadoop集群-HDFS集群中大数据运维常用的命令总结
Hadoop集群-HDFS集群中大数据运维常用的命令总结 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客会简单涉及到滚动编辑,融合镜像文件,目录的空间配额等运维操作简介.话 ...
- Hadoop(八)Java程序访问HDFS集群中数据块与查看文件系统
前言 我们知道HDFS集群中,所有的文件都是存放在DN的数据块中的.那我们该怎么去查看数据块的相关属性的呢?这就是我今天分享的内容了 一.HDFS中数据块概述 1.1.HDFS集群中数据块存放位置 我 ...
- 本地日志数据实时接入到hadoop集群的数据接入方案
1. 概述 本手册主要介绍了,一个将传统数据接入到Hadoop集群的数据接入方案和实施方法.供数据接入和集群运维人员参考. 1.1. 整体方案 Flume作为日志收集工具,监控一个文件目录或者一个文 ...
- elasticsearch5.0集群大数据量迁移方法及注意事项
当es集群的数据量较小的情况下elasticdump这个工具比较方便,但是当数据量达到一定级别比如上百G的时候,elasticdump速度就很慢了,此时我们可以使用快照的方法进行备份 elasticd ...
- MongoDB DBA 实践5-----复制集集群的数据同步和故障转移
(1)复制集集群的数据同步 1>主节点数据库test,在其中goods集合中加入一个文档. 2>在副节点中查看 注意:SECONDARY是不允许读写的,要使用rs.slaveOk()获得读 ...
- 软件架构自学笔记----分享“去哪儿 Hadoop 集群 Federation 数据拷贝优化”
去哪儿 Hadoop 集群 Federation 数据拷贝优化 背景 去哪儿 Hadoop 集群随着去哪儿网的发展一直在优化改进,基本保证了业务数据存储量和计算量爆发式增长下的存储服务质量.然而,随着 ...
- Redis 切片集群的数据倾斜分析
Redis 中如何应对数据倾斜 什么是数据倾斜 数据量倾斜 bigkey导致倾斜 Slot分配不均衡导致倾斜 Hash Tag导致倾斜 数据访问倾斜 如何发现 Hot Key Hot Key 如何解决 ...
- KingbbaseES V8R6集群维护案例之---集群之间数据迁移
案例说明: 生产环境是集群环境,测试环境是集群,现需要将生产环境的数据迁移到测试集群中运行,本文档详细介绍了从集群环境迁移数据的操作步骤,可以作为生产环境迁移数据的参考. 适用版本: Kingbase ...
随机推荐
- [LeetCode] 144. Binary Tree Preorder Traversal 二叉树的先序遍历
Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tr ...
- [LeetCode] 264. Ugly Number II 丑陋数 II
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors ...
- [LeetCode] 324. Wiggle Sort II 摆动排序 II
Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]... ...
- 【电商日志项目之六】数据分析-Hive方式
环境 hadoop-2.6.5 hive-1.2.1 一.Hive和Hbase整合如果使用Hive进行分析,Hive要从Hbase取数据(当然可以直接将数据存到Hive),那么就需要将Hive和HBa ...
- windows下Java调用可执行文件
缘起: 由于没有找到java转换文件的接口,因此使用java调用exe文件进行文件转换 public void convertFile(){ Runtime rn = Runtime.getRunti ...
- 微信小程序 与后台交互----获取服务器时间
index.wxml代码 <!--index.wxml--> <view class="container"> <text>{{date}}&l ...
- 【mysql】开启远程连接
设置root用户可以远程连接 use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;
- PHP生成短链接方法
PHP生成短链接方法方法一:新浪提供了长链接转为短链接的API,可以把长链接转为 t.cn/xxx 这种格式的短链接. API: http://api.t.sina.com.cn/short_url/ ...
- QT--学习疑惑探索
用C++定义了一个类,并注册到qml文件中,但是这个类只能用Quickview进行显示,用其他方法好像不行. 启发: 1 window控件类是没有parent的widget. 2 m_view = ...
- java笔记4
private关键字 1.是一个权限修饰符. 2.用于修饰成员 3.被私有化的成员只能在本类中有效 常用之一: -将成员变量私有化,对外提供对应的set,get方法对其进行访问 ...