https://github.com/rcbops/rpc-heat-mongodb
Heat template to install clustered MongoDB
https://github.com/rcbops/rpc-heat-mongodb
Last synced: 9 months ago
JSON representation
Heat template to install clustered MongoDB
- Host: GitHub
- URL: https://github.com/rcbops/rpc-heat-mongodb
- Owner: rcbops
- License: apache-2.0
- Created: 2014-10-31T18:19:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-13T19:31:10.000Z (almost 11 years ago)
- Last Synced: 2025-08-26T00:35:13.932Z (10 months ago)
- Homepage: http://rcbops.github.io/RPC-Heat-MongoDB/
- Size: 333 KB
- Stars: 1
- Watchers: 5
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Description
===========
This is an OpenStack HEAT template to deploy [MongoDB](http://www.mongodb.org/)
to multiple servers in an OpenStack cloud.
This template uses [MongoDB salt-formulas](https://github.com/rcbops/mongodb-formula)
to configure the servers. Three instances will be Mongo configuration servers,
at least two mongo routing (mongos) servers, and we at least 3 mongodb shards in a replica set.
Each replica set created becomes a shard for databases to spread across.
For access to nodes in the MongoDB cluster, a floating ip will be assigned to the
salt-master. Or a new server can be created in the same network as the MongoDB network.
Additionally, mongos server will also be on a separete network so that applications could
access your database cluster without being on the same network.
Any changes to the MongoDB configuration can be done using Salt pillars on the Salt
master. Adding additional mongos nodes can be done via Salt as well.
Requirements
============
* A Heat provider that supports the following:
* OS::Neutron::Net
* OS::Neutron::Subnet
* OS::Neutron::Router
* OS::Neutron::RouterInterface
* OS::Neutron::FloatingIP
* OS::Neutron::FloatingIPAssociation
* OS::Neutron::Port
* OS::Heat::SoftwareConfig
* OS::Heat::SoftwareDeployment
* OS::Heat::RandomString
* OS::Heat::ResourceGroup
* OS::Nova::Server
* OS::Nova::KeyPair
* A separete application network where mongos node will be connected.
* The flavor should have at least 10GB of disk space.
* Port 27017 should be accesible
* An Ubuntu image (12.04 or newer) preconfigured with heat-cfntools and heat config-script.
Instructions for creating a heat-cfntools enabled image for use with Heat can be
found [here] (http://docs.openstack.org/developer/heat/getting_started/jeos_building.html).
* An OpenStack username, password, and tenant id.
* [python-heatclient](https://github.com/openstack/python-heatclient)
`>= v0.2.12`:
```bash
pip install python-heatclient
```
Using Heat-client
=============
Here is an example of how to deploy this template using the
[python-heatclient](https://github.com/openstack/python-heatclient):
```
heat stack-create mongo-iptables-test -f mongodb_stack.yaml -e env.yaml \
-P minion-size-mongodb=m1.small -P floating-network-id=<...> \
-P image=[image_name] -P keyname=[ssh_key] \
-P apps-network=<...>
```
All the required parameters are as follows:
```
"minion-count-mongos": How many mongos servers will be required
"apps-network": Network UUID of application network
"image": Image name
"floating-network-id": UUID of the external network. The private network created by this stack will route to this network. Also, any floating ip's needed by this stack will come this network.
"keyname": Key name for loggin in to instances
"minion-size-mongodb": Flavor (image size) of mongod servers to be created.
"minion-count-mongodb": How many mongod servers will be in a cluster.
```
Using Salt
=============
If you wish to make changes to your environment after all the nodes were built,
you may re-run salt states as follows:
```
salt -G 'roles:mongoconfigsrv' state.highstate
salt -G 'roles:mongodb' state.highstate
salt -G 'roles:mongos' state.highstate
salt -G 'roles:mongodb' state.sls mongodb.replication
salt -G 'roles:mongos' state.sls mongodb.mongos.cluster
```
The roles work as follows:
"mongoconfigsrv" is a role for mongo configuration servers.
"mongodb" is a role for mongodb (shards) servers.
"mongos" is a role for mongos (router) servers.
Using Horizon
=============
You can also go to your Horizon Dashboard in your browser and create
the MongoDB stack from under the Orchestration tab.
License
=======
```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```