Saltstack Official MongoDB Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.rst 2.6KB

9 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. =======
  2. MongoDB
  3. =======
  4. MongoDB (from "humongous") is an open-source document database, and the leading NoSQL database. Written in C++.
  5. Available states
  6. ================
  7. .. contents::
  8. :local:
  9. ``mongodb.server``
  10. --------------------
  11. Setup MongoDB server
  12. Available metadata
  13. ==================
  14. .. contents::
  15. :local:
  16. ``metadata.mongodb.server.single``
  17. ----------------------------------
  18. Single-node MongoDB setup
  19. ``metadata.mongodb.server.cluster``
  20. -----------------------------------
  21. Clustered MongoDB setup
  22. Configuration parameters
  23. ========================
  24. Example reclass
  25. ===============
  26. Setup MongoDB with database for ceilometer.
  27. .. code-block:: yaml
  28. classes:
  29. - service.mongodb.server.cluster
  30. parameters:
  31. _param:
  32. mongodb_server_replica_set: ceilometer
  33. mongodb_ceilometer_password: cloudlab
  34. mongodb_admin_password: cloudlab
  35. mongodb_shared_key: xxx
  36. mongodb:
  37. server:
  38. database:
  39. ceilometer:
  40. enabled: true
  41. password: ${_param:mongodb_ceilometer_password}
  42. users:
  43. - name: ceilometer
  44. password: ${_param:mongodb_ceilometer_password}
  45. Sample pillars
  46. ==============
  47. Simple single server
  48. .. code-block:: yaml
  49. mongodb:
  50. server:
  51. enabled: true
  52. bind:
  53. address: 0.0.0.0
  54. port: 27017
  55. admin:
  56. username: admin
  57. password: magicunicorn
  58. database:
  59. dbname:
  60. enabled: true
  61. encoding: 'utf8'
  62. users:
  63. - name: 'username'
  64. password: 'password'
  65. Cluster of 3 nodes
  66. .. code-block:: yaml
  67. mongodb:
  68. server:
  69. enabled: true
  70. admin:
  71. user: admin
  72. password: magicunicorn
  73. master: mongo01
  74. members:
  75. - host: 192.168.1.11
  76. priority: 2
  77. - host: 192.168.1.12
  78. - host: 192.168.1.13
  79. replica_set: default
  80. shared_key: magicunicorn
  81. It's possible that first Salt run on master node won't pass correctly before
  82. all slave nodes are up and ready.
  83. Simply run salt again on master node to setup cluster, databases and users.
  84. To check cluster status, execute following:
  85. .. code-block:: bash
  86. mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()"
  87. Read more
  88. =========
  89. * http://docs.mongodb.org/manual/
  90. * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
  91. * https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise