Created
August 12, 2014 09:12
-
-
Save theofilis/38b522846782c3e69de9 to your computer and use it in GitHub Desktop.
simple client to handle varius task on mongdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import * | |
env.user = 'root' | |
env.hosts = ['host'] | |
@parallel | |
def install(): | |
run('apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10') | |
run("echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list") | |
with hide('output'): | |
run('apt-get update') | |
run('apt-get install mongodb-org -y') | |
run('service mongod stop') | |
def start(): | |
run('service mongod start') | |
def stop(): | |
run('service mongod stop') | |
def status(): | |
run('service mongod status') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment