0.实验前的环境检查与配置
[student@workstation ~]$ lab ganesha setup
1.配置环境
systemctl stop glusterd停止服务。killall glusterfs关闭进程。killall glusterfsd关闭进程。 yum -y install glusterfs-ganesha安装软件包。serverb参照servera操作。
[root@servera ~]# systemctl stop glusterd
[root@servera ~]# killall glusterfs
[root@servera ~]# killall glusterfsd
[root@servera ~]# yum -y install glusterfs-ganesha
[root@serverb ~]# systemctl stop glusterd
[root@serverb ~]# killall glusterfs
[root@serverb ~]# killall glusterfsd
[root@serverb ~]# yum -y install glusterfs-ganesha
2.配置防火墙
firewall-cmd --add-service放行服务。firewall-cmd --runtime-to-permanent让防火墙配置永久生效。serverb参照servera操作。
[root@servera ~]# firewall-cmd --add-service=high-availability \
> --add-service=nfs \
> --add-service=rpc-bind \
> --add-service=mountd
success
[root@servera ~]# firewall-cmd --runtime-to-permanent
success
[root@serverb ~]# firewall-cmd --add-service=high-availability \
> --add-service=nfs \
> --add-service=rpc-bind \
> --add-service=mountd
success
[root@serverb ~]# firewall-cmd --runtime-to-permanent
success
3.配置Ganesha
cp /etc/ganesha/ganesha-ha.conf{.sample,}从样本创建配置文件。 vim /etc/ganesha/ganesha-ha.conf编辑配置文件。grep -v ^# /etc/ganesha/ganesha-ha.conf查看配置文件。
[root@servera ~]# ll /etc/ganesha/ganesha*
-rw-r--r--. 1 root root 1170 Dec 16 2015 /etc/ganesha/ganesha.conf
-rw-r--r--. 1 root root 867 Feb 8 2016 /etc/ganesha/ganesha-ha.conf.sample
[root@servera ~]# cp /etc/ganesha/ganesha-ha.conf{.sample,}
[root@servera ~]# ll /etc/ganesha/ganesha*
-rw-r--r--. 1 root root 1170 Dec 16 2015 /etc/ganesha/ganesha.conf
-rw-r--r--. 1 root root 867 Jan 29 11:00 /etc/ganesha/ganesha-ha.conf
-rw-r--r--. 1 root root 867 Feb 8 2016 /etc/ganesha/ganesha-ha.conf.sample
[root@servera ~]# vim /etc/ganesha/ganesha-ha.conf
[root@servera ~]# grep -v ^# /etc/ganesha/ganesha-ha.conf
HA_NAME="gls-ganesha"
HA_VOL_SERVER="servera"
HA_CLUSTER_NODES="servera.lab.example.com,serverb.lab.example.com"
VIP_servera_lab_example_com="172.25.250.16"
VIP_serverb_lab_example_com="172.25.250.17"
[root@servera ~]# scp /etc/ganesha/ganesha-ha.conf serverb:/etc/ganesha/
The authenticity of host 'serverb (172.25.250.11)' can't be established.
ECDSA key fingerprint is f3:3a:20:c9:5a:cc:cc:f0:44:f7:00:90:03:18:b1:8d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Perma