0.实验前的环境检查与配置
[student@workstation ~]$ lab ctdb setup
1.配置环境
yum install -y samba ctdb安装软件包。firewall-cmd --add-service=samba放行服务。firewall-cmd --add-port=4379/tcp放行端口。 firewall-cmd --runtime-to-permanent使防火墙配置永久有效。 firewall-cmd --list-all查看防火墙配置。serverb参照servera操作。
[root@servera ~]# yum install -y samba ctdb
[root@serverb ~]# yum -y install samba ctdb
[root@servera ~]# firewall-cmd --add-service=samba
success
[root@servera ~]# firewall-cmd --add-port=4379/tcp
success
[root@servera ~]# firewall-cmd --runtime-to-permanent
success
[root@servera ~]# firewall-cmd --list-all
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client glusterfs samba ssh
ports: 4379/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[root@serverb ~]# firewall-cmd --add-service=samba
success
[root@serverb ~]# firewall-cmd --add-port=4379/tcp
success
[root@serverb ~]# firewall-cmd --runtime-to-permanent
success
[root@serverb ~]# firewall-cmd --list-all
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client glusterfs samba ssh
ports: 4379/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
2.配置元数据
gluster volume info ctdbmeta查看存储卷信息。gluster volume stop ctdbmeta停止存储卷。vim /var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh编辑启动后操作脚本中的元数据参数。grep META= /var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh查看修改后的值。vim /var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh关闭前操作脚本中的元数据参数。grep META= /var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh查看修改后的值。 grep '^\[' /etc/samba/smb.conf查看samba配置文件框架(其中global是后面选中修改的区块)。 vim /etc/samba/smb.conf编辑配置文件。grep clustering= /etc/samba/smb.conf参看修改值。serverb参照servera操作。
[root@servera ~]# gluster volume info ctdbmeta
Volume Name: ctdbmeta
Type: Replicate
Volume ID: 749bf115-4750-41e9-9835-f51c6c229492
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
performance.readdir-ahead: on
[root@servera ~]# gluster volume stop ctdbmeta
Stopping volume will make its data inaccessible. D