|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- =======
- MongoDB
- =======
-
- MongoDB (from "humongous") is an open-source document database, and the leading NoSQL database. Written in C++.
-
- Available states
- ================
-
- .. contents::
- :local:
-
- ``mongodb.server``
- --------------------
-
- Setup MongoDB server
-
- Available metadata
- ==================
-
- .. contents::
- :local:
-
- ``metadata.mongodb.server.single``
- ----------------------------------
-
- Single-node MongoDB setup
-
- ``metadata.mongodb.server.cluster``
- -----------------------------------
-
- Clustered MongoDB setup
-
- Configuration parameters
- ========================
-
-
- Example reclass
- ===============
-
- Setup MongoDB with database for ceilometer.
-
- .. code-block:: yaml
-
- classes:
- - service.mongodb.server.cluster
- parameters:
- _param:
- mongodb_server_replica_set: ceilometer
- mongodb_ceilometer_password: cloudlab
- mongodb_admin_password: cloudlab
- mongodb_shared_key: xxx
- mongodb:
- server:
- database:
- ceilometer:
- enabled: true
- password: ${_param:mongodb_ceilometer_password}
- users:
- - name: ceilometer
- password: ${_param:mongodb_ceilometer_password}
-
- Sample pillars
- ==============
-
- Simple single server
-
- .. code-block:: yaml
-
- mongodb:
- server:
- enabled: true
- bind:
- address: 0.0.0.0
- port: 27017
- admin:
- username: admin
- password: magicunicorn
- database:
- dbname:
- enabled: true
- encoding: 'utf8'
- users:
- - name: 'username'
- password: 'password'
-
- Cluster of 3 nodes
-
- .. code-block:: yaml
-
- mongodb:
- server:
- enabled: true
- admin:
- user: admin
- password: magicunicorn
- master: mongo01
- members:
- - host: 192.168.1.11
- priority: 2
- - host: 192.168.1.12
- - host: 192.168.1.13
- replica_set: default
- shared_key: magicunicorn
-
- It's possible that first Salt run on master node won't pass correctly before
- all slave nodes are up and ready.
- Simply run salt again on master node to setup cluster, databases and users.
-
- To check cluster status, execute following:
-
- .. code-block:: bash
-
- mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()"
-
- Read more
- =========
-
- * http://docs.mongodb.org/manual/
- * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
- * https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise
|