Base Package Install (All Server)
echo "PS1='\033[1;33m\t \033[1;33m[\u@\H] \033[1;35m\w\033[0;0m\n#'" >> /root/.bashrc . .bashrc rm -f anaconda-ks.cfg yum -y install epel-release # For Physical Server yum -y install htop dmidecode wget screen net-tools perl \ perl-libwww-perl sysstat iftop zip unzip iptstate yum-utils nc lsof net-snmp \ ntp bash-completion curl lsof telnet bzip2 pciutils \ ipmi deltarpm chmod +x /etc/rc.d/rc.local systemctl stop NetworkManager ; systemctl disable NetworkManager yum -y erase NetworkManager ; systemctl stop postfix ;yum -y remove postfix systemctl stop chronyd ; yum -y remove chrony yum -y remove firewalld* # sshd config sed -i '/Defaults requiretty/c #Defaults requiretty' /etc/sudoers sed -i '/#UseDNS yes/c UseDNS no' /etc/ssh/sshd_config systemctl restart sshd # set NTP sed -i '/server 0.centos.pool.ntp.org iburst/c server 202.170.119.19' /etc/ntp.conf sed -i '/server 1.centos.pool.ntp.org iburst/c server 202.170.119.9' /etc/ntp.conf sed -i '/server 2.centos.pool.ntp.org iburst/c server 103.246.188.99' /etc/ntp.conf sed -i '/server 3.centos.pool.ntp.org iburst/c #' /etc/ntp.conf systemctl enable ntpd ; systemctl restart ntpd ; # set SELINUX=permissive setenforce 0 sed -i '/SELINUX=enforcing/c SELINUX=disabled' /etc/sysconfig/selinux sed -i '/SELINUX=enforcing/c SELINUX=disabled' /etc/selinux/config sed -i '/alias rm/d' /root/.bashrc sed -i '/alias cp/d' /root/.bashrc sed -i '/alias mv/d' /root/.bashrc
##
Setup Hostname (All Server)
hostnamectl set-hostname --static lfsmaster
hostnamectl set-hostname --static lfsshadow
hostnamectl set-hostname --static lfs-m001
hostnamectl set-hostname --static lfs-m002
hostnamectl set-hostname --static lfs-m003
echo "10.2.1.11 lfsmaster" >> /etc/hosts
echo "10.2.1.12 lfsshadow" >> /etc/hosts
echo "10.2.1.21 lfs-m001" >> /etc/hosts
echo "10.2.1.22 lfs-m002" >> /etc/hosts
echo "10.2.1.23 lfs-m003" >> /etc/hosts
## in /etc/hosts
10.1.144.101 lfsmaster
10.1.144.102 lfsshadow
10.1.144.111 lfs-m001
10.1.144.112 lfs-m002
10.1.144.113 lfs-m003
##
Setup Master
yum install -y lizardfs-master lizardfs-cgiserv lizardfs-cgi lizardfs-adm
cd /etc/mfs
cp mfsmaster.cfg.dist mfsmaster.cfg
cp mfsexports.cfg.dist mfsexports.cfg
cp mfsgoals.cfg.dist mfsgoals.cfg
cp mfstopology.cfg.dist mfstopology.cfg
cp /var/lib/mfs/metadata.mfs.empty /var/lib/mfs/metadata.mfs
## mfsmaster.cfg
## Create ADMIN_PASSWORD
## PERSONALITY=master
## Change MASTER_HOST
## Save it.
## mfsexports.cfg
## Setup meta Policy only manage host and client host see it
## Setup Directory Permission with IP
## Save it.
## mfsgoals.cfg
## config wanted policy
## Save it.
## mfstopology.cfg
## config for Multi DataCenter / DC DR
## Save it.
systemctl enable lizardfs-master
systemctl start lizardfs-master
systemctl enable lizardfs-cgiserv
systemctl start lizardfs-cgiserv
##
Setup Shadow Server
yum install -y lizardfs-master lizardfs-cgiserv lizardfs-cgi lizardfs-adm
cd /etc/mfs
## copy all data from lfsmaster
scp -Rfp lfsmaster:/etc/mfs/* /etc/mfs/
## mfsmaster.cfg
## PERSONALITY=shadow
## Save it.
systemctl enable lizardfs-master
systemctl start lizardfs-master
##
# Every Chunk Server
yum install -y lizardfs-chunkserver
cd /etc/mfs
cp mfschunkserver.cfg.dist mfschunkserver.cfg
cp mfshdd.cfg.dist mfshdd.cfg
## mfschunkserver.cfg
## LABEL
## MASTER_HOST = lfsmaster
## Save it.
## mfshdd.cfg
## setup HDD mount path
## Save it.
## Create File System for each HDD/SSD
ZFS
https://jason.163-8.com/2020/08/07/zfs-on-centos7/
## and mount with the mfshdd.cfg config
## set permission to disk
chown mfs:mfs /diskx
systemctl enable lizardfs-chunkserver
systemctl start lizardfs-chunkserver
##
# Every Client
yum install -y lizardfs-client
cd /etc/mfs
cp mfsmount.cfg.dist mfsmount.cfg
mkdir /mnt/mfs
## mfsmount.cfg
## mfsmaster=lfsmaster
## /mnt/mfs
## Save it.
# Meta Logger Server
yum install -y lizardfs-metalogger
cd /etc/mfs
cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
## mfsmetalogger.cfg
## MASTER_HOST = lfsmaster
## Save it.
systemctl enable lizardfs-metalogger
systemctl start lizardfs-metalogger
##
# Every Chunk Server (change config)
systemctl reload mfschunkserver
# Show chunkserver list (CLI)
lizardfs-admin list-chunkservers <MASTER> <PORT>
lizardfs-admin list-chunkservers lfsmaster 9421
# List Goals (CLI)
lizardfs-admin list-goals <MASTER> <PORT>
lizardfs-admin list-goals lfsmaster 9421
# Set and show the goal of a file/directory
lizardfs setgoal goal_name object
lizardfs setgoal 3 main_cloud
# Current goal of the file/directory
lizardfs getgoal object
# To show where exactly file chunks are located
lizardfs fileinfo file
# Clients to your LizardFS
yum install -y lizardfs-client
## Set up /etc/hosts for lfsmaster
mkdir /mnt/lizardfs
mfsmount /mnt/lizardfs
# settings for performance on *NIX
mfsmount -o big_writes,nosuid,nodev,noatime /mnt/lizardfs
# Read ahead cache
-o cacheexpirationtime=MSEC
set timeout for read cache entries to be considered
valid in milliseconds (0 disables cache) (default: 0) -o readaheadmaxwindowsize=KB
set max value of read ahead window per single descriptor
in kibibytes (default:
Example:
mfsmount -o cacheexpirationtime=500 -o readaheadmaxwindowsize=4096 mountpoint/
NFS for LizardFS
https://docs.lizardfs.com/adminguide/gateways.html
# LizardFS Manual Pages
https://docs.lizardfs.com/adminguide/manpages.html
https://docs.lizardfs.com/introduction.html
# Poland Team —