Home > Database > Mysql Tutorial > MongoDB故障处理

MongoDB故障处理

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:49:31
Original
1154 people have browsed it

MongoDB副本集的主节点如果发生宕机故障,集群会自动选举出新的主节点。这个过程对于应用是透明的,也不需要人工介入。如果优先级是

MongoDB副本集的主节点如果发生宕机故障,集群会自动选举出新的主节点。这个过程对于应用是透明的,也不需要人工介入。

如果优先级是一样的,宕机的节点恢复之后,重新加入集群,他会自动从新的主节点同步数据,并把自己设置为副本节点。(退位让贤了)

如果设置了主节点的优先级,则宕机的主节点恢复之后,他还会成为集群的主节点。

CentOS编译安装MongoDB

CentOS 编译安装 MongoDB与mongoDB的php扩展

CentOS 6 使用 yum 安装MongoDB及服务器端配置

Ubuntu 13.04下安装MongoDB2.4.3

MongoDB入门必读(概念与实战并重)

《MongoDB 权威指南》(MongoDB: The Definitive Guide)英文文字版[PDF]

实验假设192.168.1.3为主节点,优先级为10,其余节点的优先级为1。集合中已经存在2条数据。

数据如下:

然后kill掉192.168.1.3的MongoDB进程,模拟主节点故障。

MongoDB集群自动触发选举,选出了192.168.1.2作为新的主节点。

在192.168.1.2新增一个数据

这时候恢复192.168.1.3节点,,他会自动从192.168.1.2同步最新的数据,然后把自己设置为主节点。

在192.168.1.3查看数据,发现数据没有丢失。

如果发生了人为的失误,比如忘记使用筛选条件而删除了整个集合的数据。如果有延迟节点,则参考延迟节点恢复数据。

如果没有延迟节点,则只能从最近的备份恢复。

如果没有备份,就只能呵呵了。

MongoDB 的详细介绍:请点这里
MongoDB 的下载地址:请点这里

本文永久更新链接地址:

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template