Last active
August 29, 2015 14:02
-
-
Save adamdaigian/5677fa177a38a4b0e48d to your computer and use it in GitHub Desktop.
MongoDB Cluster Install Script
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 | |
[[ -d /data ]] || mkdir /data | |
if [[ -f /usr/share/google/safe_format_and_mount ]];then | |
[[ -z $(mount | grep /data) ]] && sudo /usr/share/google/safe_format_and_mount -m "mkfs.ext4 -F" /dev/sdb /data | |
else | |
if [[ -z $(mount | grep /data) ]]; then | |
mkfs.ext4 /dev/xvdf | |
echo "/dev/xvdf /data auto noatime 0 0" | tee -a /etc/fstab | |
mount -a | |
fi | |
fi | |
[[ -d /data/db ]] || mkdir /data/db | |
[[ -d /data/log ]] || mkdir /data/log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment