/etc/drbd.conf:global {
usage-count yes;
}
common {
syncer {
rate 100M;
al-extents 257;
}
}
resource r0 {
protocol C;
startup {
become-primary-on both; ### For Primary/Primary ###
degr-wfc-timeout 60;
wfc-timeout 30;
}
disk {
on-io-error detach;
}
net {
allow-two-primaries; ### For Primary/Primary ###
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
after-sb-0pri discard-zero-changes;
after-sb-1pri violently-as0p;
after-sb-2pri violently-as0p;
}
on node1 {
device /dev/drbd0;
disk /dev/sda3;
address 192.168.0.11:7788;
meta-disk internal;
}
on node2 {
device /dev/drbd0;
disk /dev/sda3;
address 192.168.0.12:7788;
meta-disk internal;
}
}
ctdb:
/etc/default/ctdb
CTDB_RECOVERY_LOCK="/data/.ctdb/storage" # на drbd-шаре надо создать каталог .ctdb
CTDB_PUBLIC_INTERFACE=eth0
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
CTDB_MANAGES_SAMBA=yes
CTDB_MANAGES_HTTPD=yes
#CTDB_MANAGES_WINBIND=yes
ulimit -n 10000
CTDB_NODES=/etc/ctdb/nodes
CTDB_LOGFILE=/var/log/log.ctdb
CTDB_DEBUGLEVEL=2
CTDB_PUBLIC_NETWORK="192.168.0.0/24"
/etc/ctdb/nodes
192.168.0.11
192.168.0.12
/etc/ctdb/public_addresses
192.168.0.10 eth0
samba:
перенес
/etc/samba
/var/lib/samba
/var/spool/samba
/home
на дрбд шару и симлинками на обе машины
конфиг smb.conf:
[global]
workgroup = CLUSTER
netbios name = CLUSTER1
#passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s
/bin/false %m$
domain logons = No
domain master = No
security = user
clustering = yes
idmap backend = tdb2
private dir=/data/.ctdb
fileid:mapping = fsname
use mmap = no
nt acl support = yes
ea support = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
ocfs2:
после установки запустить dpkg-reconfigure ocfs2-tools
конфиг /etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 192.168.0.11
number = 0
name = node1
cluster = ocfs2
node:
ip_port = 7777
ip_address = 192.168.0.12
number = 1
name = node2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2