PRIMARY is transitioning to RECOVERING after restart

2016-12-28T23:02:40

I have a three-node replica set (1 Primary, 1 Secondary, 1 Arbiter), on three different Amazon server instances. The servers where they are hosted required a memory upgrade so I needed to shut down the MongoDB instances as well.

I shut down the MongoDB instances in this order:

  1. Secondary
  2. Arbiter
  3. Primary

I used the process below for shutting down each server

use admin
db.shutdownServer() 

All MongoDB instances did shut down properly without any problems. So far everything is fine.

After the Amazon server upgrade, I started the MongoDB instances in the following order:

  1. Arbiter
  2. Secondary
  3. Primary

The arbiter is in arbiter mode and secondary is in secondary mode, but to my surprise the primary machine went to "RECOVERING" mode.

I don't know the reason, why the primary machine went to "RECOVERING".

I have examined logs. It is showing no member to sync...something stuff like that

My basic doubt is "PRIMARY has to be in PRIMARY until there is reconfig happens in replica set".

Am I missing a step during the shutdown of servers? Or am I missing a step during the restart of servers?

Please shed some light on this so that how can I overcome this problem. I need to shut down the MongoDB servers frequently since there is a lot of upgrades happening in Amazon servers.

Copyright License:
Author:「Dhanu R」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/41364609/primary-is-transitioning-to-recovering-after-restart

About “PRIMARY is transitioning to RECOVERING after restart” questions

I have a three-node replica set (1 Primary, 1 Secondary, 1 Arbiter), on three different Amazon server instances. The servers where they are hosted required a memory upgrade so I needed to shut down...
When I use these configurations: - name: mongo:latest command: [ "/bin/sh", "-c", "mongod --logpath /dev/null --bind_ip localhos...
I'm using elasticsearch 2.1.1 and have a cluster of 8 nodes(3 master-nodes + 5 data-nodes). I've tried full cluster restart but ended up with weird issue(I couldn't find any issue in logs). I've ...
I hava a four nodes ElasticSearch cluster.After i insert about 100G data into the cluster,i restart the cluster.I found that it cost a lot of time for recovering shards.I notice that : All primary...
I set up a replica set with three members and one of them is an arbiter. One time I restart a member, the member keep RECOVERING for a long time and did not be SECONDARY again, even though the dat...
After recovering from the failure does the DataNode has the data prior to failure or is there any change in the content of data in the DataNode?
I am recovering from a surgery, thusly, I am transitioning to VIM. As I starting point, I've opted to use the vim-sensible plugin as the foundation of my configuration. Additionally, I've install...
Hy! I have the following stupid question? First an example to understand my point of view. I have a mysql db, Innodb tables with foreign keys between them, I currently work on a localhost machine W...
I would like to initialize the primary key (based on certain validations) of a table at restart of mysql. Is there any event at mysql restart. The idea is to execute a TRIGGER after a mysql restar...
I build a replication set with one primary, one secondary and one arbiter on MongoDB 3.0.2. The primary and arbiter are on the same host and the secondary is on another host. With the growing of ...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.