MODOP Cluster SeaWeedFS – Partie 3 – Installation 4 nodes Volumes

Constitution du cluster Volumes

  • node-seaweed-v01
  • node-seaweed-v02
  • node-seaweed-v03
  • node-seaweed-v04

Spécification des 4 Volumes Volumes

  • IP : 100.0.10.161 à 100.0.10.164
  • vCPU : 2
  • RAM : 2Go
  • Disque sda : 8Go (Système)
  • Disque sdb : 50Go (Volume01)
  • Disque sdc : 50Go (Volume02)
  • OS : RockyLinux

Installation des prérequis

[root@node-seaweed-v0x ~]# dnf update -y
[root@node-seaweed-v0x ~]# yum install git make wget -y
[root@node-seaweed-v0x ~]# dnf install tar dnf-utils

Installation paquet GO

[root@node-seaweed-v0x ~]# wget -c https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
[root@node-seaweed-v0x ~]# tar -C /usr/local/ -xzf go1.22.0.linux-amd64.tar.gz

[root@node-seaweed-v0x ~]# echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile
export GOROOT=/usr/local/go

[root@node-seaweed-v0x ~]# echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile
export PATH=$PATH:/usr/local/go/bin

[root@node-seaweed-v0x ~]# source /etc/profile
[root@node-seaweed-v0x ~]# go version
go version go1.21.6 linux/amd64

Installation paquet seaweedfs

[root@node-seaweed-v0x ~]# git clone https://github.com/chrislusf/seaweedfs.git
[root@node-seaweed-v0x ~]# cd ~/seaweedfs
[root@node-seaweed-v0x seaweedfs]# make install
[root@node-seaweed-v0x seaweedfs]# cp ~/go/bin/weed /usr/local/bin/
[root@node-seaweed-v0x seaweedfs]# weed version
version 30GB 3.62 linux amd64

Ajout des Hosts « volume » du Cluster sur le DNS infrastructure

[root@node-seaweed-v01 ~]# for i in {1..4};do nslookup node-seaweed-v0$i;done

Régles Firewall

[root@node-seaweed-v0x ~]#firewall-cmd --remove-service={cockpit,dhcpv6-client} --permanent
[root@node-seaweed-v0x ~]#firewall-cmd --add-port={8080,18080,8081,18081}/tcp --permanent
[root@node-seaweed-v0x ~]#firewall-cmd --reload

Préparation Disque « Volume »

[root@node-seaweed-v0x seaweedfs]# lsblk

Partition /dev/sdb et sdc

[root@node-seaweed-v0x seaweedfs]# parted -s /dev/sdb mklabel msdos
[root@node-seaweed-v0x seaweedfs]# parted -s /dev/sdc mklabel msdos

[root@node-seaweed-v0x seaweedfs]# parted -s /dev/sdb mkpart primary 1MiB 100%
[root@node-seaweed-v0x seaweedfs]# parted -s /dev/sdc mkpart primary 1MiB 100%

[root@node-seaweed-v0x seaweedfs]# lsblk

Disque /dev/sdb1 (volume01)

[root@node-seaweed-v0x seaweedfs]# pvcreate /dev/sdb1
[root@node-seaweed-v0x seaweedfs]# vgcreate seaweed01 /dev/sdb1
[root@node-seaweed-v0x seaweedfs]# lvcreate -n data01 -l 100%FREE seaweed01
[root@node-seaweed-v0x seaweedfs]# ls /dev/mapper/

Disque /dev/sdc1 (volume02)

[root@node-seaweed-v0x seaweedfs]# pvcreate /dev/sdc1
[root@node-seaweed-v0x seaweedfs]# vgcreate seaweed02 /dev/sdc1
[root@node-seaweed-v0x seaweedfs]# lvcreate -n data02 -l 100%FREE seaweed02
[root@node-seaweed-v0x seaweedfs]# ls /dev/mapper/

Formatage des disques de données

[root@node-seaweed-v0x seaweedfs]# mkfs.ext4 /dev/mapper/seaweed01-data01
[root@node-seaweed-v0x seaweedfs]# mkfs.ext4 /dev/mapper/seaweed02-data02
[root@node-seaweed-v0x seaweedfs]# lsblk

Montage des disques de données

[root@node-seaweed-v0x seaweedfs]# mkdir -p /seaweedfs/Volume01
[root@node-seaweed-v0x seaweedfs]# mkdir -p /seaweedfs/Volume02

[root@node-seaweed-v0x seaweedfs]# echo "/dev/mapper/seaweed01-data01 /seaweedfs/Volume01 ext4 defaults 0 1" >> /etc/fstab
[root@node-seaweed-v0x seaweedfs]# echo "/dev/mapper/seaweed02-data02 /seaweedfs/Volume02 ext4 defaults 0 1" >> /etc/fstab

[root@node-seaweed-v0x seaweedfs]# systemctl daemon-reload
[root@node-seaweed-v0x seaweedfs]# mount /seaweedfs/Volume01
[root@node-seaweed-v0x seaweedfs]# mount /seaweedfs/Volume02
[root@node-seaweed-v0x seaweedfs]# df -h |grep -i sea

Création des services node-seaweed-v01

Sur node-seaweed-v01 – Volume01 (DC1 et Rack1)

[root@node-seaweed-v01 ~]# vi /etc/systemd/system/seaweedvolume01.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc1 -rack=rack1 -dir=/seaweedfs/Volume01 -port=8080 -max=2 -ip=node-seaweed-v01
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.targetWantedBy=multi-user.target

Sur node-seaweed-v01 – Volume02 (DC1 et Rack2)

