sudo fdisk /dev/sdx1
d # delete existing partitions
g # make gpt
n # make new partition
w # write
sudo pvcreate --dataalignment 256K /dev/sdx1
This documentation details installing gluster and creating a new brick.
sudo dnf install -y centos-release-gluster11 centos-release-nfs-ganesha4
# Recommended for package stability:
# sudo sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Gluster-11.repo
# sudo sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-NFS-Ganesha-4.repo
sudo dnf install -y --enablerepo=centos-nfs-ganesha-4 --enablerepo=devel \
glusterfs glusterfs-libs glusterfs-server glusterfs-client nfs-ganesha-gluster nfs-ganesha
NFS_CORE_PARAM {
mount_path_pseudo = true;
Protocols = 3,4;
}
EXPORT_DEFAULTS {
Access_Type = RW;
}
EXPORT
{
Export_Id = 1;
Path = "/bulk";
FSAL {
name = GLUSTER;
hostname = "10.0.8.254";
volume = "glass_bulk";
}
Squash = No_root_squash;
Pseudo = "/bulk";
SecType = "sys";
}
EXPORT
{
Export_Id = 2;
Path = "/cfg";
FSAL {
name = GLUSTER;
hostname = "10.0.8.254";
volume = "glass_cfg";
}
Squash = No_root_squash;
Pseudo = "/cfg";
SecType = "sys";
}
LOG {
Default_Log_Level = WARN;
}
sudo firewall-cmd --zone=public --add-service=glusterfs --permanent
sudo firewall-cmd --zone=public --add-service=nfs --permanent
sudo firewall-cmd --reload
sudo systemctl enable glusterd --now
sudo systemctl disable nfs-server --now
sudo systemctl enable nfs-ganesha --now
# from an existing node
sudo gluster peer probe <hostname>
sudo mkdir -p /mnt/replicated /mnt/bulk
sudo chattr +i /mnt/replicated /mnt/bulk
echo "localhost:/glass_cfg /mnt/replicated glusterfs defaults,_netdev,x-systemd.requires=glusterd.service,x-systemd.automount 0 0" | sudo tee -a /etc/fstab
echo "localhost:/glass_bulk /mnt/bulk glusterfs defaults,_netdev,x-systemd.requires=glusterd.service,x-systemd.automount 0 0" | sudo tee -a /etc/fstab
thin_pool_autoextend_threshold = 70
sudo sed -i 's/# thin_pool_autoextend_threshold = 70$/thin_pool_autoextend_threshold = 70/' /etc/lvm/lvm.conf
This converts /dev/sdx into a brick named gluster5. The resulting brick can be combined with other bricks to form a gluster volume.
dd if=/dev/zero of=/dev/sdx bs=1k count=1
sudo vgcreate gluster5 /dev/sdx1
sudo lvcreate --thinpool gluster5/thin_pool --size 1T --chunksize 256K --poolmetadatasize 16G --zero n
sudo lvcreate -V 1G -T gluster5/thin_pool -n brickvol
sudo lvextend /dev/gluster5/brickvol /dev/sdx1
sudo mkfs.xfs -i size=512 -n size=8192 /dev/gluster5/brickvol
echo "/dev/mapper/gluster5-brickvol /data/glusterfs/glass5 xfs rw,inode64,noatime,nouuid 1 2" | sudo tee -a /etc/fstab
sudo mount -a
sudo mkdir -p /data/glusterfs/glass5/brick5