blob: f4ddd0367d62dd36d8368c9624ab5834b8c49de6 [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
Petr Michalec34d75d92016-10-25 16:36:43 +020094 logging:
95 verbose: false
96 logLevel: 1
97 oplogLevel: 0
Filip Pytloun34f960c2015-10-06 16:28:32 +020098 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
110It's possible that first Salt run on master node won't pass correctly before
111all slave nodes are up and ready.
112Simply run salt again on master node to setup cluster, databases and users.
113
114To 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
120Read 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 Pytloun0d7cf4c2017-02-02 13:02:03 +0100126
127Documentation and Bugs
128======================
129
130To learn how to install and update salt-formulas, consult the documentation
131available online at:
132
133 http://salt-formulas.readthedocs.io/
134
135In the unfortunate event that bugs are discovered, they should be reported to
136the appropriate issue tracker. Use Github issue tracker for specific salt
137formula:
138
139 https://github.com/salt-formulas/salt-formula-mongodb/issues
140
141For feature requests, bug reports or blueprints affecting entire ecosystem,
142use Launchpad salt-formulas project:
143
144 https://launchpad.net/salt-formulas
145
146You can also join salt-formulas-users team and subscribe to mailing list:
147
148 https://launchpad.net/~salt-formulas-users
149
150Developers wishing to work on the salt-formulas projects should always base
151their work on master branch and submit pull request against specific formula.
152
153 https://github.com/salt-formulas/salt-formula-mongodb
154
155Any questions or feedback is always welcome so feel free to join our IRC
156channel:
157
158 #salt-formulas @ irc.freenode.net