nouveau fichier : bts_annee_2/cyber2/wordpress-lamp/README.md
nouveau fichier : bts_annee_2/cyber2/wordpress-lamp/compte-rendu-2024-09-30 nouveau fichier : bts_annee_2/cyber2/wordpress-lamp/compterendudistant.sh nouveau fichier : bts_annee_2/cyber2/wordpress-lamp/ferm.conf nouveau fichier : bts_annee_2/cyber2/wordpress-lamp/goss.yaml renommé : bts_annee_2/sisr2/seance_03/README.md -> bts_annee_2/sisr2/heartbeat_repa_charge/README.md renommé : bts_annee_2/sisr2/seance_03/hb1/inst-hb1.sh -> bts_annee_2/sisr2/heartbeat_repa_charge/hb1/inst-hb1.sh renommé : bts_annee_2/sisr2/seance_03/hb2/inst-hb2.sh -> bts_annee_2/sisr2/heartbeat_repa_charge/hb2/inst-hb2.sh renommé : bts_annee_2/sisr2/seance_03/vagrant/Vagrantfile_bookworm -> bts_annee_2/sisr2/heartbeat_repa_charge/vagrant/Vagrantfile_bookworm renommé : bts_annee_2/sisr2/seance_03/vagrant/Vagrantfile_rsync -> bts_annee_2/sisr2/heartbeat_repa_charge/vagrant/Vagrantfile_rsync renommé : bts_annee_2/sisr2/seance_04/README.md -> bts_annee_2/sisr2/lvs_haproxy/README.md renommé : bts_annee_2/sisr2/seance_04/lvs/haproxy.cfg -> bts_annee_2/sisr2/lvs_haproxy/lvs/haproxy.cfg renommé : bts_annee_2/sisr2/seance_04/lvs/ipvs.sh -> bts_annee_2/sisr2/lvs_haproxy/lvs/ipvs.sh
This commit is contained in:
		
							
								
								
									
										49
									
								
								bts_annee_2/sisr2/heartbeat_repa_charge/hb1/inst-hb1.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								bts_annee_2/sisr2/heartbeat_repa_charge/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
 | 
			
		||||
 #
 | 
			
		||||
		Reference in New Issue
	
	Block a user