发布于 2015-09-14 15:27:04 | 211 次阅读 | 评论: 0 | 来源: 网络整理
MongoDB can run on the dotCloud platform. It supports replica sets, and has alpha support for sharding.
The whole point of dotCloud is to run your apps and your databases in the same place, to optimize for latency and reliability. However, you can also deploy MongoDB on dotCloud and use it to power an app running anywhere else.
Well, what are you waiting for? :-)
Go ahead and create one (it’s free!) and install the CLI:
sudo easy_install pip; sudo pip install dotcloud
If you need help to get the CLI running, check the dotCloud install docs and don’t hesitate to ask for help.
The following snippet will deploy MongoDB on dotCloud for you in no time:
mkdir mongodb-on-dotcloud
cat >mongodb-on-dotcloud/dotcloud.yml <<EOF
db:
type: mongodb
EOF
dotcloud push mongorocks mongodb-on-dotcloud
dotcloud info mongorocks.db
The last command will show you the host, port, and credentials to be used to connect to your database.
Assuming you followed the instructions of the previous section, if you want to get a replica sets of 3 servers:
dotcloud scale mongorocks db=3
If you want to have a closer look at your MongoDB server, nothing beats SSH access:
dotcloud ssh mongorocks.db
All you need to do to run them is a git clone and a dotcloud push: