renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/action_provision -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/action_provision
renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/action_set_name -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/action_set_name renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/box_meta -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/box_meta renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/creator_uid -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/creator_uid renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/id -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/id renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/index_uuid -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/index_uuid renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/private_key -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/private_key renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/synced_folders -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/synced_folders renommé : sio2/SISR/10-ha/bookworm/.vagrant/machines/default/virtualbox/vagrant_cwd -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/machines/default/virtualbox/vagrant_cwd renommé : sio2/SISR/10-ha/bookworm/.vagrant/rgloader/loader.rb -> sio2/SISR/01-haute_disponibilite/bookworm/.vagrant/rgloader/loader.rb renommé : sio2/SISR/10-ha/bookworm/Vagrantfile -> sio2/SISR/01-haute_disponibilite/bookworm/Vagrantfile renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/action_provision -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/action_provision renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/action_set_name -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/action_set_name renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/box_meta -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/box_meta renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/creator_uid -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/creator_uid renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/id -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/id renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/index_uuid -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/index_uuid renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/private_key -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/private_key renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/synced_folders -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/synced_folders renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv1/virtualbox/vagrant_cwd -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv1/virtualbox/vagrant_cwd renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/action_provision -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/action_provision renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/action_set_name -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/action_set_name renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/box_meta -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/box_meta renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/creator_uid -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/creator_uid renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/id -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/id renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/index_uuid -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/index_uuid renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/private_key -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/private_key renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/synced_folders -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/synced_folders renommé : sio2/SISR/10-ha/rsync/.vagrant/machines/srv2/virtualbox/vagrant_cwd -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/machines/srv2/virtualbox/vagrant_cwd renommé : sio2/SISR/10-ha/rsync/.vagrant/rgloader/loader.rb -> sio2/SISR/01-haute_disponibilite/rsync/.vagrant/rgloader/loader.rb renommé : sio2/SISR/10-ha/rsync/Vagrantfile -> sio2/SISR/01-haute_disponibilite/rsync/Vagrantfile nouveau fichier : sio2/SISR/02-heartbeat/hb1/inst-hb1.sh nouveau fichier : sio2/SISR/02-heartbeat/hb2/inst-hb2.sh nouveau fichier : sio2/SISR/vagrantfile_rsync
This commit is contained in:
parent
bcd59abadb
commit
e968256f6d
49
sio2/SISR/02-heartbeat/hb1/inst-hb1.sh
Normal file
49
sio2/SISR/02-heartbeat/hb1/inst-hb1.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# les bases
|
||||
# noeud hb1 : 192.168.0.101
|
||||
# noeud hb2 : 192.168.0.102
|
||||
# addr virt. : 192.168.0.103
|
||||
|
||||
sed -i 's/bookworm/hb1/g' /etc/host{s,name}
|
||||
apt update
|
||||
apt install -y heartbeat apache2 net-tools
|
||||
systemctl disable apache2
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s3
|
||||
allow-hotplug enp0s3
|
||||
iface enp0s3 inet static
|
||||
address 192.168.0.101/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s8
|
||||
allow-hotplug enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 10.0.0.1/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cd /usr/share/doc/heartbeat
|
||||
gunzip *.gz
|
||||
cp ha.cf /etc/ha.d
|
||||
cp haresources /etc/ha.d
|
||||
cp authkeys /etc/ha.d
|
||||
cd /etc/ha.d
|
||||
echo "192.168.0.102 hb2" >> /etc/hosts # a adapter pour hb2
|
||||
|
||||
cat <<EOT >> /etc/ha.d/ha.cf
|
||||
bcast enp0s8
|
||||
node hb1
|
||||
node hb2
|
||||
pacemaker off
|
||||
EOT
|
||||
|
||||
# echo " hb1 192.168.0.103 apache2" >> /etc/ha.d/haresources pou Debian buster
|
||||
echo " hb1 192.168.0.103/24/enp0s3 apache2" >> /etc/ha.d/haresources
|
||||
|
||||
cat <<EOT >> /etc/ha.d/authkeys
|
||||
auth 1
|
||||
1 crc
|
||||
EOT
|
||||
|
||||
chmod 600 /etc/ha.d/authkeys
|
||||
echo hb1 > /var/www/html/index.html # a adapter pour hb2
|
||||
#
|
50
sio2/SISR/02-heartbeat/hb2/inst-hb2.sh
Normal file
50
sio2/SISR/02-heartbeat/hb2/inst-hb2.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# les bases
|
||||
# noeud hb1 : 192.168.0.101
|
||||
# noeud hb2 : 192.168.0.102
|
||||
# addr virt. : 192.168.0.103
|
||||
|
||||
sed -i 's/bookworm/hb2/g' /etc/host{s,name}
|
||||
apt update
|
||||
apt install -y heartbeat apache2 net-tools
|
||||
systemctl disable apache2
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s3
|
||||
allow-hotplug enp0s3
|
||||
iface enp0s3 inet static
|
||||
address 192.168.0.102/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cat <<EOT> /etc/network/interfaces.d/enp0s8
|
||||
allow-hotplug enp0s8
|
||||
iface enp0s8 inet static
|
||||
address 10.0.0.2/24 # a adapter pour hb2
|
||||
EOT
|
||||
|
||||
cd /usr/share/doc/heartbeat
|
||||
gunzip *.gz
|
||||
cp ha.cf /etc/ha.d
|
||||
cp haresources /etc/ha.d
|
||||
cp authkeys /etc/ha.d
|
||||
cd /etc/ha.d
|
||||
echo "192.168.0.102 hb2" >> /etc/hosts # a adapter pour hb2
|
||||
|
||||
cat <<EOT >> /etc/ha.d/ha.cf
|
||||
bcast enp0s8
|
||||
node hb1
|
||||
node hb2
|
||||
pacemaker off
|
||||
EOT
|
||||
|
||||
# echo " hb1 192.168.0.103 apache2" >> /etc/ha.d/haresources pou Debian buster
|
||||
echo " hb1 192.168.0.103/24/enp0s3 apache2" >> /etc/ha.d/haresources
|
||||
|
||||
cat <<EOT >> /etc/ha.d/authkeys
|
||||
auth 1
|
||||
1 crc
|
||||
EOT
|
||||
|
||||
chmod 600 /etc/ha.d/authkeys
|
||||
echo hb2 > /var/www/html/index.html # a adapter pour hb2
|
||||
#
|
||||
|
28
sio2/SISR/vagrantfile_rsync
Normal file
28
sio2/SISR/vagrantfile_rsync
Normal file
@ -0,0 +1,28 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.provision "shell", inline: "apt-get update" # execute pour chacune des machines
|
||||
|
||||
config.vm.define "srv1" do |srv1|#VM No'1
|
||||
srv1.vm.box = "debian/bookworm64" #Setting machine type
|
||||
srv1.vm.hostname = "srv1" #Setting machine type
|
||||
srv1.vm.network "public_network", ip: "192.168.0.111"#Set static IP
|
||||
srv1.vm.provision "shell", inline: <<-SHELL
|
||||
timedatectl set-timezone Europe/Paris
|
||||
apt-get install -y wget curl vim unzip apache2
|
||||
echo "192.168.0.112 srv2" >> /etc/hosts
|
||||
SHELL
|
||||
end
|
||||
|
||||
config.vm.define "srv2" do |srv2|# VM No2
|
||||
srv2.vm.box = "debian/bookworm64" #Setting machine type
|
||||
srv2.vm.hostname = "srv2" #Setting machine type
|
||||
srv2.vm.network "public_network", ip: "192.168.0.112" #Set static IP
|
||||
srv2.vm.provision "shell", inline: <<-SHELL
|
||||
timedatectl set-timezone Europe/Paris
|
||||
apt-get install -y wget curl vim unzip apache2
|
||||
echo "192.168.0.111 srv1" >> /etc/hosts
|
||||
SHELL
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user