Filip Pytloun | 34f960c | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | ======= |
| 2 | MongoDB |
| 3 | ======= |
| 4 | |
| 5 | MongoDB (from "humongous") is an open-source document database, and the leading NoSQL database. Written in C++. |
| 6 | |
| 7 | Available states |
| 8 | ================ |
| 9 | |
| 10 | .. contents:: |
| 11 | :local: |
| 12 | |
| 13 | ``mongodb.server`` |
| 14 | -------------------- |
| 15 | |
| 16 | Setup MongoDB server |
| 17 | |
| 18 | Available metadata |
| 19 | ================== |
| 20 | |
| 21 | .. contents:: |
| 22 | :local: |
| 23 | |
| 24 | ``metadata.mongodb.server.single`` |
| 25 | ---------------------------------- |
| 26 | |
| 27 | Single-node MongoDB setup |
| 28 | |
| 29 | ``metadata.mongodb.server.cluster`` |
| 30 | ----------------------------------- |
| 31 | |
| 32 | Clustered MongoDB setup |
| 33 | |
| 34 | Configuration parameters |
| 35 | ======================== |
| 36 | |
| 37 | |
| 38 | Example reclass |
| 39 | =============== |
| 40 | |
| 41 | Setup MongoDB with database for ceilometer. |
| 42 | |
| 43 | .. code-block:: yaml |
| 44 | |
| 45 | classes: |
| 46 | - service.mongodb.server.cluster |
| 47 | parameters: |
| 48 | _param: |
| 49 | mongodb_server_replica_set: ceilometer |
| 50 | mongodb_ceilometer_password: cloudlab |
| 51 | mongodb_admin_password: cloudlab |
| 52 | mongodb_shared_key: xxx |
| 53 | mongodb: |
| 54 | server: |
| 55 | database: |
| 56 | ceilometer: |
| 57 | enabled: true |
| 58 | password: ${_param:mongodb_ceilometer_password} |
| 59 | users: |
| 60 | - name: ceilometer |
| 61 | password: ${_param:mongodb_ceilometer_password} |
| 62 | |
| 63 | Sample pillars |
| 64 | ============== |
| 65 | |
| 66 | Simple single server |
| 67 | |
| 68 | .. code-block:: yaml |
| 69 | |
| 70 | mongodb: |
| 71 | server: |
| 72 | enabled: true |
| 73 | bind: |
| 74 | address: 0.0.0.0 |
| 75 | port: 27017 |
| 76 | admin: |
| 77 | username: admin |
| 78 | password: magicunicorn |
| 79 | database: |
| 80 | dbname: |
| 81 | enabled: true |
| 82 | encoding: 'utf8' |
| 83 | users: |
| 84 | - name: 'username' |
| 85 | password: 'password' |
| 86 | |
| 87 | Cluster of 3 nodes |
| 88 | |
| 89 | .. code-block:: yaml |
| 90 | |
| 91 | mongodb: |
| 92 | server: |
| 93 | enabled: true |
Petr Michalec | 34d75d9 | 2016-10-25 16:36:43 +0200 | [diff] [blame] | 94 | logging: |
| 95 | verbose: false |
| 96 | logLevel: 1 |
| 97 | oplogLevel: 0 |
Filip Pytloun | 34f960c | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 98 | admin: |
| 99 | user: admin |
| 100 | password: magicunicorn |
| 101 | master: mongo01 |
| 102 | members: |
| 103 | - host: 192.168.1.11 |
| 104 | priority: 2 |
| 105 | - host: 192.168.1.12 |
| 106 | - host: 192.168.1.13 |
| 107 | replica_set: default |
| 108 | shared_key: magicunicorn |
| 109 | |
| 110 | It's possible that first Salt run on master node won't pass correctly before |
| 111 | all slave nodes are up and ready. |
| 112 | Simply run salt again on master node to setup cluster, databases and users. |
| 113 | |
| 114 | To check cluster status, execute following: |
| 115 | |
| 116 | .. code-block:: bash |
| 117 | |
| 118 | mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()" |
| 119 | |
| 120 | Read more |
| 121 | ========= |
| 122 | |
| 123 | * http://docs.mongodb.org/manual/ |
| 124 | * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ |
| 125 | * https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise |
Filip Pytloun | 0d7cf4c | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 126 | |
| 127 | Documentation and Bugs |
| 128 | ====================== |
| 129 | |
| 130 | To learn how to install and update salt-formulas, consult the documentation |
| 131 | available online at: |
| 132 | |
| 133 | http://salt-formulas.readthedocs.io/ |
| 134 | |
| 135 | In the unfortunate event that bugs are discovered, they should be reported to |
| 136 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 137 | formula: |
| 138 | |
| 139 | https://github.com/salt-formulas/salt-formula-mongodb/issues |
| 140 | |
| 141 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 142 | use Launchpad salt-formulas project: |
| 143 | |
| 144 | https://launchpad.net/salt-formulas |
| 145 | |
| 146 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 147 | |
| 148 | https://launchpad.net/~salt-formulas-users |
| 149 | |
| 150 | Developers wishing to work on the salt-formulas projects should always base |
| 151 | their work on master branch and submit pull request against specific formula. |
| 152 | |
| 153 | https://github.com/salt-formulas/salt-formula-mongodb |
| 154 | |
| 155 | Any questions or feedback is always welcome so feel free to join our IRC |
| 156 | channel: |
| 157 | |
| 158 | #salt-formulas @ irc.freenode.net |