{"id":44322,"date":"2015-09-23T22:42:30","date_gmt":"2015-09-23T19:42:30","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=44322"},"modified":"2023-12-06T15:08:16","modified_gmt":"2023-12-06T13:08:16","slug":"mongodb-replication-guide","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html","title":{"rendered":"MongoDB Replication Guide"},"content":{"rendered":"<p><em>This article is part of our Academy Course titled <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-a-scalable-nosql-db\/\">MongoDB \u2013 A Scalable NoSQL DB<\/a>.<\/em><\/p>\n<p><em>In this course, you will get introduced to MongoDB. You will learn how to install it and how to operate it via its shell. Moreover, you will learn how to programmatically access it via Java and how to leverage Map Reduce with it. Finally, more advanced concepts like sharding and replication will be explained. Check it out <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-a-scalable-nosql-db\/\">here<\/a>!<\/em><\/p>\n<div class=\"toc\">\n<h4>Table Of Contents<\/h4>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#configuring_replication\">2. Configuring Replication<\/a><\/dt>\n<dt><a href=\"#replication_sharding\">3. Replication and Sharding (Partitioning)<\/a><\/dt>\n<dt><a href=\"#replication_commands\">4. Replication commands and command helpers<\/a><\/dt>\n<dt><a href=\"#next\">5. What\u00b4s next<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>Replication is a foundational technique to keep your data safe (by providing redundancy) and highly available all the time (by providing multiple instances serving the exact copy of the data). Replication helps a lot to recover from hardware failure and prevent service interruptions. Very often it is being used to off-load some work (for example, reporting or backup) from the primary servers to dedicated replicas.<\/p>\n<p>There are server classes of replication: <strong>Master \u2013 Master<\/strong> (or <strong>Active \u2013 Active<\/strong>) and <strong>Master \u2013 Slave<\/strong> (or <strong>Active \u2013 Passive<\/strong>). At the moment, <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> implements <strong>Master \u2013 Slave<\/strong> (or <strong>Active \u2013 Passive<\/strong>) replication (only one node can accept write operations at a time) with automatic <strong>master<\/strong> (<strong>primary<\/strong>) election in case of failure.<\/p>\n<p><a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> supports the replication in a form of <strong>replica sets<\/strong>: a group of <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> instances that maintain the same (synchronized) data across multiple instances (servers).<\/p>\n<p>A<strong> replica set <\/strong>consist of a single <strong>primary<\/strong> <strong>MongoDB <\/strong>instance (which accepts all write operations) and one or more <strong>secondary<\/strong> instances which synchronize with primary so to have the same data set. To support replication, the <strong>primary<\/strong> logs all changes to its data sets in its <strong>oplog: <\/strong>a special <strong>capped collection<\/strong> that keeps a rolling record of all operations that modify the data stored in the databases. Consequently, the <strong>secondaries<\/strong> replicate the primary\u2019s <strong>oplog<\/strong> and apply the operations to their data sets so the databases are kept in sync (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-oplog\/#replica-set-oplog\">official documentation<\/a> for more details). Please notice that those operations are applied <strong>asynchronously<\/strong> so the <strong>secondary<\/strong> instances may not always return the most up-to-date data (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-sync\/#replica-set-sync\">official documentation<\/a> for more details), the fact known as <strong>replication lag<\/strong>.<\/p>\n<p>Optionally, each <strong>replica set<\/strong> could include one or more <strong>arbiters<\/strong>: <strong>MongoDB <\/strong>instances which do not maintain a data set but only exist to vote in elections by contributing to majority of votes. Interestingly, a <strong>primary<\/strong> instance may step down and become <strong>secondary<\/strong>, a <strong>secondary<\/strong> may be promoted to <strong>primary<\/strong> but <strong>arbiters <\/strong>never change their roles (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-arbiter\/\">official documentation<\/a> for more details).<\/p>\n<p>When a <strong>primary<\/strong> is not available to other members of the <strong>replica set<\/strong> for more than 10 seconds, the <strong>replica set<\/strong> will attempt to promote one of the <strong>secondary<\/strong> instances to become a new <strong>primary<\/strong> by starting the election process: the first <strong>secondary<\/strong> that receives a majority of the votes becomes <strong>primary <\/strong>(please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-elections\/\">official documentation<\/a> for more details).<\/p>\n<p>Before introducing <strong>replica set<\/strong> (which is the recommended way to configure replication), <strong>MongoDB <\/strong>supported a bit different <strong>master \/ slave <\/strong>replication model, which at the moment is considered legacy (for more details please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/master-slave\/\">official documentation<\/a>). We are not going to cover this model in this part of the tutorial.<\/p>\n<h2><a name=\"configuring_replication\"><\/a>2. Configuring Replication<\/h2>\n<p>It is worth mentioning that each secondary member in the <strong>replica set<\/strong> might be configured to serve a particular purpose:<\/p>\n<ul>\n<li><strong>priority 0 member<\/strong>: never becomes a primary in an elections (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-priority-0-member\/\">official documentation<\/a> for more details)<\/li>\n<li><strong>hidden member<\/strong>: invisible to client applications (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-hidden-member\/\">official documentation<\/a> for more details)<\/li>\n<li><strong>delayed member<\/strong>: reflects an earlier, or delayed, state of the dataset (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-delayed-member\/\">official documentation<\/a> for more details)<\/li>\n<\/ul>\n<p>While configuring your <strong>replica set<\/strong>, it is very important to have an odd number of members so to ensure that the <strong>replica set<\/strong> is always able to elect a primary by reaching a majority of votes (please refer to <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/replica-set-architectures\/\">official documentation<\/a> for more thorough clarification). In the sample <strong>replica set<\/strong> configuration we are about to configure there is one <strong>primary<\/strong> instance, three <strong>secondary<\/strong> instances and one <strong>arbiter<\/strong>, totaling 5 members.<\/p>\n<p><figure id=\"attachment_5071\" aria-describedby=\"caption-attachment-5071\" style=\"width: 362px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLICA.SET_.png\"><img decoding=\"async\" class=\"size-full wp-image-5071\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLICA.SET_.png\" alt=\"Picture 1. A sample replica set configuration.\" width=\"362\" height=\"214\" \/><\/a><figcaption id=\"caption-attachment-5071\" class=\"wp-caption-text\"><strong>Picture 1<\/strong>. A sample <strong>replica set<\/strong> configuration.<\/figcaption><\/figure><\/p>\n<p>The first step in configuring a <strong>replica set<\/strong> is to start all <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> instances which are supposed to be its members. The process is very similar to the one we have covered in <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-installation-how-to-install-mongodb\/\"><strong>Part 1. MongoDB Installation &#8211; How to install MongoDB<\/strong><\/a> except a new command line argument <code>--replSet<\/code> which specifies the <strong>replica set<\/strong> name.<\/p>\n<pre class=\"brush:bash\">bin\/mongod --replSet \"rs-demo\" --bind_ip 192.168.100.1 --dbpath data<\/pre>\n<pre class=\"brush:bash\">bin\/mongod --replSet \"rs-demo\" --bind_ip 192.168.100.2 --dbpath data<\/pre>\n<pre class=\"brush:bash\">bin\/mongod --replSet \"rs-demo\" --bind_ip 192.168.100.3 --dbpath data<\/pre>\n<pre class=\"brush:bash\">bin\/mongod --replSet \"rs-demo\" --bind_ip 192.168.100.4 --dbpath data<\/pre>\n<pre class=\"brush:bash\">bin\/mongod --replSet \"rs-demo\" --bind_ip 192.168.100.5 --dbpath data<\/pre>\n<p>From this point, all other configuration steps are going to be performed using <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell and a rich set of its command for replication configuration (please refer to <a href=\"#_Replication_commands_and\">Replication commands and command helpers<\/a> for more details).<\/p>\n<p>Let us connect to the first member of the <strong>replica set<\/strong> using MongoDB shell: <code>bin\/mongo --host 192.168.100.1<\/code>. The initial command to initialize the <strong>replica set<\/strong> is <code>rs.initiate()<\/code>: it will initiate a new <strong>replica set<\/strong> that consists of the current member and uses the default configuration.<\/p>\n<p><figure id=\"attachment_5079\" aria-describedby=\"caption-attachment-5079\" style=\"width: 845px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.INITIATE.png\"><img decoding=\"async\" class=\"size-full wp-image-5079\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.INITIATE.png\" alt=\"Picture 2. Initiating the replica set with default configuration.\" width=\"845\" height=\"223\" \/><\/a><figcaption id=\"caption-attachment-5079\" class=\"wp-caption-text\"><strong>Picture 2<\/strong>. Initiating the <strong>replica set<\/strong> with default configuration.<\/figcaption><\/figure><\/p>\n<p>Let us immediately issue another helpful command <code>rs.conf()<\/code> to inspect current <strong>replica set<\/strong> members and configuration (only current instance should be listed):<\/p>\n<p><figure id=\"attachment_5076\" aria-describedby=\"caption-attachment-5076\" style=\"width: 845px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.CONF_.1.png\"><img decoding=\"async\" class=\"size-full wp-image-5076\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.CONF_.1.png\" alt=\"Picture 3. Inspecting current replica set members and configuration.\" width=\"845\" height=\"301\" \/><\/a><figcaption id=\"caption-attachment-5076\" class=\"wp-caption-text\"><strong>Picture 3<\/strong>. Inspecting current <strong>replica set<\/strong> members and configuration.<\/figcaption><\/figure><\/p>\n<p>Let us move on by firstly adding an arbiter to replica set using <code>rs.addArb()<\/code> command passing the <strong>arbiter:27017<\/strong> instance as a parameter: <code>rs.addArb( \"arbiter:27017\" )<\/code>. The call to <code>rs.conf()<\/code> shows off a new member with <strong>arbiterOnly<\/strong> flag set to <strong>true<\/strong>.<\/p>\n<p><figure id=\"attachment_5075\" aria-describedby=\"caption-attachment-5075\" style=\"width: 845px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.ADDARB.png\"><img decoding=\"async\" class=\"size-full wp-image-5075\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.ADDARB.png\" alt=\"Picture 4. Adding an arbiter and inspecting current replica set members and configuration.\" width=\"845\" height=\"484\" \/><\/a><figcaption id=\"caption-attachment-5075\" class=\"wp-caption-text\"><strong>Picture 4<\/strong>. Adding an arbiter and inspecting current <strong>replica set<\/strong> members and configuration.<\/figcaption><\/figure><\/p>\n<p>Following the same procedure let us add all other, secondary members to the <strong>replica set<\/strong> but this time using regular <code>rs.add()<\/code> command and providing hostname and port, very similar to <code>rs.addArb()<\/code>:<\/p>\n<pre class=\"brush:bash\">rs.add( \"secondary1:27017\" )<\/pre>\n<pre class=\"brush:bash\">rs.add( \"secondary2:27017\" )<\/pre>\n<pre class=\"brush:bash\">rs.add( \"secondary3:27017\" )<\/pre>\n<p><figure id=\"attachment_5074\" aria-describedby=\"caption-attachment-5074\" style=\"width: 763px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.ADD_.png\"><img decoding=\"async\" class=\"size-full wp-image-5074\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.ADD_.png\" alt=\"Picture 5. Adding secondary members and inspecting current replica set configuration. \" width=\"763\" height=\"765\" \/><\/a><figcaption id=\"caption-attachment-5074\" class=\"wp-caption-text\"><strong>Picture 5<\/strong>. Adding secondary members and inspecting current <strong>replica set<\/strong> configuration.<\/figcaption><\/figure><\/p>\n<p>Great, the <strong>replica set<\/strong> is fully configured! Another very useful command <code>rs.status()<\/code> provides a verbose report about current <strong>replica set<\/strong>.<\/p>\n<p><figure id=\"attachment_5084\" aria-describedby=\"caption-attachment-5084\" style=\"width: 780px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.STATUS.png\"><img decoding=\"async\" class=\"size-full wp-image-5084\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.STATUS.png\" alt=\"Picture 6. Retrieving current replica set status.\" width=\"780\" height=\"795\" \/><\/a><figcaption id=\"caption-attachment-5084\" class=\"wp-caption-text\"><strong>Picture 6<\/strong>. Retrieving current <strong>replica set<\/strong> status.<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>For a demonstration purposes, let us reuse the <strong>bookstore<\/strong> example from <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-and-java-tutorial\/\"><strong>Part 3. MongoDB and Java Tutorial<\/strong><\/a> and insert couple of the documents into <strong>books<\/strong> collection. Please notice that those operations should be issued against <strong>primary<\/strong> member of the <strong>replica set <\/strong>(secondary members nor arbiters do not accept write operations).<\/p>\n<pre class=\"brush:java\">db.books.insert( { \n    \"title\" : \"MongoDB: The Definitive Guide\", \n    \"published\" : \"2013-05-23\", \n    \"categories\" : [ \"Databases\", \"NoSQL\", \"Programming\" ], \n    \"publisher\" : { \"name\" : \"O'Reilly\" } \n} )\n\ndb.books.insert( { \n    \"title\" : \"MongoDB Applied Design Patterns\", \n    \"published\" : \"2013-03-19\", \n\t\"categories\" : [ \"Databases\", \"NoSQL\", \"Patterns\", \"Programming\" ], \n\t\"publisher\" : { \"name\" : \"O'Reilly\" } \n} )<\/pre>\n<p><figure id=\"attachment_5070\" aria-describedby=\"caption-attachment-5070\" style=\"width: 798px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.INSERT.BOOKS_.png\"><img decoding=\"async\" class=\"size-full wp-image-5070\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.INSERT.BOOKS_.png\" alt=\"Picture 7. Inserting new documents into books collection by issuing commands against primary member of replica set.\" width=\"798\" height=\"383\" \/><\/a><figcaption id=\"caption-attachment-5070\" class=\"wp-caption-text\"><strong>Picture 7<\/strong>. Inserting new documents into <strong>books<\/strong> collection by issuing commands against <strong>primary<\/strong> member of <strong>replica set<\/strong>.<\/figcaption><\/figure><\/p>\n<p>To make sure the documents have been replicated, let us connect to any <strong>secondary<\/strong> member of the <strong>replica set<\/strong> and query for all documents in <strong>books<\/strong> collection: <code>bin\/mongo --host secondary3 bookstore<\/code>.<\/p>\n<p>Please notice that for any <strong>secondary<\/strong> member the error will be raised if <code>rs.slaveOk()<\/code> command has not been issues before running read operations:<\/p>\n<pre class=\"brush:bash\">rs.slaveOk()\ndb.books.find( {}, { title: 1 }).pretty()\n<\/pre>\n<p><figure id=\"attachment_5069\" aria-describedby=\"caption-attachment-5069\" style=\"width: 829px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.FIND_.BOOKS_.png\"><img decoding=\"async\" class=\"size-full wp-image-5069\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.FIND_.BOOKS_.png\" alt=\"Picture 8. Querying books collection on the secondary member of replica set.\" width=\"829\" height=\"279\" \/><\/a><figcaption id=\"caption-attachment-5069\" class=\"wp-caption-text\"><strong>Picture 8<\/strong>. Querying <strong>books<\/strong> collection on the <strong>secondary<\/strong> member of <strong>replica set<\/strong>.<\/figcaption><\/figure><\/p>\n<h2><a name=\"replication_sharding\"><\/a>3. Replication and Sharding (Partitioning)<\/h2>\n<p>Sharding and replication go side by side. In the <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-sharding-guide\/\"><strong>Part 4. MongoDB Sharding Guide<\/strong><\/a> of the tutorial we have mentioned that it is strongly recommended to have each shard configured as a <strong>replica set<\/strong>. Such deployments allow having redundant copies of every partition of your data, plus high availability in case the <strong>primary<\/strong> member of the <strong>shard<\/strong>\u2019s <strong>replica set<\/strong> fails.<\/p>\n<p>Luckily, it is very easy to do just by following different member naming convention while calling <code>sh.addShard()<\/code> command: each hostname should be prefixed by <strong>replica set<\/strong> name. For example, the commands we have seen in <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-sharding-guide\/\"><strong>Part 4. MongoDB Sharding Guide<\/strong><\/a> are:<\/p>\n<pre class=\"brush:bash\">sh.addShard( \"ubuntu:27000\" )\nsh.addShard( \"ubuntu:27001\" )<\/pre>\n<p>In case each <strong>shard<\/strong> is a <strong>replica set<\/strong>, the commands are going to look like this:<\/p>\n<pre class=\"brush:bash\">sh.addShard( \" rs1\/ubuntu:27000\" ) \nsh.addShard( \" rs1\/ubuntu:27001\" )<\/pre>\n<h2><a name=\"replication_commands\"><\/a>4. Replication commands and command helpers<\/h2>\n<p><a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell provides a command helpers and <strong>rs<\/strong> context variable to simplify replication management and deployment.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.help()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">Outputs the brief description for all replication-related shell functions.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.help()<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.HELP_.png\"><img decoding=\"async\" class=\"aligncenter wp-image-5078\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.HELP_-1024x504.png\" alt=\"05.RS.HELP\" width=\"675\" height=\"332\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.help\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.help\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.help()<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetInitiate<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">\n<pre class=\"brush:java\">{ \n    replSetInitiate : &lt;configuration&gt; \n}<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.initiate(configuration)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command initiates a new <strong>replica set<\/strong>. Optionally, it takes a configuration to initiate with.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetInitiate\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetInitiate\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.initiate\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.initiate\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetInitiate<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.conf()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command returns the current <strong>replica set<\/strong> configuration.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.conf\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.conf\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.conf()<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.addArb(host)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command adds a new arbiter to an existing <strong>replica set<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.addArb\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.addArb\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.addArb(host)<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.add(host, arbiterOnly)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">Adds a new member to an existing <strong>replica set<\/strong>. With <strong>arbiterOnly<\/strong> flag set to <strong>true<\/strong>, the new member will be added as an arbiter, similarly to <strong>rs.addArb() <\/strong>command.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.add\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.add\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.add(host, arbiterOnly)<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.remove(host)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command removes existing member from the current <strong>replica set<\/strong>. Please notice that this function will disconnect the <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell briefly and forces a reconnection as the <strong>replica set<\/strong> renegotiates which member will be <strong>primary<\/strong>. As a result, the shell will display an error even if this command succeeds.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.remove( \"secondary3:27017\" )<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.REMOVE.png\"><img decoding=\"async\" class=\"aligncenter wp-image-5083\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.REMOVE.png\" alt=\"05.RS.REMOVE\" width=\"665\" height=\"132\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.remove\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.remove\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.remove(host)<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetGetStatus<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.status()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command returns the status of the <strong>replica set<\/strong> from the point of view of the current <strong>MongoDB<\/strong> instance. It should be run in context of <strong>admin<\/strong> database.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetGetStatus\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetGetStatus\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.status\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.status\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetGetStatus<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetFreeze<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">\n<pre class=\"brush:java\">{ \n    replSetFreeze: &lt;seconds&gt; \n}<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.freeze(seconds)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command prevents a <strong>replica set<\/strong> member from seeking election for the specified number of seconds. This command is often used in conjunction with the <strong>replSetStepDown<\/strong> command to make a different member in the <strong>replica set<\/strong> a new <strong>primary<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">Let us reconnect <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell to one of the secondary instances <strong>bin\/mongo &#8211;host secondary1<\/strong> and issue the command:<\/p>\n<pre class=\"brush:bash\">rs.freeze( 10 )<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.FREEZE.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5077\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.FREEZE.png\" alt=\"05.RS.FREEZE\" width=\"731\" height=\"117\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetFreeze\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetFreeze\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.freeze\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.freeze\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetFreeze<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.printSlaveReplicationInfo()<\/strong><\/p>\n<p><strong>db.printSlaveReplicationInfo()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command outputs a status report of a <strong>replica set<\/strong> from the perspective of the <strong>secondary<\/strong> member of the set.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.printSlaveReplicationInfo()<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.PRINTSLAVEREPLICATIONINFO.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5081\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.PRINTSLAVEREPLICATIONINFO.png\" alt=\"05.RS.PRINTSLAVEREPLICATIONINFO\" width=\"760\" height=\"281\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.printSlaveReplicationInfo\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.printSlaveReplicationInfo\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.printSlaveReplicationInfo\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.printSlaveReplicationInfo\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.printSlaveReplicationInfo()<br \/>\ndb.printSlaveReplicationInfo()<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.printReplicationInfo()<br \/>\ndb.printReplicationInfo()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command outputs a status report of a <strong>replica set<\/strong> from the perspective of the <strong>primary<\/strong> member of the set.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.printReplicationInfo()<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.PRINTREPLICATIONINFO.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5080\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.PRINTREPLICATIONINFO.png\" alt=\"05.RS.PRINTREPLICATIONINFO\" width=\"755\" height=\"202\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.printReplicationInfo\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.printReplicationInfo\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.printReplicationInfo\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.printReplicationInfo\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.printReplicationInfo()<br \/>\ndb.printReplicationInfo()<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>db.getReplicationInfo()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command outputs the status of the <strong>replica set<\/strong>, using data polled from the <strong>oplog<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.getReplicationInfo()<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.DB_.GETREPLICATIONINFO.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5086\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.DB_.GETREPLICATIONINFO.png\" alt=\"05.DB.GETREPLICATIONINFO\" width=\"758\" height=\"282\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.getReplicationInfo\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.getReplicationInfo\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">db.getReplicationInfo()<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>isMaster<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>db.isMaster()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command displays information about current member\u2019s role in the <strong>replica set<\/strong>, including whether it is a <strong>primary (master)<\/strong>, <strong>secondary<\/strong> or <strong>arbiter<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">db.isMaster()<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.DB_.ISMASTER.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5068\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.DB_.ISMASTER.png\" alt=\"05.DB.ISMASTER\" width=\"757\" height=\"581\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/isMaster\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/isMaster\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.isMaster\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/db.isMaster\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">isMaster<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetMaintenance<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">{<\/p>\n<p>replSetMaintenance: &lt;true|false&gt;<\/p>\n<p>}<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command enables or disables the maintenance mode for a <strong>secondary<\/strong> member of a <strong>replica set<\/strong>. It should be run in context of <strong>admin<\/strong> database.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">Let us reconnect <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell to one of the secondary instances <strong>bin\/mongo &#8211;host secondary1<\/strong> and issue the command: <strong>db.adminCommand( { replSetMaintenance: true } )<\/strong><\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLSETMAINTENANCE.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5072\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLSETMAINTENANCE.png\" alt=\"05.REPLSETMAINTENANCE\" width=\"726\" height=\"125\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetMaintenance\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetMaintenance\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetMaintenance<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetSyncFrom<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">{<\/p>\n<p>replSetSyncFrom: &lt;host&gt;<\/p>\n<p>}<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.syncFrom(host)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">This command sets the member that this <strong>replica set<\/strong> member will sync from (overriding the default sync target selection logic).<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">Let us reconnect <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell to one of the secondary instances <strong>bin\/mongo &#8211;host secondary1<\/strong> and issue the command: <strong>rs.syncFrom( &#8220;secondary2:27017&#8221; )<\/strong><\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLSETSYNCFROM.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5073\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.REPLSETSYNCFROM.png\" alt=\"05.REPLSETSYNCFROM\" width=\"727\" height=\"203\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetSyncFrom\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetSyncFrom\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.syncFrom\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.syncFrom\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetSyncFrom<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetReconfig<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">\n<pre class=\"brush:java\">{\n\nreplSetReconfig: &lt;configuration&gt;,\n\nforce: &lt;true|false&gt;\n\n}<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.reconfig(configuration, force)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command modifies the configuration of an existing <strong>replica set<\/strong>. It may be used to add and remove members from the set and\/or to change the configuration of existing members. Please notice that this function may disconnect the shell briefly and force a reconnection as the <strong>replica set<\/strong> renegotiates which member will be <strong>primary<\/strong>. As a result, the shell may display an error even if this command succeeds.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.reconfig( rs.conf() )<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.RECONFIG.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5082\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.RECONFIG.png\" alt=\"05.RS.RECONFIG\" width=\"755\" height=\"119\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetReconfig\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetReconfig\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.reconfig\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.reconfig\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetReconfig<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>replSetStepDown<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Parameters<\/strong><\/td>\n<td width=\"576\">\n<pre class=\"brush:java\">{\n\nreplSetStepDown: &lt;seconds&gt; ,\n\nforce: &lt;true|false&gt;\n\n}<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Wrapper<\/strong><\/td>\n<td width=\"576\"><strong>rs.stepDown(seconds)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command forces the current <strong>replica set<\/strong> member to step down as <strong>primary<\/strong> and then attempts to avoid election as <strong>primary<\/strong> for the designated number of seconds. The command raises an error if the current member is not the <strong>primary<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">In <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> shell, let us issue the command:<\/p>\n<pre class=\"brush:bash\">rs.stepDown( 10 )<\/pre>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.STEPDOWN.png\"><img decoding=\"async\" class=\"aligncenter  wp-image-5085\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/05.RS_.STEPDOWN.png\" alt=\"05.RS.STEPDOWN\" width=\"707\" height=\"523\" \/><\/a><\/p>\n<p>The consecutive call of <strong>rs.isMaster()<\/strong> command confirms that current member has been stepped down as a <strong>primary<\/strong> and became a <strong>secondary<\/strong> node.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetStepDown\/\">http:\/\/docs.mongodb.org\/manual\/reference\/command\/replSetStepDown\/<\/a><\/p>\n<p><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.stepDown\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.stepDown\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">replSetStepDown<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td width=\"85\"><strong>Command<\/strong><\/td>\n<td width=\"576\"><strong>rs.slaveOk()<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Description<\/strong><\/td>\n<td width=\"576\">The command allows the current connection to run read operations on <strong>secondary<\/strong> members of the <strong>replica set<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Example<\/strong><\/td>\n<td width=\"576\">See please <a href=\"#configuring_replication\">Configuring Replication<\/a> section.<\/td>\n<\/tr>\n<tr>\n<td width=\"85\"><strong>Reference<\/strong><\/td>\n<td width=\"576\"><a href=\"http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.slaveOk\/\">http:\/\/docs.mongodb.org\/manual\/reference\/method\/rs.slaveOk\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">rs.slaveOk()<\/p>\n<\/div>\n<h2><a name=\"next\"><\/a>5. What\u00b4s next<\/h2>\n<p>In this section we have covered replication \u2013 a very important aspect of data management. We have seen how easy it is to configure replication in <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> using <strong>replica sets<\/strong> feature and how it relates to sharding. In the next part of the tutorial we are going to cover the <a href=\"http:\/\/en.wikipedia.org\/wiki\/MapReduce\">Map\/Reduce<\/a> programming model which <a href=\"http:\/\/www.mongodb.org\/\">MongoDB<\/a> supports out of the box.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to install it and how to operate it via its shell. Moreover, you will learn how to programmatically access it via Java and how to leverage Map &hellip;<\/p>\n","protected":false},"author":141,"featured_media":187,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[112],"class_list":["post-44322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MongoDB Replication Guide - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB Replication Guide - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-23T19:42:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T13:08:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrey Redko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrey Redko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html\"},\"author\":{\"name\":\"Andrey Redko\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\"},\"headline\":\"MongoDB Replication Guide\",\"datePublished\":\"2015-09-23T19:42:30+00:00\",\"dateModified\":\"2023-12-06T13:08:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html\"},\"wordCount\":2382,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"keywords\":[\"MongoDB\"],\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html\",\"name\":\"MongoDB Replication Guide - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"datePublished\":\"2015-09-23T19:42:30+00:00\",\"dateModified\":\"2023-12-06T13:08:16+00:00\",\"description\":\"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/mongodb-replication-guide.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/software-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MongoDB Replication Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\",\"name\":\"Andrey Redko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"caption\":\"Andrey Redko\"},\"description\":\"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\\\/EE, C#\\\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).\",\"sameAs\":[\"http:\\\/\\\/aredko.blogspot.com\\\/\",\"http:\\\/\\\/ca.linkedin.com\\\/in\\\/aredko\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/andrey-redko\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MongoDB Replication Guide - Java Code Geeks","description":"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html","og_locale":"en_US","og_type":"article","og_title":"MongoDB Replication Guide - Java Code Geeks","og_description":"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to","og_url":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-09-23T19:42:30+00:00","article_modified_time":"2023-12-06T13:08:16+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","type":"image\/jpeg"}],"author":"Andrey Redko","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Andrey Redko","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html"},"author":{"name":"Andrey Redko","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413"},"headline":"MongoDB Replication Guide","datePublished":"2015-09-23T19:42:30+00:00","dateModified":"2023-12-06T13:08:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html"},"wordCount":2382,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","keywords":["MongoDB"],"articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html","url":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html","name":"MongoDB Replication Guide - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","datePublished":"2015-09-23T19:42:30+00:00","dateModified":"2023-12-06T13:08:16+00:00","description":"This article is part of our Academy Course titled MongoDB \u2013 A Scalable NoSQL DB. In this course, you will get introduced to MongoDB. You will learn how to","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/mongodb-replication-guide.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/www.javacodegeeks.com\/category\/software-development"},{"@type":"ListItem","position":3,"name":"MongoDB Replication Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413","name":"Andrey Redko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","caption":"Andrey Redko"},"description":"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\/EE, C#\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).","sameAs":["http:\/\/aredko.blogspot.com\/","http:\/\/ca.linkedin.com\/in\/aredko"],"url":"https:\/\/www.javacodegeeks.com\/author\/andrey-redko"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/44322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=44322"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/44322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/187"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=44322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=44322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=44322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}