Отказоустойчивый файловый сервер Samba
Инсталляция Samba
[root@server1 ~]# yum install -y samba && ssh server2 yum install -y samba
[root@server1 ~]# vi /etc/samba/smb.conf
[global]
unix charset = UTF-8
dos charset = cp866
workgroup = localdomain
security = user
hosts allow = 192.168.1.
map to guest = Bad User
[share]
path = /opt/samba
guest ok = yes
read only = no
force user = nobody
[root@server1 ~]# scp /etc/samba/smb.conf server2:/etc/samba/smb.conf
[root@server1 ~]# mkdir -p /opt/samba
[root@server1 ~]# chown -R nobody /opt/samba
[root@server1 ~]# testparm
[root@server1 ~]# ssh server2
[root@server2 ~]# mkdir -p /opt/samba
[root@server2 ~]# chown -R nobody /opt/samba
[root@server1 ~]# vi /etc/ha.d/haresources
server1.localdomain \
drbddisk \
Filesystem::/dev/drbd0::/disk2::ext3 \
IPaddr2::192.168.1.20/32/eth0 \
smbserv
[root@server1 ~]# scp /etc/ha.d/haresources server2:/etc/ha.d/haresources
[root@server1 ~]# vi /etc/ha.d/resource.d/smbserv
#!/bin/sh
case $1 in
start)
start smbd
;;
stop)
stop smbd
;;
esac
exit 0
[root@server1 ~]# chmod +x /etc/ha.d/resource.d/smbserv
[root@server1 ~]# scp /etc/ha.d/resource.d/smbserv server2:/etc/ha.d/resource.d/smbserv
[root@server1 ~]# service heartbeat restart && ssh server2 service heartbeat restart