Created
January 27, 2015 03:13
-
-
Save tj/5d0b68614b2ff5e0e9a9 to your computer and use it in GitHub Desktop.
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
# FoundationDB server | |
# | |
# Run this file, then on one machine run: | |
# $ sudo /usr/lib/foundationdb/make_public.py | |
# | |
# Copy /etc/foundationdb/fdb.cluster to each node and run: | |
# $ sudo service foundationdb restart | |
# | |
set -e | |
echo "Installing FoundationDB" | |
curl -L# https://foundationdb.com/downloads/f-ufixunfxuafxuod/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/3.0.2/foundationdb-server_3.0.2-1_amd64.deb -o server.deb | |
curl -L# https://foundationdb.com/downloads/f-ufixunfxuafxuod/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/3.0.2/foundationdb-clients_3.0.2-1_amd64.deb -o client.deb | |
dpkg -i client.deb server.deb | |
rm *.deb | |
echo "Stopping server" | |
service foundationdb stop | |
echo "Adding /fdb to /etc/fstab" | |
echo "/dev/xvdb /fdb ext4 defaults,noatime,discard 0 2" >> /etc/fstab | |
echo "Mounting /fdb" | |
mkdir /fdb | |
mkfs -t ext4 /dev/xvdb | |
mount /dev/xvdb /fdb | |
mkdir -p /fdb/data/4500 | |
mkdir -p /fdb/logs | |
echo "Mounting /fdb-backup" | |
apt-get install nfs-common portmap -y | |
mkdir /fdb-backup | |
mount 10.0.1.17:/data /fdb-backup | |
echo "Copying data" | |
cp -R /var/lib/foundationdb/data/4500 /fdb/data | |
chown -R ubuntu:ubuntu /fdb/data /etc/foundationdb | |
chmod g+s /fdb/data/* | |
service foundationdb stop | |
echo "Saving configuration" | |
cat <<EOF > /etc/foundationdb/foundationdb.conf | |
[fdbmonitor] | |
user = ubuntu | |
group = ubuntu | |
[general] | |
restart_delay = 60 | |
cluster_file = /etc/foundationdb/fdb.cluster | |
[fdbserver] | |
command = /usr/sbin/fdbserver | |
public_address = auto:\$ID | |
listen_address = public | |
datadir = /fdb/data/\$ID | |
logdir = /fdb/logs | |
[fdbserver.4500] | |
[backup_agent] | |
command = /usr/lib/foundationdb/backup_agent/backup_agent | |
[backup_agent.1] | |
EOF | |
echo "Starting server" | |
service foundationdb start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment