`
xitonga
  • 浏览: 589180 次
文章分类
社区版块
存档分类
最新评论

Mongodb secondary上面replSet error RS102 too stale to catch up

 
阅读更多

1 http://101.130.92.32:28018/_replSet 监控网站上报错:replSet error RS102 too stale to catch up
Tue Aug 13 05:18:06 [rsSync] replSet See http://www.mongodb.org/display/DOCS/Resyncing+a+Very+Stale+Replica+Set+Member
05:18:06 [rsSync] replSet error RS102 too stale to catch up
05:20:07 [rsSync] replSet syncing to: 101.130.92.323:27018
05:20:07 [rsSync] replSet error RS102 too stale to catch up, at lbgst from 101.130.92.323:27018
05:20:07 [rsSync] replSet our last optime : Aug 6 19:18:05 52014bed:2
05:20:07 [rsSync] replSet oldest at 101.130.92.323:27018 : Aug 10 10:58:26 52061cd2:17
05:20:07 [rsSync] replSet See http://www.mongodb.org/display/DOCS/Resyncing+a+Very+Stale+Replica+Set+Member
05:20:07 [rsSync] replSet error RS102 too stale to catch up
05:22:08 [rsSync] replSet syncing to: 101.130.92.323:27018
05:22:08 [rsSync] replSet error RS102 too stale to catch up, at lbgst from 101.130.92.323:27018
05:22:08 [rsSync] replSet our last optime : Aug 6 19:18:05 52014bed:2
05:22:08 [rsSync] replSet oldest at 101.130.92.323:27018 : Aug 10 10:59:17 52061d05:3e

2 察看状态,发现是recovring状态
[bguser@346437-bgstore_db1 ~]$ /db/mongodb/bin/mongo --port 27018
MongoDB shell version: 2.0.1
connecting to: 127.0.0.1:27018/test
RECOVERING> db.printReplicationInfo();
configured oplog size: 90000MB
log length start to end: 553610secs (153.78hrs)
oplog first event time: Wed Jul 31 2013 09:31:15 GMT+0000 (UTC)
oplog last event time: Tue Aug 06 2013 19:18:05 GMT+0000 (UTC)
now: Tue Aug 13 2013 06:03:40 GMT+0000 (UTC)
RECOVERING> rs.status();
{
"set" : "rpl",
"date" : ISODate("2013-08-13T06:03:49Z"),
"myState" : 3,
"syncingTo" : "101.130.92.323:27018",
"members" : [
{
"_id" : 0,
"name" : "101.130.92.32:27017",
"hbglth" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 8433,
"optime" : {
"t" : 1376373827000,
"i" : 16
},
"optimeDate" : ISODate("2013-08-13T06:03:47Z"),
"lastHbgrtbbgt" : ISODate("2013-08-13T06:03:47Z"),
"pingMs" : 0
},
{
"_id" : 4,
"name" : "101.130.92.32:27019",
"hbglth" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 8435,
"optime" : {
"t" : 0,
"i" : 0
},
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHbgrtbbgt" : ISODate("2013-08-13T06:03:47Z"),
"pingMs" : 0
},
{
"_id" : 5,
"name" : "101.130.92.32:27018",
"hbglth" : 1,
"state" : 3,
"stateStr" : "RECOVERING",
"optime" : {
"t" : 1375816685000,
"i" : 2
},
"optimeDate" : ISODate("2013-08-06T19:18:05Z"), --同步时间也不对,是8月6日的,今天以及国内13日了
"self" : true
},
{
"_id" : 6,
"name" : "101.130.92.323:27017",
"hbglth" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 8433,
"optime" : {
"t" : 1376373827000,
"i" : 17
},
"optimeDate" : ISODate("2013-08-13T06:03:47Z"),
"lastHbgrtbbgt" : ISODate("2013-08-13T06:03:47Z"),
"pingMs" : 0
},
{
"_id" : 7,
"name" : "101.130.92.323:27018",
"hbglth" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 8435,
"optime" : {
"t" : 1376373827000,
"i" : 17
},
"optimeDate" : ISODate("2013-08-13T06:03:47Z"),
"lastHbgrtbbgt" : ISODate("2013-08-13T06:03:47Z"),
"pingMs" : 0
}
],
"ok" : 1
}
RECOVERING>

3 去官网上面察看资料,发现如下
http://docs.mongodb.org/manual/tutorial/resync-replica-set-member/#replica-set-resync-by-copying

•Restart the mongod with an empty data directory and let MongoDB’s normal initial syncing fbgture restore the data.
This is the more simple option, but may take longer to replace the data.

重新启动 步骤如下:
(1) stop the failed mongod 停止正在运行的同步异常的mongodb服务
(2) delete all data in the dbpath (including subdirectories) 删除mongodb目录下所有的数据文件包括其他的子目录
(3) start it and it will automatically resynchronize itself from primary 启动mongodb服务,服务会自动从primary上重新同步数据过来。


4 重新sync后,状态一直是 RECOVERING没有变成secondary,不过数据都已经同步过去了。
RECOVERING> rs.status();
{
"set" : "rpl",
"date" : ISODate("2013-08-13T07:58:41Z"),
"myState" : 3,
"syncingTo" : "101.130.92.323:27018",
"members" : [
{
"_id" : 0,
"name" : "101.130.92.322:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 5629,
"optime" : {
"t" : 1376380719000,
"i" : 84
},
"optimeDate" : ISODate("2013-08-13T07:58:39Z"),
"lastHeartbeat" : ISODate("2013-08-13T07:58:39Z"),
"pingMs" : 0
},
{
"_id" : 4,
"name" : "101.130.92.322:27019",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 5629,
"optime" : {
"t" : 0,
"i" : 0
},
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2013-08-13T07:58:39Z"),
"pingMs" : 0
},
{
"_id" : 5,
"name" : "101.130.92.322:27018",
"health" : 1,
"state" : 3,
"stateStr" : "RECOVERING",
"optime" : {
"t" : 1376380721000,
"i" : 31
},
"optimeDate" : ISODate("2013-08-13T07:58:41Z"),
"self" : true
},
{
"_id" : 6,
"name" : "101.130.92.323:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 5629,
"optime" : {
"t" : 1376380719000,
"i" : 66
},
"optimeDate" : ISODate("2013-08-13T07:58:39Z"),
"lastHeartbeat" : ISODate("2013-08-13T07:58:39Z"),
"pingMs" : 0
},
{
"_id" : 7,
"name" : "101.130.92.323:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 5629,
"optime" : {
"t" : 1376380719000,
"i" : 66
},
"optimeDate" : ISODate("2013-08-13T07:58:39Z"),
"lastHeartbeat" : ISODate("2013-08-13T07:58:39Z"),
"pingMs" : 0
}
],
"ok" : 1
}
RECOVERING>

还需要继续观察一段时间,看是否最终会从RECOVERING变成secondary。

观察了1天之后,还是RECOVRING, 日志里面也没有报任何异常信息.只好尝试着重新启动了下

kill 12292

/db/mongodb/bin/mongod -f /etc/mongodb/27018.conf

结果status变成了secondary了.

分享到:
评论

相关推荐

    mongodb-replset-configurator:MongoDB ReplSet 配置器

    MongoDB ReplSet 配置器 这是一个允许您在不访问 MongoDB shell 的情况下配置 MongoDB 副本集的程序。 使用了以下环境变量。 MRSC_ID(必填):副本集的ID MRSC_SERVERS(必填):Replica Set的服务器地址,通过...

    mongodb 集群完整版

    mongodb集群 shard replset 分片 包括windows 和 linux两个版本

    MongoDB添加secondary节点的2种方法详解

    主要给大家总结介绍了关于MongoDB添加secondary节点的2种方法,以及MongoDB secondary节点出现recovering状态的解决方法,文中介绍的非常详细,需要的朋友可以参考下

    RDBMS to Mongodb Migration

    RDBMS to MongoDB Migration,mongodb 白皮书

    MongoDB的主从复制及副本集的replSet配置教程

    MongoDB可以在以一个主节点处理客户端请求的情况下以其他节点服务器负责映射主节点上的数据,即为我们通常所说的主从复制功能,这里我们就来共同总结MongoDB的主从复制及副本集的replSet配置教程:

    mongodb: mongod 启动报错[about to fork child process, waiting until server is ready for connections]

    mongodb 命令行mongod启动报错 about to fork child process, waiting until server is ready for connections. forked process: 3560 ERROR: child process failed, exited with error number 1 To see additional ...

    Big.Data.NoSQL.Architecting.MongoDB.epub

    The book covers the necessary features of MongoDB which is needed to get up to speed in knowing about the database. The book covers details on Architecting, Developing and Administering MongoDB. Big ...

    mongodb-windows-x86_64-enterprise-6.0.2-signed

    MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。 MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系...

    The.Definitive.Guide.to.MongoDB.3rd.Edition.1484211839

    The Definitive Guide to MongoDB: A complete guide to dealing with Big Data using MongoDB The Definitive Guide to MongoDB, Third Edition, is updated for MongoDB 3 and includes all of the latest ...

    The.Definitive.Guide.to.MongoDB.pdf

    The.Definitive.Guide.to.MongoDB.pdf

    Practical.MongoDB.Architecting.Developing.and.Administering.MongoDB

    Beginning with a short introduction to the basics of NoSQL databases, MongoDB experts Navin Sabharwal and Shankatala Gupta Edward introduce readers to MongoDB – the leading document based NoSQL ...

    mongodb主从结构的配置

    mongodb主从结构的配置的配置文件,从公司服务器上下载下来的,分享给大家参考参考。

    Mastering MongoDB 3.x

    Mastering MongoDB 3.x: An expert’s guide to building fault-tolerant MongoDB applications MongoDB has grown to become the de facto NoSQL database with millions of users—from small startups to Fortune...

    The Definitive Guide to MongoDB

    Set up MongoDB on all major platforms, including Linux and Cloud platforms Model data within a document-oriented database Work with your data using non-SQL commands Write applications using MongoDB's ...

    MongoDB Basics

    Developers and relational database admins who need to get up to speed quickly on what MongoDB is, how it works, and how to use it. Table of Contents Ch. 1: Introduction to MongoDB Ch. 2: Installing ...

    MongoDB笔记.docx

    一、MongoDB简介 3 二、MongoDB结构 3 二、MongoDB 数据库关系型(这里并不是值关系型数据库的关系) 3 1、MongoDB一对一关系型 3 2、MongoDB一对多关系型 4 3、MongoDB多对多关系型 4 三、创建数据库(mongodb_test...

    Linux安装mongodb客户端

    sudo vim /etc/yum.repos.d/mongodb-org-4.2.repo 写入: [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpg...

    基于MongoDB的日志系统Mongodb-Log.zip

    mongodb-log 是一个基于MongoDB的Python日志系统。 MongoDB 的 Capped Collection是一个天生的日志系统,MongoDB自己的oplog就是用它来存储的,Capped Collection的特点是可以指定Collection的大小,当记录总大小...

    Practical MongoDB(Apress,2015)

    Practical Guide to MongoDB: Architecting, Developing, and Administering MongoDB begins with a short introduction to the basics of NoSQL databases and then introduces readers to MongoDB—the leading ...

    如何安装MongoDB 如何使用MongoDB

    本课程是一套关于MongoDB应用开发的实战性教程,名为《深入浅出MongoDB应用实战开发(基础、开发指南、系统管理、集群及系统架构)》,教程侧重于讲解MongoDB的常用特性及高级特性,从实际开发的角度出发对MongoDB...

Global site tag (gtag.js) - Google Analytics