10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

Orchestrating servers with auth and non-localhost #154

Closed bjori closed 9 years ago

bjori commented 9 years ago
$ mongo-orchestration -b 192.168.112.10 start
{                                                                                    
    "name": "mongod",                                                                
    "id" : "STANDALONE-AUTH",                                                        
    "auth_key": "secret",                                                            
    "login": "root",                                                                 
    "password": "toor",                                                              
    "procParams": {                                                                  
        "dbpath": "/tmp/standalone-auth/",                                           
        "ipv6": true,                                                                
        "logappend": true,                                                           
        "logpath": "/tmp/standalone-auth/m.log",                                     
        "journal": true,                                                             
        "port": 2200,                                                                
        "setParameter": {"enableTestCommands": 1}                                    
    }                                                                                
}

results in

2014-12-16T16:10:38.592-0800 [initandlisten] MongoDB starting : pid=9187 port=2200 dbpath=/tmp/standalone-auth/ 64-bit host=precise64
2014-12-16T16:10:38.592-0800 [initandlisten] db version v2.6.6
2014-12-16T16:10:38.592-0800 [initandlisten] git version: 608e8bc319627693b04cc7da29ecc300a5f45a1f modules: enterprise
2014-12-16T16:10:38.593-0800 [initandlisten] OpenSSL version: OpenSSL 1.0.1 14 Mar 2012
2014-12-16T16:10:38.593-0800 [initandlisten] build info: Linux ip-10-69-91-141 3.2.0-36-virtual #57-Ubuntu SMP Tue Jan 8 22:04:49 UTC 2013 x86_64 BOOST_LIB_VERSION=1_49
2014-12-16T16:10:38.593-0800 [initandlisten] allocator: tcmalloc
2014-12-16T16:10:38.593-0800 [initandlisten] options: { config: "/tmp/mongo-7sSu4y", net: { bindIp: "192.168.112.10", ipv6: true, port: 2200 }, replication: { oplogSizeMB: 100 }, security: { authorization: "enabled", keyFile: "/tmp/standalone-auth/key" }, setParameter: { enableTestCommands: "1" }, storage: { dbPath: "/tmp/standalone-auth/", journal: { enabled: true }, preallocDataFiles: false, smallFiles: true }, systemLog: { destination: "file", logAppend: true, path: "/tmp/standalone-auth/m.log" } }
2014-12-16T16:10:38.595-0800 [initandlisten] journal dir=/tmp/standalone-auth/journal
2014-12-16T16:10:38.595-0800 [initandlisten] recover : no journal files present, no recovery needed
2014-12-16T16:10:38.640-0800 [initandlisten] allocating new ns file /tmp/standalone-auth/local.ns, filling with zeroes...
2014-12-16T16:10:38.665-0800 [FileAllocator] allocating new datafile /tmp/standalone-auth/local.0, filling with zeroes...
2014-12-16T16:10:38.665-0800 [FileAllocator] creating directory /tmp/standalone-auth/_tmp
2014-12-16T16:10:38.666-0800 [FileAllocator] done allocating datafile /tmp/standalone-auth/local.0, size: 16MB,  took 0 secs
2014-12-16T16:10:38.667-0800 [initandlisten] build index on: local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }
2014-12-16T16:10:38.667-0800 [initandlisten]     added index to empty collection
2014-12-16T16:10:38.667-0800 [initandlisten] waiting for connections on port 2200
2014-12-16T16:10:39.556-0800 [initandlisten] connection accepted from 192.168.112.10:40421 #1 (1 connection now open)
2014-12-16T16:10:39.556-0800 [initandlisten] connection accepted from 192.168.112.10:40422 #2 (2 connections now open)
2014-12-16T16:10:39.557-0800 [conn1] end connection 192.168.112.10:40421 (1 connection now open)
2014-12-16T16:10:39.559-0800 [initandlisten] connection accepted from 192.168.112.10:40423 #3 (2 connections now open)
2014-12-16T16:10:39.560-0800 [conn2] end connection 192.168.112.10:40422 (1 connection now open)
2014-12-16T16:10:39.561-0800 [conn3] Unauthorized not authorized on admin to execute command { usersInfo: "root" }
2014-12-16T16:10:39.562-0800 [conn3] Unauthorized not authorized on admin to execute command { createUser: "root", pwd: "xxx", digestPassword: false, roles: [ "__system", "clusterAdmin", "dbAdminAnyDatabase", "readWriteAnyDatabase", "userAdminAnyDatabase" ], writeConcern: { fsync: true } }
2014-12-16T16:10:39.563-0800 [conn3] end connection 192.168.112.10:40423 (0 connections now open)
2014-12-16T16:10:39.564-0800 [initandlisten] connection accepted from 192.168.112.10:40424 #4 (1 connection now open)
2014-12-16T16:10:39.569-0800 [conn4] end connection 192.168.112.10:40424 (0 connections now open)
2014-12-16T16:10:43.722-0800 [initandlisten] connection accepted from 192.168.112.10:40428 #5 (1 connection now open)
2014-12-16T16:10:43.726-0800 [conn5] end connection 192.168.112.10:40428 (0 connections now open)
2014-12-16T16:10:43.745-0800 [initandlisten] connection accepted from 192.168.112.1:49035 #6 (1 connection now open)
2014-12-16T16:10:43.748-0800 [conn6]  authenticate db: admin { authenticate: 1, user: "root", nonce: "xxx", key: "xxx" }
2014-12-16T16:10:43.748-0800 [conn6] Failed to authenticate root@admin with mechanism MONGODB-CR: AuthenticationFailed UserNotFound Could not find user root@admin
2014-12-16T16:10:43.749-0800 [conn6] end connection 192.168.112.1:49035 (0 connections now open)
2014-12-16T16:11:38.644-0800 [clientcursormon] mem (MB) res:37 virt:308
2014-12-16T16:11:38.644-0800 [clientcursormon]  mapped (incl journal view):64
2014-12-16T16:11:38.644-0800 [clientcursormon]  connections:0

It cannot create the user as mongod was started with auth listening on non-localhost so the localhost-exception goes out the window.

llvtt commented 9 years ago

resolved in 9aa35e28487ce87da61996a25c9dccbf1367ee98