-
-
Save kwilczynski/1229448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@mongu:/var/log/mongodb# mongo | |
MongoDB shell version: 2.0.0 | |
connecting to: test | |
PRIMARY> use admin | |
switched to db admin | |
PRIMARY> rs.isMaster() | |
{ | |
"setName" : "portal", | |
"ismaster" : true, | |
"secondary" : false, | |
"hosts" : [ | |
"10.108.12.178:27017" | |
], | |
"primary" : "10.108.12.178:27017", | |
"me" : "10.108.12.178:27017", | |
"maxBsonObjectSize" : 16777216, | |
"ok" : 1 | |
} | |
PRIMARY> rs.status() | |
{ | |
"set" : "portal", | |
"date" : ISODate("2011-09-20T14:54:26Z"), | |
"myState" : 1, | |
"members" : [ | |
{ | |
"_id" : 0, | |
"name" : "10.108.12.178:27017", | |
"health" : 1, | |
"state" : 1, | |
"stateStr" : "PRIMARY", | |
"optime" : { | |
"t" : 1316515885000, | |
"i" : 1 | |
}, | |
"optimeDate" : ISODate("2011-09-20T10:51:25Z"), | |
"self" : true | |
}, | |
{ | |
"_id" : 1, | |
"name" : "10.108.12.179:27017", | |
"health" : 1, | |
"state" : 2, | |
"stateStr" : "SECONDARY", | |
"uptime" : 726, | |
"optime" : { | |
"t" : 1316515885000, | |
"i" : 1 | |
}, | |
"optimeDate" : ISODate("2011-09-20T10:51:25Z"), | |
"lastHeartbeat" : ISODate("2011-09-20T14:54:24Z"), | |
"pingMs" : 4 | |
} | |
], | |
"ok" : 1 | |
} | |
PRIMARY> rs.conf() | |
{ | |
"_id" : "portal", | |
"version" : 1, | |
"members" : [ | |
{ | |
"_id" : 0, | |
"host" : "10.108.12.178:27017" | |
}, | |
{ | |
"_id" : 1, | |
"host" : "10.108.12.179:27017", | |
"priority" : 0, | |
"hidden" : true | |
} | |
] | |
} | |
PRIMARY> | |
root@mongu:/var/log/mongodb# netstat -antp | |
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 10.108.12.178:27017 0.0.0.0:* LISTEN 3112/mongod | |
tcp 0 0 127.0.1.1:27017 0.0.0.0:* LISTEN 3112/mongod | |
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 3112/mongod | |
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 90/sshd | |
tcp 0 0 10.108.12.178:53205 10.108.12.179:27017 ESTABLISHED 3112/mongod | |
tcp 0 0 10.108.12.178:27017 10.108.12.179:49312 ESTABLISHED 3112/mongod | |
tcp 0 0 10.108.12.178:27017 10.108.12.179:33504 ESTABLISHED 3112/mongod | |
tcp6 0 0 :::22 :::* LISTEN 90/sshd | |
root@mongu:/var/log/mongodb# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@monze:/var/log/mongodb# mongo | |
MongoDB shell version: 2.0.0 | |
connecting to: test | |
SECONDARY> use admin | |
switched to db admin | |
SECONDARY> rs.isMaster() | |
{ | |
"setName" : "portal", | |
"ismaster" : false, | |
"secondary" : true, | |
"hosts" : [ | |
"10.108.12.178:27017" | |
], | |
"primary" : "10.108.12.178:27017", | |
"passive" : true, | |
"hidden" : true, | |
"me" : "10.108.12.179:27017", | |
"maxBsonObjectSize" : 16777216, | |
"ok" : 1 | |
} | |
SECONDARY> rs.status() | |
{ | |
"set" : "portal", | |
"date" : ISODate("2011-09-20T14:55:04Z"), | |
"myState" : 2, | |
"syncingTo" : "10.108.12.178:27017", | |
"members" : [ | |
{ | |
"_id" : 0, | |
"name" : "10.108.12.178:27017", | |
"health" : 1, | |
"state" : 1, | |
"stateStr" : "PRIMARY", | |
"uptime" : 764, | |
"optime" : { | |
"t" : 1316515885000, | |
"i" : 1 | |
}, | |
"optimeDate" : ISODate("2011-09-20T10:51:25Z"), | |
"lastHeartbeat" : ISODate("2011-09-20T14:55:02Z"), | |
"pingMs" : 0 | |
}, | |
{ | |
"_id" : 1, | |
"name" : "10.108.12.179:27017", | |
"health" : 1, | |
"state" : 2, | |
"stateStr" : "SECONDARY", | |
"optime" : { | |
"t" : 1316515885000, | |
"i" : 1 | |
}, | |
"optimeDate" : ISODate("2011-09-20T10:51:25Z"), | |
"self" : true | |
} | |
], | |
"ok" : 1 | |
} | |
SECONDARY> rs.conf() | |
{ | |
"_id" : "portal", | |
"version" : 1, | |
"members" : [ | |
{ | |
"_id" : 0, | |
"host" : "10.108.12.178:27017" | |
}, | |
{ | |
"_id" : 1, | |
"host" : "10.108.12.179:27017", | |
"priority" : 0, | |
"hidden" : true | |
} | |
] | |
} | |
SECONDARY> | |
root@monze:/var/log/mongodb# netstat -antp | |
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 10.108.12.179:27017 0.0.0.0:* LISTEN 2959/mongod | |
tcp 0 0 127.0.1.1:27017 0.0.0.0:* LISTEN 2959/mongod | |
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 2959/mongod | |
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 91/sshd | |
tcp 0 0 10.108.12.179:33504 10.108.12.178:27017 ESTABLISHED 2959/mongod | |
tcp 0 0 10.108.12.179:49312 10.108.12.178:27017 ESTABLISHED 2959/mongod | |
tcp 0 0 127.0.0.1:27017 127.0.0.1:50476 ESTABLISHED 2959/mongod | |
tcp 0 0 10.108.12.179:27017 10.108.12.178:53205 ESTABLISHED 2959/mongod | |
tcp 0 0 127.0.0.1:50476 127.0.0.1:27017 ESTABLISHED 2959/mongod | |
tcp6 0 0 :::22 :::* LISTEN 91/sshd | |
root@monze:/var/log/mongodb# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment