Hi,
Thanks for clarifying your deployment. If you restart an existing replica set member with different RAM or CPU resources there are no specific configuration changes for MongoDB.
In the EC2 case vertical scaling often means provisioning and migrating to a new instance, which is the approach that Scott referenced. With reserved instances you sometimes have options within the same instance family (
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modification-instancemove.html), but generally you will end up having to add the replacement node to the replica set with a new internal hostname.
Assuming your MongoDB data volume is on EBS and you want to continue using the same storage type (rather than upgrading storage along with the instance size) you can stop the original instance, detach the EBS volume, and re-attach to your new instance.
A few considerations for scaling vertically (or upgrading replica set nodes);
- your data-bearing replica set nodes should generally have similar resource configurations to allow for failover (i.e. you don't want to have an upgraded primary and less capable secondaries)
- to minimize downtime you would normally upgrade one secondary at a time, wait for it to be successfully added/synced, and finally step down and upgrade the primary
- restarting instances has the side effect of clearing your working set from memory; for a very active deployment you should consider the possible performance impact while the new member starts loading data and perhaps warm up data before upgrading the next secondary (for example, see:
http://blog.parse.com/2013/03/07/techniques-for-warming-up-mongodb/).
Regards,
Stephen