Created
September 23, 2013 19:02
-
-
Save boffbowsh/6675281 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
#! /bin/bash | |
echo 'export PATH=/usr/sbin:$PATH' > /etc/profile.d/sbin.sh | |
. /etc/profile.d/sbin.sh | |
wget --no-check-certificate -c https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm | |
wget -c http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5-1.noarch.rpm | |
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
rpm -Uvh ftp://mirror.switch.ch/pool/4/mirror/centos/5.9/os/x86_64/CentOS/unixODBC-libs-2.2.11-10.el5.x86_64.rpm | |
rpm -Uvh ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/aevseev/CentOS_CentOS-5/x86_64/erlang-R16B-19.1.x86_64.rpm | |
yum install -y rabbitmq-server-3.1.5-1.noarch.rpm | |
/etc/init.d/rabbitmq-server stop | |
echo "foobardeadbeefcafecoffeebabefeed" > /var/lib/rabbitmq/.erlang.cookie | |
chmod 600 /var/lib/rabbitmq/.erlang.cookie | |
rabbitmq-plugins enable rabbitmq_management | |
cat >> /etc/hosts <<HOSTS | |
192.168.56.201 rabbit1 | |
192.168.56.202 rabbit2 | |
HOSTS | |
/etc/init.d/rabbitmq-server start | |
if [[ $HOSTNAME == "rabbit2" ]]; then | |
rabbitmqctl stop_app | |
rabbitmqctl join_cluster rabbit@rabbit1 | |
rabbitmqctl start_app | |
fi |
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 | |
sed -i 's/us\./gb./g' /etc/apt/sources.list | |
wget --no-check-certificate -c https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb | |
wget -c http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server_3.1.5-1_all.deb | |
sudo dpkg -i erlang-solutions_1.0_all.deb | |
apt-get update | |
apt-get install -y erlang-nox | |
sudo dpkg -i rabbitmq-server_3.1.5-1_all.deb | |
/etc/init.d/rabbitmq-server stop | |
echo "foobardeadbeefcafecoffeebabefeed" > /var/lib/rabbitmq/.erlang.cookie | |
chmod 600 /var/lib/rabbitmq/.erlang.cookie | |
rabbitmq-plugins enable rabbitmq_management | |
cat >> /etc/hosts <<HOSTS | |
192.168.56.211 rabbit1 | |
192.168.56.212 rabbit2 | |
HOSTS | |
/etc/init.d/rabbitmq-server start | |
if [[ $HOSTNAME == "rabbit2" ]]; then | |
rabbitmqctl stop_app | |
rabbitmqctl join_cluster rabbit@rabbit1 | |
rabbitmqctl start_app | |
fi |
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
Vagrant.configure("2") do |config| | |
config.vm.define "centos1" do |config| | |
config.vm.box = "centos-5.6" | |
config.vm.box_url = "http://dl.dropbox.com/u/9227672/centos-5.6-x86_64-netinstall-4.1.6.box" | |
config.vm.provision "shell", path: "centos.sh" | |
config.vm.network :private_network, ip: "192.168.56.201" | |
config.vm.hostname = "rabbit1" | |
end | |
config.vm.define "centos2" do |config| | |
config.vm.box = "centos-5.6" | |
config.vm.box_url = "http://dl.dropbox.com/u/9227672/centos-5.6-x86_64-netinstall-4.1.6.box" | |
config.vm.provision "shell", path: "centos.sh" | |
config.vm.network :private_network, ip: "192.168.56.202" | |
config.vm.hostname = "rabbit2" | |
end | |
config.vm.define "ubuntu1" do |config| | |
config.vm.box = "precise64" | |
config.vm.provision "shell", path: "ubuntu.sh" | |
config.vm.network :private_network, ip: "192.168.56.211" | |
config.vm.hostname = "rabbit1" | |
end | |
config.vm.define "ubuntu2" do |config| | |
config.vm.box = "precise64" | |
config.vm.provision "shell", path: "ubuntu.sh" | |
config.vm.network :private_network, ip: "192.168.56.212" | |
config.vm.hostname = "rabbit2" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment