3. For each secondary: 

(a) Shut down the secondary. 

(b) Restart it with the 1.8.x binary from the MongoDB Download Page$^{891}$. 

4. If you changed the config, change it back to its original state: 

config = rs.conf() config.version++ config.members[0].priority = 1 config.members[3].priority = 1 config.members[4].priority = 1 rs.reconfig(config) 

"ismaster" : false , "secondary" : true , "hosts" : [ "ubuntu:27017", "ubuntu:27018" ], "arbiters" : [ "ubuntu:27019" ], "primary" : "ubuntu:27018", "ok" : 1 } // for each secondary config.members[0].priority = 0 config.members[3].priority = 0 config.members[4].priority = 0 rs.reconfig(config) 

5. Shut down the primary (the final 1.6 server), and then restart it with the 1.8.x binary from the MongoDB Download Page$^{892}$. 

## Upgrading a Sharded Cluster 

1. Turn off the balancer: 

mongo <a_mongos_hostname> use config db.settings.update({_id:"balancer"},{$set : {stopped: true }}, true ) 

2. For each shard : 

• If the shard is a replica set , follow the directions above for Upgrading a Replica Set (page 915). 

• If the shard is a single mongod process, shut it down and then restart it with the 1.8.x binary from the MongoDB Download Page$^{893}$. 

3. For each mongos : 

(a) Shut down the mongos process. 

(b) Restart it with the 1.8.x binary from the MongoDB Download Page$^{894}$. 

