Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MongoDB Cluster Install Script
#!/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
You can’t perform that action at this time.