[SERVER-5027] Cannot add another mongos process to an app server and have it point to a single replica set. Created: 21/Feb/12 Updated: 15/Aug/12 Resolved: 22/Feb/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.0.2 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Erik Holm | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | mongos | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2003 R2 |
||
| Participants: |
| Description |
|
We are testing out various configurations. What we currently have is a one server replica set with a mongod(configsvr) process running on that server. Then we have 2 application servers app1 and app2. App1 has a mongos process running on it. I tried to set up a mongos process on app2, but I cannot get it to work. I am stuck with a permissions issue. I try to run the db.addUser command on app2 and it fails. I then try to run the db.runCommand( {addShard:"NH_Data_01/t01-vm-nsdb01:27018"}) command on the app2 server and it fails with unauthorized. The whole system is running with a keyFile as well, if that matters. The error code is below. > use admin > show users > db.auth("Same Username that I tried to add above","Password") – thought that maybe I added it earlier and forgot, not the case... ) { "ok" : 0, "errmsg" : "unauthorized" }> |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 22/Feb/12 ] |
|
It is good to hear you get things working. I am going to close this as you are following up in the group. |
| Comment by Scott Hernandez (Inactive) [ 22/Feb/12 ] |
|
A lot of these questions are best asked on the monodb-user (google-groups) forum since the community can be involved more directly. Jira is more for server issues and bugs, not for general questions like this. Please ask this question on the list: http://groups.google.com/group/mongodb-user/ |
| Comment by Erik Holm [ 22/Feb/12 ] |
|
First off, I would like to ask that the team please be more observant to JIRA tickets. This ticket was looked at and given a generic response with 10 minutes of being open, then not looked at again. Not much in terms of support... This ticket can be closed, though I do have one other question. If I should open a seperate ticket please let me know. We set up a replica set across 3 servers. I added an admin user to the first server in the replica set prior to bringing it up as a replica set. I then brought the replica set up. Once that was complete I tried to add an admin user to one of the secondary servers and it failed with the error below. The things is, when I tried to add the admin user to all 3 servers before bringing them up as a replica set it errored and said that my secodary server was not empty, and all but the initiator had to be empty. The short of it: how do I add an admin user to an existing replica set? If I have to do it prior to bringing it up as a replica set, how do I get around the error of needing the database to be empty. That was the only object in the database the admin user. Thanks, Erik Holm |
| Comment by Erik Holm [ 21/Feb/12 ] |
|
Scott, I just got into our DB, I had been fat fingering the password. Anyway, I ran a list shards command on App1 and was able to see the shard. Then I went to App2 and ran the same command and it shows up there too. My question is, do you have to run the add shard command for each mongos process you bring up? That is what I was trying to do and it wouldn't let me. Thanks, Erik |
| Comment by Erik Holm [ 21/Feb/12 ] |
|
I did. I copied the config file and the keyFile from App1 to App2 before I tried to set up App2. I verified that the paths are identical as well. |
| Comment by Scott Hernandez (Inactive) [ 21/Feb/12 ] |
|
Did you start the mongos with the same keyFile option? http://www.mongodb.org/display/DOCS/Security+and+Authentication#SecurityandAuthentication-ReplicaSetandShardingAuthentication |