MongoDB cluster Upgrade (2.6.7-3.0.3)

Source: Internet
Author: User

MongoDB 3.0 was officially released on March 3, 2015. It is no exaggeration to say that this version of the new feature marks MongoDB This typical NoSQL database has entered a new stage of development.

New features in version 3.0:

Plug-in storage engine API

Wiredtiger Storage Engine

MMAPV1 Storage Engine boost

Replication Set Improvements

Shard Cluster Improvements

Official Document: http://docs.mongodb.org/manual/release-notes/3.0/


As a result of the 3.0 new features, we decided to upgrade mongodb-3.0.3

First, local testing

summary: Note eventually you still need to stop mongos and configdb ( mongos and configdb also need to upgrade, stop for a few minutes) **

Mongo-2.6.7 data Upgrade (import) is Mongo-3.0.3 . The data is shown to be less than the old version, and the new engine data is compressed.

1.Local test machine test

test machine: 192.168.5.66

System Version : centos6.5_64-2.6.32 Mongodb version:

test Machine One Start different ports One mongos one configdb two shards 2 quorum nodes


Port assignment:

Shards 1 :

Shard1 (main): 192.168.5.66:27001

Shard11 (Replica set): 192.168.5.66:27011

arbiter1 ( weight ) : 192.168.5.66:27000

Shards 2:

Shard2 ( master ): 192.168.5.66:27002

Shaed22 (replica set) : 192.168.5.66:27022

arbiter2 ( weight ): 192.168.5.66:27222

mongos:192.168.5.66:27111

configdb:192.168.5.66:27100

2. Configuring mongodb-2.6.7 clusters

Shard Configuration:

Shard 1:

Config = {_id: "Replset1", members:[

{_id:0,host: "192.168.5.66:27001", priority:1},

{_id:1,host: "192.168.5.66:27011", Priority:2},

{_id:2,host: "192.168.5.66:27000", arbiteronly:true},

]

}

rs.initiate (config);// Update Configuration

rs.status ()// View configuration Information

Shards 2 :

Config = {_id: "Replset2", members:[

{_id:0,host: "192.168.5.66:27002", priority:1},

{_id:1,host: "192.168.5.66:27022", Priority:2},

{_id:2,host: "192.168.5.66:27222", arbiteronly:true},

]

}

rs.initiate (config); Update Configuration

rs.status ()// View configuration Information

MONGOs To Add routing information:

Db.runcommand ({addshard: "replset1/192.168.5.66:27001,192.168.5.66:27011"});

Db.runcommand ({addshard: "replset2/192.168.5.66:27002,192.168.5.66:27022"});

Use admin

printshardingstatus ()// Viewing shard information

3. Adding data manually

Use TESTAPM

For (var i= 1; I <=; i++) Db.haha.save ({tid:i,name: "username" +i,age:i});

For (var i= 1; I <=; i++) Db.table1.save ({tid:i,name: "username" +i,age:i});

For (var i= 1; I <=; i++) Db.table2.save ({tid:i,name: "username" +i,age:i});

Use crash

For (var i= 1; I <=; i++) Db.tab1.save ({tid:i,name: "username" +i,age:i});

For (var i= 1; I <=; i++) Db.tab2.save ({tid:i,name: "username" +i,age:i});

For (var i= 1; I <=; i++) Db.table3.save ({tid:i,name: "username" +i,age:i});





This article is from the "MongoDB Upgrade 3.0" blog, make sure to keep this source http://jiachen.blog.51cto.com/3296673/1677138

MongoDB cluster Upgrade (2.6.7-3.0.3)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.