Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. # mongod.conf
  2.  
  3. # for documentation of all options, see:
  4. # http://docs.mongodb.org/manual/reference/configuration-options/
  5.  
  6. # where to write logging data.
  7. systemLog:
  8. destination: file
  9. logAppend: true
  10. path: /root/mongodata/log/mongod.log
  11.  
  12. # Where and how to store data.
  13. storage:
  14. dbPath: /root/mongodata/db1 # also have db2 and so on for rest of the instances
  15. journal:
  16. enabled: true
  17. # engine:
  18. # mmapv1:
  19. # wiredTiger:
  20.  
  21. # how the process runs
  22. processManagement:
  23. fork: true # fork and run in background
  24. pidFilePath: /rood/mongodata/db1/mongod.pid # location of pidfile, different for 4 instances
  25.  
  26. # network interfaces
  27. net:
  28. port: 30000 #port different for 4 different instances
  29. bindIp: 12.123.321.432(example ip, same for all 4 .conf files)
  30.  
  31. # security
  32. security:
  33. KeyFile: /path to my keyfile location
  34.  
  35. # authorization: enabled
  36.  
  37. #operationProfiling:
  38.  
  39. replication:
  40. replSetName: testReplica #have this same for all 4
  41.  
  42.  
  43. #sharding:
  44.  
  45. ## Enterprise-Only Options
  46.  
  47. #auditLog:
  48.  
  49. #snmp:
  50.  
  51. openssl rand -base64 756 > <path-to-keyfile>
  52. chmod 400 <path-to-keyfile>
  53.  
  54. mongo --host 12.123.321.432 --port 30000
  55.  
  56. 2016-12-22T20:55:38.396-0500 E QUERY [thread1] Error: couldn't add user: not authorized on test to execute command { createUser: "root", pwd: "xxx", roles: [ { role: "root", db: "admin" } ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 30000.0 } } :
  57. _getErrorWithCode@src/mongo/shell/utils.js:23:13
  58. DB.prototype.createUser@src/mongo/shell/db.js:1230:11
  59. @(shell):1:1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement