Constitution du cluster Master (toujours impair)
- node-seaweed-m04
- node-seaweed-m05
Spécification du node master 04 et master 05
- IP : 10.100.0.170 et 10.100.0.171
- vCPU : 2
- RAM : 2Go
- Disque : 8Go (Système)
- OS : RockyLinux 8
Installation des prérequis
[root@node-seaweed-m0x ~]# dnf update [root@node-seaweed-m0x ~]# yum install git make wget -y [root@node-seaweed-m0x ~]# dnf install dnf-utils
Installation paquet GO
[root@node-seaweed-m0x ~]# wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz [root@node-seaweed-m0x ~]# tar -xzvf go1.21.6.linux-amd64.tar.gz -C /usr/local [root@node-seaweed-m0x ~]# echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile export GOROOT=/usr/local/go [root@node-seaweed-m0x ~]# echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile export PATH=$PATH:/usr/local/go/bin [root@node-seaweed-m0x ~]# source /etc/profile [root@node-seaweed-m0x ~]# go version go version go1.21.6 linux/amd64
Installation paquet seaweedfs
[root@node-seaweed-m0x ~]# git clone https://github.com/chrislusf/seaweedfs.git [root@node-seaweed-m0x ~]# cd ~/seaweedfs [root@node-seaweed-m0x seaweedfs]# make install [root@node-seaweed-m0x seaweedfs]# cp ~/go/bin/weed /usr/local/bin/ [root@node-seaweed-m0x seaweedfs]# weed version version 30GB 3.62 linux amd64
Ajout nouvel host « master » au DNS Infrastructure
Ajout ressource master
[root@node-seaweed-m0x ~]# mkdir /mnt/seaweedfs
Règles Firewall
[root@node-seaweed-m0x ~]#firewall-cmd --remove-service={cockpit,dhcpv6-client} --permanent [root@node-seaweed-m0x ~]#firewall-cmd --add-port={9333,19333}/tcp --permanent [root@node-seaweed-m0x ~]#firewall-cmd --reload [root@node-seaweed-m0x ~]#firewall-cmd --list-all
Sauvegarde du service initiale « seaweedmaster »
[root@node-seaweed-m04 home]# for i in {1..3} ; do ssh -t root@node-seaweed-m0$i "cp /etc/systemd/system/seaweedmaster.service{,_old}";done [root@node-seaweed-m01 ~]# ls -al /etc/systemd/system/seaweedmaster.*
Ajout du master m04 sur les 3 nodes du cluster « Master »
[root@node-seaweed-m04 home]# for i in {1..3} ; do ssh -t root@node-seaweed-m0$i "sed -i 's/node-seaweed-m03\:9333/node-seaweed-m03\:9333,node-seaweed-m04\:9333/g' /etc/systemd/system/seaweedmaster.service";done
Ajout du master m05 sur les 3 nodes du cluster « Master »
[root@node-seaweed-m05 home]# for i in {1..4} ; do ssh -t root@node-seaweed-m0$i "sed -i 's/node-seaweed-m04\:9333/node-seaweed-m04\:9333,node-seaweed-m05\:9333/g' /etc/systemd/system/seaweedmaster.service";done [root@node-seaweed-m05 home]# for i in {1..4} ; do ssh -t root@node-seaweed-m0$i "cat /etc/systemd/system/seaweedmaster.service";done
Création du service « seawedmaster »
Node-seaweed-m04
[root@node-seaweed-m04 home]# scp root@node-seaweed-m01:/etc/systemd/system/seaweedmaster.service /etc/systemd/system/seaweedmaster.service [root@node-seaweed-m04 home]# sed -i 's/ip\=node-seaweed-m01/ip\=node-seaweed-m04/g' /etc/systemd/system/seaweedmaster.service
Node-seaweed-m05
[root@node-seaweed-m05 home]# scp root@node-seaweed-m01:/etc/systemd/system/seaweedmaster.service /etc/systemd/system/seaweedmaster.service [root@node-seaweed-m05 home]# sed -i 's/ip\=node-seaweed-m01/ip\=node-seaweed-m05/g' /etc/systemd/system/seaweedmaster.service
Redémarrage du cluster « master »
[root@node-seaweed-m04 home]# for i in {1..5} ; do ssh -t root@node-seaweed-m0$i "rm -rf /mnt/seaweedfs/*";done [root@node-seaweed-m04 home]# for i in {1..5} ; do ssh -t root@node-seaweed-m0$i "systemctl daemon-reload";done [root@node-seaweed-m04 home]# for i in {1..5} ; do ssh -t root@node-seaweed-m0$i "systemctl restart seaweedmaster";done
Ajout du master m04 sur les nodes du cluster « Volumes »
Les deux services concernés
- /etc/systemd/system/seaweedvolume01.service
- /etc/systemd/system/seaweedvolume02.service
Volume01 de node-seaweed-m04
[root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "sed -i 's/node-seaweed-m03\:9333/node-seaweed-m03\:9333,node-seaweed-m04\:9333/g' /etc/systemd/system/seaweedvolume01.service";done
Volume02 de node-seaweed-m04
[root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "sed -i 's/node-seaweed-m03\:9333/node-seaweed-m03\:9333,node-seaweed-m04\:9333/g' /etc/systemd/system/seaweedvolume02.service";done
Ajout du master m05 sur les nodes du cluster « Volumes »
Les deux services concernés
- /etc/systemd/system/seaweedvolume01.service
- /etc/systemd/system/seaweedvolume02.service
Volume01 de node-seaweed-m05
[root@node-seaweed-m05 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "sed -i 's/node-seaweed-m04\:9333/node-seaweed-m04\:9333,node-seaweed-m05\:9333/g' /etc/systemd/system/seaweedvolume01.service";done
Volume02 de node-seaweed-m05
[root@node-seaweed-m05 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "sed -i 's/node-seaweed-m04\:9333/node-seaweed-m04\:9333,node-seaweed-m05\:9333/g' /etc/systemd/system/seaweedvolume02.service";done
Check Services
[root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "cat /etc/systemd/system/seaweedvolume01.service";done [root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "cat /etc/systemd/system/seaweedvolume02.service";done
Redémarrage du cluster « volumes »
[root@node-seaweed-m04 home]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "systemctl daemon-reload";done [root@node-seaweed-m04 home]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "systemctl restart seaweedvolume01";done [root@node-seaweed-m04 home]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "systemctl restart seaweedvolume02";done
Check status Services
[root@node-seaweed-m0x ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "systemctl status seaweedvolume01";done [root@node-seaweed-m0x ~]# for i in {1..4} ; do ssh -t root@node-seaweed-v0$i "systemctl status seaweedvolume02";done
« node-seaweed-v01 »
« node-seaweed-v02 »
« node-seaweed-v03 »
« node-seaweed-v04 »
Ajout du master m04 sur les 4 nodes du cluster « Filer »
[root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-f0$i "sed -i 's/node-seaweed-m03\:9333/node-seaweed-m03\:9333,node-seaweed-m04\:9333/g' /etc/systemd/system/seaweedfilers.service";done
Ajout du master m05 sur les 4 nodes du cluster « Filer »
[root@node-seaweed-m05 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-f0$i "sed -i 's/node-seaweed-m04\:9333/node-seaweed-m04\:9333,node-seaweed-m05\:9333/g' /etc/systemd/system/seaweedfilers.service";done
Redémarrage du cluster « filers»
[root@node-seaweed-m04 home]# for i in {1..4} ; do ssh -t root@node-seaweed-f0$i "systemctl daemon-reload";done [root@node-seaweed-m04 home]# for i in {1..4} ; do ssh -t root@node-seaweed-f0$i "systemctl restart seaweedfilers.service";done
Check Services
[root@node-seaweed-m04 ~]# for i in {1..4} ; do ssh -t root@node-seaweed-f0$i "systemctl status seaweedfilers.service";done
Views: 3