[root@node-seaweed-v01 ~]# vi /etc/systemd/system/seaweedvolume02.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc1 -rack=rack2 -dir=/seaweedfs/Volume02 -port=8081 -max=2 -ip=node-seaweed-v01
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Démarrage des Volumes de Sur node-seaweed-v01

[root@node-seaweed-v01 ~]# systemctl daemon-reload
[root@node-seaweed-v01 ~]# systemctl enable seaweedvolume01
[root@node-seaweed-v01 ~]# systemctl enable seaweedvolume02

[root@node-seaweed-v01 ~]# systemctl start seaweedvolume01
[root@node-seaweed-v01 ~]# systemctl start seaweedvolume02

[root@node-seaweed-v01 ~]# systemctl status seaweedvolume01

[root@node-seaweed-v01 ~]# systemctl status seaweedvolume02

Vue sur l’interface SeaWeed

Création des services node-seaweed-v02

Sur node-seaweed-v02 – Volume01 (DC2 et Rack1)

[root@node-seaweed-v02 ~]# vi /etc/systemd/system/seaweedvolume01.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc2 -rack=rack1 -dir=/seaweedfs/Volume01 -port=8080 -max=2 -ip=node-seaweed-v02
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Sur node-seaweed-v02 – Volume02 (DC2 et Rack2)

[root@node-seaweed-v02 ~]# vi /etc/systemd/system/seaweedvolume02.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc2 -rack=rack2 -dir=/seaweedfs/Volume02 -port=8081 -max=2 -ip=node-seaweed-v02
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Démarrage des Volumes de Sur node-seaweed-v02

[root@node-seaweed-v02 ~]# systemctl daemon-reload
[root@node-seaweed-v02 ~]# systemctl enable seaweedvolume01
[root@node-seaweed-v02 ~]# systemctl enable seaweedvolume02

[root@node-seaweed-v02 ~]# systemctl start seaweedvolume01
[root@node-seaweed-v02 ~]# systemctl start seaweedvolume02

[root@node-seaweed-v02 ~]# systemctl status seaweedvolume01

[root@node-seaweed-v02 ~]# systemctl status seaweedvolume02

Vue sur l’interface SeaWeed

Création des services node-seaweed-v03

Sur node-seaweed-v03 – Volume01 (DC1 et Rack1)

[root@node-seaweed-v03 ~]# vi /etc/systemd/system/seaweedvolume01.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc1 -rack=rack1 -dir=/seaweedfs/Volume01 -port=8080 -max=2 -ip=node-seaweed-v03
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Sur node-seaweed-v03 – Volume02 (DC1 et Rack2)

[root@node-seaweed-v03 ~]# vi /etc/systemd/system/seaweedvolume02.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc1 -rack=rack2 -dir=/seaweedfs/Volume02 -port=8081 -max=2 -ip=node-seaweed-v03
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Démarrage des Volumes de Sur node-seaweed-v03

[root@node-seaweed-v03 ~]# systemctl daemon-reload
[root@node-seaweed-v03 ~]# systemctl enable seaweedvolume01
[root@node-seaweed-v03 ~]# systemctl enable seaweedvolume02

[root@node-seaweed-v03 ~]# systemctl start seaweedvolume01
[root@node-seaweed-v03 ~]# systemctl start seaweedvolume02

[root@node-seaweed-v03 ~]# systemctl status seaweedvolume01

[root@node-seaweed-v03 ~]# systemctl status seaweedvolume02

Vue sur l’interface SeaWeed

Création des services node-seaweed-v04

Sur node-seaweed-v04 – Volume01 (DC2 et Rack1)

[root@node-seaweed-v04 ~]# vi /etc/systemd/system/seaweedvolume01.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc2 -rack=rack1 -dir=/seaweedfs/Volume01 -port=8080 -max=2 -ip=node-seaweed-v04
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Sur node-seaweed-v04 – Volume02 (DC2 et Rack2)

[root@node-seaweed-v04 ~]# vi /etc/systemd/system/seaweedvolume02.service

[Unit]
Description=SeaweedFS Volume
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=weed volume -mserver=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -dataCenter=dc2 -rack=rack2 -dir=/seaweedfs/Volume02 -port=8081 -max=2 -ip=node-seaweed-v04
WorkingDirectory=/usr/local/bin/
SyslogIdentifier=seaweedfs-volume

[Install]
WantedBy=multi-user.target

Démarrage des Volumes de Sur node-seaweed-v04

[root@node-seaweed-v04 ~]# systemctl daemon-reload
[root@node-seaweed-v04 ~]# systemctl enable seaweedvolume01
[root@node-seaweed-v04 ~]# systemctl enable seaweedvolume02

[root@node-seaweed-v04 ~]# systemctl start seaweedvolume01
[root@node-seaweed-v04 ~]# systemctl start seaweedvolume02

[root@node-seaweed-v04 ~]# systemctl status seaweedvolume01

[root@node-seaweed-v04 ~]# systemctl status seaweedvolume02

Vue sur l’interface SeaWeed

Test d’insertion de données mode block

/home/mobaxterm  curl http://10.100.0.157:9333/dir/assign
{"fid":"1,0171c24b30","url":"node-seaweed-v01:8081","publicUrl":"node-seaweed-v01:8081","count":1}

/home/mobaxterm/MyDocuments curl -F file=@/home/mobaxterm/MyDocuments/CentreonLinux.png http://10.100.0.161:8081/1,0171c24b30
{"name":"CentreonLinux.png","size":108403,"eTag":"e4589d75"}

L’image est disponible sur les 4 nodes du volume

La réplication de l’image est sur l’ID : 1

Sur le node « node-seaweed-v03 » – Volume 01

Sur le node « node-seaweed-v02 » – Volume 01

Sur le node « node-seaweed-v01 » – Volume 02

Views: 2

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *