blob: 5d8b1f5fa608c38bb6aad44732c992fdc1d06893 [file] [log] [blame]
Filip Pytloun34f960c2015-10-06 16:28:32 +02001=======
2MongoDB
3=======
4
5MongoDB (from "humongous") is an open-source document database, and the leading NoSQL database. Written in C++.
6
7Available states
8================
9
10.. contents::
11 :local:
12
13``mongodb.server``
14--------------------
15
16Setup MongoDB server
17
18Available metadata
19==================
20
21.. contents::
22 :local:
23
24``metadata.mongodb.server.single``
25----------------------------------
26
27Single-node MongoDB setup
28
29``metadata.mongodb.server.cluster``
30-----------------------------------
31
32Clustered MongoDB setup
33
34Configuration parameters
35========================
36
37
38Example reclass
39===============
40
41Setup 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
63Sample pillars
64==============
65
66Simple 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
87Cluster of 3 nodes
88
89.. code-block:: yaml
90
91 mongodb:
92 server:
93 enabled: true
94 admin:
95 user: admin
96 password: magicunicorn
97 master: mongo01
98 members:
99 - host: 192.168.1.11
100 priority: 2
101 - host: 192.168.1.12
102 - host: 192.168.1.13
103 replica_set: default
104 shared_key: magicunicorn
105
106It's possible that first Salt run on master node won't pass correctly before
107all slave nodes are up and ready.
108Simply run salt again on master node to setup cluster, databases and users.
109
110To check cluster status, execute following:
111
112.. code-block:: bash
113
114 mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()"
115
116Read more
117=========
118
119* http://docs.mongodb.org/manual/
120* http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
121* https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise
Filip Pytloun0d7cf4c2017-02-02 13:02:03 +0100122
123Documentation and Bugs
124======================
125
126To learn how to install and update salt-formulas, consult the documentation
127available online at:
128
129 http://salt-formulas.readthedocs.io/
130
131In the unfortunate event that bugs are discovered, they should be reported to
132the appropriate issue tracker. Use Github issue tracker for specific salt
133formula:
134
135 https://github.com/salt-formulas/salt-formula-mongodb/issues
136
137For feature requests, bug reports or blueprints affecting entire ecosystem,
138use Launchpad salt-formulas project:
139
140 https://launchpad.net/salt-formulas
141
142You can also join salt-formulas-users team and subscribe to mailing list:
143
144 https://launchpad.net/~salt-formulas-users
145
146Developers wishing to work on the salt-formulas projects should always base
147their work on master branch and submit pull request against specific formula.
148
149 https://github.com/salt-formulas/salt-formula-mongodb
150
151Any questions or feedback is always welcome so feel free to join our IRC
152channel:
153
154 #salt-formulas @ irc.freenode.net