Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-577

It's not possible to shutdown database from Java

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.2, 2.7.3
    • Component/s: None
    • Environment:
      Windows 7 64bit, Java 6

      When I try to shutdown mongodb using this java code:

      final MongoURI uri = new MongoURI( "mongodb://localhost:16162" );
      final Mongo m = new Mongo( uri );
      final DB db = m.getDB( "admin" );
      final CommandResult command = db.command( new BasicDBObject( "shutdown", 1 ) );
      System.out.println( command );
      

      Last command prints:

      { "serverUsed" : "localhost:16162" , "errmsg" : "unauthorized: this command must run from localhost when running db without auth" , "ok" : 0.0}
      

      But as you can see I'm running it from localhost.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            betlista Martin Suska
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: