Hosts
-
node04-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.23
- RAM : 2Go
- vCPU : 2
- OS : Centos7
-
node05-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.24
- RAM : 2Go
- vCPU : 2
- OS : Centos7
-
node06-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.25
- RAM : 2Go
- vCPU : 2
- OS : Centos7
-
node07-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.26
- RAM : 2Go
- vCPU : 2
- OS : Centos7
-
node08-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.27
- RAM : 2Go
- vCPU : 2
- OS : Centos7
-
node09-sheepdog
- Disque /dev/sda: 8 Go
- Disque /dev/sdb : 45Go (Sheepdog)
- IP : 172.17.186.28
- RAM : 2Go
- vCPU : 2
- OS : Centos7
Mise à jour (6 machines)
[root@node0x-sheepdog ~]# yum update -y
Désactiver SELinux (6 machines)
[root@node0x-sheepdog ~]# vi /etc/selinux/config SELINUX=disabled
Installation des dépendances nécessaire (6 machines)
Récupération package nécessaire (6 machines)
[root@node0x-sheepdog ~]# yum -y install epel-release [root@node0x-sheepdog ~]# yum -y install wget git ninja-build corosynclib-devel [root@node0x-sheepdog ~]# yum -y install glib2 glib2-devel pixman-devel [root@node0x-sheepdog ~]# yum -y install yasm maven zlib-devel [root@node0x-sheepdog ~]# yum -y install ant install cppunit cppunit-devel [root@node0x-sheepdog ~]# yum -y install yasm fuse fuse-devel
Installation liburcu (6 machines)
[root@node0x-sheepdog ~]# cd /home [root@node0x-sheepdog ~]# git clone https://github.com/flatzo/liburcu.git [root@node0x-sheepdog ~]# cd liburcu/ [root@node0x-sheepdog ~]#./bootstrap [root@node0x-sheepdog ~]#./configure [root@node0x-sheepdog ~]# make && make install [root@node0x-sheepdog ~]# ldconfig
Installation maven 3.8 (6 machines)
[root@node0x-sheepdog ~]# cd /home [root@node0x-sheepdog home]# wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz [root@node0x-sheepdog home]# tar xzvf apache-maven-3.8.6-bin.tar.gz -C /opt [root@node0x-sheepdog home]# ln -s /opt/apache-maven-3.8.6 /opt/maven [root@node0x-sheepdog home]# vi ~/.bashrc export JAVA_HOME=/usr/lib/jvm/jre-openjdk export M2_HOME=/opt/maven export MAVEN_HOME=/opt/maven export PATH=${M2_HOME}/bin:${PATH} [root@node0x-sheepdog home]# source ~/.bashrc
[root@node0x-sheepdog home]# mvn -version
Installation sheepdog avec zooKeeper (6 machines)
Installation Client zookeeper (6 machines)
[root@node0x-sheepdog ~]# cd /home [root@node0x-sheepdog ~]# wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.0/apache-zookeeper-3.8.0.tar.gz [root@node0x-sheepdog ~]# tar xzvf apache-zookeeper-3.8.0.tar.gz [root@node0x-sheepdog ~]# cd /home/apache-zookeeper-3.8.0/zookeeper-jute [root@node0x-sheepdog zookeeper-jute]# mvn clean
[root@node0x-sheepdog zookeeper-jute]# mvn install
[root@node0x-sheepdog zookeeper-jute]# cd /home/apache-zookeeper-3.8.0/zookeeper-client/zookeeper-client-c [root@node0x-sheepdog zookeeper-client-c]# autoreconf -vfi [root@node0x-sheepdog zookeeper-client-c]# automake [root@node0x-sheepdog zookeeper-client-c]# autoconf [root@node0x-sheepdog zookeeper-client-c]# ./configure [root@node0x-sheepdog zookeeper-client-c]# make && make install [root@node0x-sheepdog zookeeper-client-c]# ls /usr/local/lib |grep libzookeeper
Set variable d’environnement (6 machines)
[root@node0x-sheepdog zookeeper-client-c]# vi ~/.bashrc Export LD_LIBRARY_PATH=/usr/local/lib
[root@node0x-sheepdog zookeeper-client-c]# source ~/.bashrc [root@node0x-sheepdog zookeeper-client-c]# echo $LD_LIBRARY_PATH /usr/local/lib
Installation sheedog (6 machines)
[root@node0x-sheepdog zookeeper-client-c]# cd /home [root@node0x-sheepdog home]# git clone https://github.com/sheepdog/sheepdog.git [root@node0x-sheepdog home]# cd sheepdog [root@node0x-sheepdog sheepdog]# ./autogen.sh [root@node0x-sheepdog sheepdog]# ./configure --enable-zookeeper --enable-sheepfs --disable-corosync
Correction BUG (6 machines)
[root@node0x-sheepdog sheepdog]# vi /home/sheepdog/sheep/cluster/zookeeper.c Ajouter #define ZOO_MAJOR_VERSION "3.8.0" #define ZOO_MINOR_VERSION "3.8.0" #define ZOO_PATCH_VERSION "3.8.0"
[root@node0x-sheepdog sheepdog]# make && make install
Chargement module KVM (6 machines)
[root@node0x-sheepdog home]# modprobe kvm [root@node0x-sheepdog home]# lsmod | grep kvm [root@node0x-sheepdog home]# echo "modprobe kvm" >> /etc/rc.local
Configuration Disque sheepFS (6 machines)
Installation paquets nécessaires
[root@node0x-sheepdog ~]# yum install python3-attrs libattr
Préparation et installation disque sheepdog
[root@node0x-sheepdog ~]# parted -s /dev/sdb mklabel msdos [root@node0x-sheepdog ~]# parted -s /dev/sdb mkpart primary 1MiB 100% [root@node0x-sheepdog ~]# mkfs.ext4 /dev/sdb
[root@node0x-sheepdog ~]# lsblk
[root@node0x-sheepdog ~]# pvcreate /dev/sdb [root@node0x-sheepdog ~]# vgcreate sheepdog /dev/sdb [root@node0x-sheepdog ~]# lvcreate -n sheep0 -l 100%FREE sheepdog
[root@node0x-sheepdog ~]# ls /dev/mapper/
[root@node0x-sheepdog ~]# mkfs.ext4 /dev/mapper/sheepdog-sheep0 [root@node0x-sheepdog ~]# tune2fs -l /dev/mapper/sheepdog-sheep0
[root@node0x-sheepdog ~]# mkdir -p /mnt/sheep/0 [root@node0x-sheepdog ~]# echo "/dev/mapper/sheepdog-sheep0 /mnt/sheep/0 ext4 user_xattr 0 1" >> /etc/fstab [root@node0x-sheepdog ~]# mount /mnt/sheep/0 [root@node0x-sheepdog ~]# df –Th
Installation Qemu pour sheepdog (6 machines)
[root@node0x-sheepdog ~]# cd /home [root@node0x-sheepdog ~]# git clone https://github.com/sheepdog/qemu.git [root@node0x-sheepdog ~]# cd qemu [root@node0x-sheepdog ~]#./configure --disable-werror
[root@node0x-sheepdog ~]# git submodule update --init dtc
[root@node0x-sheepdog ~]#./configure --disable-werror [root@node0x-sheepdog ~]# make && make install
Règles firewall (6 machines)
[root@node-temp-sheep ~]# firewall-cmd --add-port={2181,7000}/tcp --permanent --zone=public && firewall-cmd --reload [root@node-temp-sheep ~]# firewall-cmd --zone=public --permanent --add-service=vnc-server && firewall-cmd --reload [root@node-temp-sheep ~]# firewall-cmd --list-all
Lancement de sheepdog (6 machines)
Load sheepdog node04
[root@node04-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node04-sheepdog ~]# chmod +x /etc/rc.local [root@node04-sheepdog ~]# source /etc/rc.local
[root@node04-sheepdog ~]# dog node list
Load sheepdog node05
[root@node05-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node05-sheepdog ~]# chmod +x /etc/rc.local [root@node05-sheepdog ~]# source /etc/rc.local
[root@node05-sheepdog ~]# dog node list
Load sheepdog node06
[root@node06-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node06-sheepdog ~]# chmod +x /etc/rc.local [root@node06-sheepdog ~]# source /etc/rc.local
[root@node06-sheepdog ~]# dog node list
Load sheepdog node07
[root@node07-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node07-sheepdog ~]# chmod +x /etc/rc.local [root@node07-sheepdog ~]# source /etc/rc.local
[root@node07-sheepdog ~]# dog node list
Load sheepdog node08
[root@node08-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node08-sheepdog ~]# chmod +x /etc/rc.local [root@node08-sheepdog ~]# source /etc/rc.local
[root@node08-sheepdog ~]# dog node list
Load sheepdog node09
[root@node09-sheepdog ~]# echo "sheep --cluster zookeeper:172.17.186.20:2181,172.17.186.21:2181,172.17.186.22:2181 -n /var/lib/sheepdog,/mnt/sheep/0 -p 7000" >> /etc/rc.local [root@node09-sheepdog ~]# chmod +x /etc/rc.local [root@node09-sheepdog ~]# source /etc/rc.local
[root@node09-sheepdog ~]# dog node list
Vérifier les informations Cluster (node04)
[root@node04-sheepdog sheepdog]# dog cluster info Cluster status: Waiting for cluster to be formatted
Création d’un cluster avec une « policy » de « random default reduncy » (node04)
Nous allons définir une redondance de 4
[root@node04-sheepdog sheepdog]# dog cluster format -c 4 using backend plain store
Vérifier les informations Cluster (node04)
[root@node04-sheepdog sheepdog]# dog cluster info
[root@node04-sheepdog sheepdog]# dog cluster info -v
Vérifier les informations du pool Disque /mnt/sheep/0 (node04)
[root@node04-sheepdog ~]# dog node info
Liste des machines Virtuelle – format vdi (node04)
[root@node04-sheepdog ~]# dog vdi list
Check d’écriture sur le Pool Sheepdog
Test création machine VM vide (node04)
[root@node04-sheepdog ~]# qemu-img create sheepdog:chris 4G
[root@node04-sheepdog ~]# dog vdi list
[root@node04-sheepdog home]# dog vdi delete chris [root@node04-sheepdog home]# dog vdi list
Views: 3