db.runCommand addshard is erroring out.

288 views
Skip to first unread message

ejholm

unread,
Feb 8, 2012, 2:07:44 PM2/8/12
to mongodb-user, phil_e...@trimble.com
I am attempting to add a shard to our DB. I am running the mongos
process on a Windows Server 2008 box successfully. I am running my
mongod and my configsvr processes on a Linux CentOS 6.0 configuration.
It also is up and running. Now I am trying to add the shard to the DB.
While connected to the mongos process on the windows box I run the
command below and get the following error:

mongos> db.runCommand({addshard:"replicaSetName/mongod serverName:
27018"})

{
"ok" : 0,
"errmsg" : "failed listing replicaSetName/mongod serverName:
27018's databases:{errmsg: \"need to login\", ok: 0.0}"
}

Thing is I have not set up any users yet in the database. I did set
auth = true in my config file for the mongod process. But I cannot
find any documentation as to the syntax for the mongos processes.

What do I need to login to? is it a param in the db.runCommand/
addshard? How do I resolve this issue?

Thanks,

Erik

ejholm

unread,
Feb 8, 2012, 3:35:34 PM2/8/12
to mongodb-user
Bumping in hopes of getting a response...

Scott Hernandez

unread,
Feb 8, 2012, 4:29:59 PM2/8/12
to mongod...@googlegroups.com
What version is this?

Here should be the docs you are looking for:
http://www.mongodb.org/display/DOCS/Security+and+Authentication#SecurityandAuthentication-ReplicaSetandShardingAuthentication

> --
> 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.
>

ejholm

unread,
Feb 8, 2012, 4:40:57 PM2/8/12
to mongodb-user
Scott,

Thank you for your reply. We are using 2.0.2. I will look over the doc
you suggested.

Thanks again.

Erik

On Feb 8, 2:29 pm, Scott Hernandez <scotthernan...@gmail.com> wrote:
> What version is this?
>
> Here should be the docs you are looking for:http://www.mongodb.org/display/DOCS/Security+and+Authentication#Secur...
>
>
>
> On Wed, Feb 8, 2012 at 2:07 PM, ejholm <ejh...@gmail.com> wrote:
> > I am attempting to add a shard to our DB. I am running the mongos
> > process on a Windows Server 2008 box successfully. I am running my
> > mongod and my configsvr processes on a Linux CentOS 6.0 configuration.
> > It also is up and running. Now I am trying to add the shard to the DB.
> > While connected to the mongos process on the windows box I run the
> > command below and get the following error:
>
> > mongos> db.runCommand({addshard:"replicaSetName/mongod serverName:
> > 27018"})
>
> > {
> >     "ok" : 0,
> >     "errmsg" : "failed listing replicaSetName/mongod serverName:
> > 27018's databases:{errmsg: \"need to login\", ok: 0.0}"
> > }
>
> > Thing is I have not set up any users yet in the database. I did set
> > auth = true in my config file for the mongod process. But I cannot
> > find any documentation as to the syntax for the mongos processes.
>
> > What do I need to login to? is it a param in the db.runCommand/
> > addshard? How do I resolve this issue?
>
> > Thanks,
>
> > Erik
>
> > --
> > 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 athttp://groups.google.com/group/mongodb-user?hl=en.- Hide quoted text -
>
> - Show quoted text -

ejholm

unread,
Feb 8, 2012, 5:33:03 PM2/8/12
to mongodb-user
Thank you Scott, I believe that was the issue.

Though now I have one other question. I have set up the keyFile on
both the app server(Windows Server 2008) and on the DB server (Linux
CentOS 6.0). The documentation states that the file can only be read
by the current user. So is that saying that the user that started each
process on the different servers must be the same? The owner of the
directory/files on the Linux box is one user, the executor of the
mongos process on the Windows box is another user. Is this a problem?
I'm assuming that it is, due to the log file on the app server, which
I have posted below:

Wed Feb 08 22:18:55 c:\mongodb\bin\mongos.exe db version v2.0.2,
pdfile version 4.5 starting (--help for usage)
Wed Feb 08 22:18:55 git version:
514b122d308928517f5841888ceaa4246a7f18e3
Wed Feb 08 22:18:55 build info: windows (6, 1, 7601, 2, 'Service Pack
1') BOOST_LIB_VERSION=1_42
Wed Feb 08 22:18:55 config string : ommited
Wed Feb 08 22:18:55 creating new connection to:omitted
Wed Feb 08 22:18:55 BackgroundJob starting: ConnectBG
Wed Feb 08 22:18:55 connected connection!
Wed Feb 08 22:18:55 calling onCreate auth for DEV-VM-omitted:27019
Wed Feb 08 22:18:55 User Assertion: 15847:can't authenticate to shard
server
uncaught exception in mongos main:
15847 can't authenticate to shard server
CursorCache at shutdown - sharded: 0 passthrough: 0

Please let me know what you think.

Thanks,

Erik
> > > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

Eliot Horowitz

unread,
Feb 12, 2012, 1:30:33 AM2/12/12
to mongod...@googlegroups.com
The user doesn't have to be the same.
--keyfile is for all mongos/mongod, not app servers.
Reply all
Reply to author
Forward
0 new messages