Playing with replica pair support using MongoDB on a local machine.
Both parts were started using:
mongod --pairwith localhost:27018 --dbpath /tmp/db/left
mongod --pairwith localhost:27017 --dbpath /tmp/db/right --port 27018
According to the logs the pairing seems to be fine.
Then I tried to insert data through some Python script to the instance
running 27017...got a complaint that this is would not be the
master...ok...insertions on port 27018 worked.
Then I tried to query a collection on both ports which fails with the
error given in the subject:
ajung@blackmoon:~/src/mongo-bench> mongo
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> db.my_collection.find().count()
Sun Apr 18 17:17:49 JS Error: uncaught exception: count failed: {
"errmsg" : "not master", "ok" : 0 }
ajung@blackmoon:~/src/mongo-bench> mongo -p 27018
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> db.my_collection.find().count()
Sun Apr 18 17:18:01 JS Error: uncaught exception: count failed: {
"errmsg" : "not master", "ok" : 0 }
Then I tried asking on both ports who the master is:
ajung@blackmoon:~/src/mongo-bench> mongo -p 27017
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> db.$cmd.findOne({ismaster:1});
{
"ismaster" : 0,
"remote" : "localhost:27018",
"info" : "direct negotiation",
"ok" : 1
}
ajung@blackmoon:~/src/mongo-bench> mongo -p 27018
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> db.$cmd.findOne({ismaster:1});
{
"ismaster" : 0,
"remote" : "localhost:27018",
"info" : "direct negotiation",
"ok" : 1
ismaster=0 on both instances appears weird - what's going on here?
Andreas
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to
mongod...@googlegroups.com.
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.