Created
December 26, 2012 09:20
-
-
Save SeonghoonKim/4379081 to your computer and use it in GitHub Desktop.
mongodb install script for RHEL/CentOS 6
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
#!/bin/bash | |
MONGODB_REPO="/etc/yum.repos.d/10gen-mongodb.repo" | |
if [ -f ${MONGODB_REPO} ]; then | |
echo "$MONGODB_REPO found" | |
else | |
cat << 'EOF' > ${MONGODB_REPO} | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/$basearch | |
enabled = 1 | |
gpgcheck=0 | |
EOF | |
fi | |
echo "Installing MongoDB..." | |
yum install -y mongo-10gen mongo-10gen-server | |
echo "Installing init script of MongoDB..." | |
chkconfig --level 2345 mongod on | |
echo "Starting MongoDB..." | |
service mongod start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment