Constitution du cluster Master
- node-seaweed-m01
- node-seaweed-m02
- node-seaweed-m03
Spécification des 3 Master
- IP : 10.100.0.157 à 10.100.0.159
- vCPU : 2
- RAM : 2Go
- Disque : 8Go (Système)
- OS : RockyLinux 8
Installation des prérequis ( les 3 masters)
[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 ( les 3 masters)
[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 ( les 3 masters)
[root@node-seaweed-m0x ~]# git clone https://github.com/chrislusf/seaweedfs.git [root@node-seaweed-m0x ~]# cd ~/seaweedfs [root@node-seaweed-m0x seaweedfs]# go get -u github.com/google/go-cmp/cmp [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 des Hosts « master » sur le DNS de l’infrastructure
[root@node-seaweed-m0x ~]# for i in {1..3};do nslookup node-seaweed-m0$i;done
Création folder « master » ( les 3 masters)
[root@node-seaweed-m0x ~]# mkdir /mnt/seaweedfs
Régles Firewall ( les 3 masters)
[root@node-seaweed-m0x ~]#firewall-cmd --remove-service={cockpit,dhcpv6-client} --permanent [root@node-seaweed-m0x ~]#firewall-cmd --add-port=9333/tcp --permanent [root@node-seaweed-m0x ~]#firewall-cmd --add-port=19333/tcp --permanent [root@node-seaweed-m0x ~]#firewall-cmd --reload
Lancement du cluster
Sur node-seaweed-m01
[root@node-seaweed-m01 ~]# weed master -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m01 &
Sur node-seaweed-m02
[root@node-seaweed-m02 ~]# weed master -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m02 &
Sur node-seaweed-m03
[root@node-seaweed-m03 ~]# weed master -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m03 &
- http://node-seaweed-m01:9333
Contrôle du HA « Master Leader »
On stop le service du Leader node-seaweed-m01
Sur node-seaweed-m02
Sur node-seaweed-m03
- http://node-seaweed-m02:9333
Type de réplication
Création des services
Sur node-seaweed-m01
[root@node-seaweed-m01 ~]# vi /etc/systemd/system/seaweedmaster.service [Unit] Description=SeaweedFS Master After=network.target [Service] Type=simple User=root Group=root ExecStart=weed master -mdir=/mnt/seaweedfs -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m01 -defaultReplication=110 WorkingDirectory=/usr/local/bin/ SyslogIdentifier=seaweedfs-master [Install] WantedBy=multi-user.target
[root@node-seaweed-m01 ~]# systemctl daemon-reload [root@node-seaweed-m01 ~]# systemctl enable seaweedmaster
Sur node-seaweed-m02
[root@node-seaweed-m02 ~]# vi /etc/systemd/system/seaweedmaster.service [Unit] Description=SeaweedFS Master After=network.target [Service] Type=simple User=root Group=root ExecStart=weed master -mdir=/mnt/seaweedfs -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m02 -defaultReplication=110 WorkingDirectory=/usr/local/bin/ SyslogIdentifier=seaweedfs-master [Install] WantedBy=multi-user.target
[root@node-seaweed-m02 ~]# systemctl daemon-reload [root@node-seaweed-m02 ~]# systemctl enable seaweedmaster
Sur node-seaweed-m03
[root@node-seaweed-m03 ~]# vi /etc/systemd/system/seaweedmaster.service [Unit] Description=SeaweedFS Master After=network.target [Service] Type=simple User=root Group=root ExecStart=weed master -mdir=/mnt/seaweedfs -port=9333 -peers=node-seaweed-m01:9333,node-seaweed-m02:9333,node-seaweed-m03:9333 -ip=node-seaweed-m03 -defaultReplication=110 WorkingDirectory=/usr/local/bin/ SyslogIdentifier=seaweedfs-master [Install] WantedBy=multi-user.target
[root@node-seaweed-m03 ~]# systemctl daemon-reload [root@node-seaweed-m03 ~]# systemctl enable seaweedmaster
Démarrage des services
Sur node-seaweed-m01
[root@node-seaweed-m01 ~]# systemctl start seaweedmaster [root@node-seaweed-m01 ~]# journalctl -u seaweedmaster.service
Sur node-seaweed-m02
[root@node-seaweed-m02 ~]# systemctl start seaweedmaster [root@node-seaweed-m02 ~]# journalctl -u seaweedmaster.service
Sur node-seaweed-m03
[root@node-seaweed-m03 ~]# systemctl start seaweedmaster [root@node-seaweed-m03 ~]# journalctl -u seaweedmaster.service
Views: 4