ctdb node disable windows xcopy break

Kosa Attila atkosa at mithrandir.hu
Wed Sep 7 06:19:08 MDT 2011


Hi,

What did I miss / do wrong? My config didn't work like on the
below linked video:
http://www.samba.org/~tridge/ctdb_movies/node_disable.html

With my config, the copy process fails/breaks despite that the
tesztxp PC successfully maps the other (samba) PC in case the
first (samba) PC is out. In the samba logs (even at log level = 10)
I didn't see any information that can help me solve this problem.

Please help me to find the error in the above config or suggest
one, that actually works.


smb-cluster-1 and smb-cluster-2:
-------------------------------
Debian Squeeze 
linux-image-2.6.32-5-amd64
ctdb 1.10+git20110722-1
glusterfs 3.2.3-1
samba 3.5.6~dfsg-3squeeze5


smb-cluster-1:
-------------
- eth0 - 192.168.100.144 (Bcast:192.168.100.255 Mask:255.255.255.0)
- eth1 - 10.10.10.1 (Bcast:10.10.10.255  Mask:255.255.255.0)
- /dev/sdb1 - ~5 GB, mount /dev/sdb1 /mnt -t ext3
# cat /etc/resolv.conf
domain in.mithrandir.hu
search in.mithrandir.hu
nameserver 192.168.100.2
# cat /etc/hosts
127.0.0.1       localhost
192.168.100.144 smb-cluster-1.in.mithrandir.hu  smb-cluster-1
192.168.100.145 smb-cluster-2.in.mithrandir.hu  smb-cluster-2
192.168.100.144 samba.in.mithrandir.hu  samba
192.168.100.145 samba.in.mithrandir.hu  samba
10.10.10.1      gluster1.in.mithrandir.hu       gluster1
10.10.10.2      gluster2.in.mithrandir.hu       gluster2


smb-cluster-2:
-------------
- eth0 - 192.168.100.145 (Bcast:192.168.100.255 Mask:255.255.255.0)
- eth1 - 10.10.10.2 (Bcast:10.10.10.255  Mask:255.255.255.0)
- /dev/sdb1 - ~5 GB, mount /dev/sdb1 /mnt -t ext3
# cat /etc/resolv.conf
domain in.mithrandir.hu
search in.mithrandir.hu
nameserver 192.168.100.2
# cat /etc/hosts
127.0.0.1       localhost
192.168.100.144 smb-cluster-1.in.mithrandir.hu  smb-cluster-1
192.168.100.145 smb-cluster-2.in.mithrandir.hu  smb-cluster-2
192.168.100.144 samba.in.mithrandir.hu  samba
192.168.100.145 samba.in.mithrandir.hu  samba
10.10.10.1      gluster1.in.mithrandir.hu       gluster1
10.10.10.2      gluster2.in.mithrandir.hu       gluster2


root at smb-cluster-1:~# dig samba.in.mithrandir.hu

; <<>> DiG 9.7.3 <<>> samba.in.mithrandir.hu
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57648
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;samba.in.mithrandir.hu.                IN      A

;; ANSWER SECTION:
samba.in.mithrandir.hu. 5       IN      A       192.168.100.144
samba.in.mithrandir.hu. 5       IN      A       192.168.100.145

;; AUTHORITY SECTION:
in.mithrandir.hu.       5       IN      NS      bastya.in.mithrandir.hu.

;; ADDITIONAL SECTION:
bastya.in.mithrandir.hu. 5      IN      A       192.168.1.254

;; Query time: 2 msec
;; SERVER: 192.168.100.2#53(192.168.100.2)
;; WHEN: Wed Sep  7 10:59:39 2011
;; MSG SIZE  rcvd: 109

root at smb-cluster-2:~# dig samba.in.mithrandir.hu

; <<>> DiG 9.7.3 <<>> samba.in.mithrandir.hu
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55075
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;samba.in.mithrandir.hu.                IN      A

;; ANSWER SECTION:
samba.in.mithrandir.hu. 5       IN      A       192.168.100.145
samba.in.mithrandir.hu. 5       IN      A       192.168.100.144

;; AUTHORITY SECTION:
in.mithrandir.hu.       5       IN      NS      bastya.in.mithrandir.hu.

;; ADDITIONAL SECTION:
bastya.in.mithrandir.hu. 5      IN      A       192.168.1.254

;; Query time: 11 msec
;; SERVER: 192.168.100.2#53(192.168.100.2)
;; WHEN: Wed Sep  7 11:00:50 2011
;; MSG SIZE  rcvd: 109


tesztxp (Windows XP Professional):
-----------------------
- 192.168.100.128 (Mask: 255.255.255.0)


root at smb-cluster-1:~# gluster volume info

Volume Name: SAMBAVOL
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: 10.10.10.1:/mnt
Brick2: 10.10.10.2:/mnt
Options Reconfigured:
nfs.disable: on
auth.allow: 10.10.10.*

root at smb-cluster-1:~# mount -t glusterfs -o log-level=WARNING,log-file=/var/log/glusterfs/samba.log 10.10.10.1:/SAMBAVOL /samba

root at smb-cluster-2:~# mount -t glusterfs -o log-level=WARNING,log-file=/var/log/glusterfs/samba.log 10.10.10.2:/SAMBAVOL /samba

root at smb-cluster-1:~# mkdir /samba/ctdb
root at smb-cluster-1:~# chmod 0770 /samba/ctdb
root at smb-cluster-1:~# mkdir /samba/demo
root at smb-cluster-1:~# mkdir /samba/demo/DATA1 /samba/demo/DATA2
root at smb-cluster-1:~# chmod 0700 /samba/demo
root at smb-cluster-1:~# chmod 0755 /samba/demo/DATA1 /samba/demo/DATA2
root at smb-cluster-1:~# for i in `seq -w 1000` ; do touch /samba/demo/DATA1/$i ; done
root at smb-cluster-1:~# chown demo001 /samba/demo
root at smb-cluster-1:~# chown demo001:demo001 /samba/demo/DATA1 /samba/demo/DATA2
root at smb-cluster-1:~# find /samba/demo/DATA1 -type f -exec chmod 644 {} \;
root at smb-cluster-1:~# find /samba/demo/DATA1 -type f -exec chown 0:0 {} \;


Ctdb config:
-----------
root at smb-cluster-1:~# cat /etc/ctdb/nodes
10.10.10.1
10.10.10.2
root at smb-cluster-1:~# cat /etc/ctdb/natgw_nodes
10.10.10.1/24
10.10.10.2/24
root at smb-cluster-1:~# cat /etc/ctdb/public_addresses
192.168.100.144/24
192.168.100.145/24
root at smb-cluster-1:~# cat /etc/ctdb/static-routes
eth0 0.0.0.0/0 192.168.100.2
root at smb-cluster-1:~# grep -v ^\# /etc/default/ctdb | grep -v ^$
CTDB_RECOVERY_LOCK="/samba/ctdb/ctdb"
CTDB_PUBLIC_INTERFACE=eth0
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
CTDB_MANAGES_SAMBA=yes
CTDB_SAMBA_SKIP_SHARE_CHECK=no
CTDB_SAMBA_CHECK_PORTS="445"
CTDB_MANAGES_WINBIND=yes
CTDB_MANAGES_VSFTPD=no
CTDB_MANAGES_ISCSI=no
CTDB_MANAGES_NFS=no
CTDB_MANAGES_HTTPD=no
CTDB_INIT_STYLE=debian
ulimit -n 30000
CTDB_NODES=/etc/ctdb/nodes
CTDB_NOTIFY_SCRIPT=/etc/ctdb/notify.sh
CTDB_DBDIR=/var/lib/ctdb
CTDB_DBDIR_PERSISTENT=/var/lib/ctdb/persistent
CTDB_EVENT_SCRIPT_DIR=/etc/ctdb/events.d
CTDB_SOCKET=/tmp/ctdb.socket
CTDB_TRANSPORT="tcp"
CTDB_START_AS_DISABLED="no"
CTDB_CAPABILITY_RECMASTER=yes
CTDB_CAPABILITY_LMASTER=yes
CTDB_LOGFILE=/var/log/ctdb/log.ctdb
CTDB_DEBUGLEVEL=ERR
CTDB_SUPPRESS_COREFILE=no
CTDB_SYSLOG=no
CTDB_RUN_TIMEOUT_MONITOR=no
CTDB_MAX_PERSISTENT_CHECK_ERRORS=0

root at smb-cluster-1:~# ctdb status
Number of nodes:2
pnn:0 10.10.10.1       OK (THIS NODE)
pnn:1 10.10.10.2       OK
Generation:1071551548
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:0


Samba config:
------------
root at smb-cluster-1:~# testparm -v < /dev/null
[global]
        dos charset = CP850
        unix charset = UTF-8
        display charset = LOCALE
        workgroup = MUNKACSOPORT
        realm = 
        netbios name = SMB-CLUSTER-1
        netbios aliases = samba
        netbios scope = 
        server string = %h server
        interfaces = 
        bind interfaces only = No
        security = USER
        auth methods = 
        encrypt passwords = Yes
        update encrypted = No
        client schannel = Auto
        server schannel = Auto
        allow trusted domains = Yes
        map to guest = Never
        null passwords = No
        obey pam restrictions = Yes
        password server = *
        smb passwd file = /etc/samba/smbpasswd
        private dir = /samba/samba_tdb
        passdb backend = tdbsam
        algorithmic rid base = 1000
        root directory = 
        guest account = nobody
        enable privileges = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd chat debug = No
        passwd chat timeout = 2
        check password script = 
        username map = 
        password level = 0
        username level = 0
        unix password sync = Yes
        restrict anonymous = 0
        lanman auth = No
        ntlm auth = Yes
        client NTLMv2 auth = No
        client lanman auth = No
        client plaintext auth = No
        preload modules = 
        dedicated keytab file = 
        kerberos method = default
        map untrusted to domain = No
        log level = 10
        syslog = 0
        syslog only = No
        log file = /var/log/samba/log.%m
        max log size = 20000
        debug timestamp = Yes
        debug prefix timestamp = No
        debug hires timestamp = Yes
        debug pid = No
        debug uid = No
        debug class = No
        enable core files = Yes
        smb ports = 445 139
        large readwrite = Yes
        max protocol = NT1
        min protocol = CORE
        min receivefile size = 0
        read raw = Yes
        write raw = Yes
        disable netbios = No
        reset on zero vc = No
        acl compatibility = auto
        defer sharing violations = Yes
        nt pipe support = Yes
        nt status support = Yes
        announce version = 4.9
        announce as = NT
        max mux = 50
        max xmit = 131072
        name resolve order = host lmhosts bcast wins
        max ttl = 259200
        max wins ttl = 518400
        min wins ttl = 21600
        time server = No
        unix extensions = Yes
        use spnego = Yes
        client signing = auto
        server signing = No
        client use spnego = Yes
        client ldap sasl wrapping = plain
        enable asu support = No
        svcctl list = 
        deadtime = 15
        getwd cache = Yes
        keepalive = 300
        lpq cache time = 30
        max smbd processes = 0
        paranoid server security = Yes
        max disk size = 0
        max open files = 16384
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=131072 SO_RCVBUF=131072
        use mmap = No
        hostname lookups = No
        name cache timeout = 660
        ctdbd socket = /tmp/ctdb.socket
        cluster addresses = 192.168.100.144, 192.168.100.145
        clustering = Yes
        ctdb timeout = 0
        load printers = No
        printcap cache time = 750
        printcap name = /etc/printcap
        cups server = 
        cups encrypt = No
        cups connection timeout = 30
        iprint server = 
        disable spoolss = No
        addport command = 
        enumports command = 
        addprinter command = 
        deleteprinter command = 
        show add printer wizard = Yes
        os2 driver map = 
        mangling method = hash2
        mangle prefix = 1
        max stat cache size = 256
        stat cache = Yes
        machine password timeout = 604800
        add user script = 
        rename user script = 
        delete user script = 
        add group script = 
        delete group script = 
        add user to group script = 
        delete user from group script = 
        set primary group script = 
        add machine script = 
        shutdown script = 
        abort shutdown script = 
        username map script = 
        logon script = 
        logon path = \\%N\%U\profile
        logon drive = 
        logon home = \\%N\%U
        domain logons = No
        init logon delayed hosts = 
        init logon delay = 100
        os level = 20
        lm announce = Auto
        lm interval = 60
        preferred master = No
        local master = Yes
        domain master = Auto
        browse list = Yes
        enhanced browsing = Yes
        dns proxy = No
        wins proxy = No
        wins server = 
        wins support = No
        wins hook = 
        kernel oplocks = Yes
        lock spin time = 200
        oplock break wait time = 0
        ldap admin dn = 
        ldap delete dn = No
        ldap group suffix = 
        ldap idmap suffix = 
        ldap machine suffix = 
        ldap passwd sync = no
        ldap replication sleep = 1000
        ldap suffix = 
        ldap ssl = start tls
        ldap ssl ads = No
        ldap deref = auto
        ldap follow referral = Auto
        ldap timeout = 15
        ldap connection timeout = 2
        ldap page size = 1024
        ldap user suffix = 
        ldap debug level = 0
        ldap debug threshold = 10
        eventlog list = 
        add share command = 
        change share command = 
        delete share command = 
        preload = 
        lock directory = /var/run/samba
        state directory = /samba/samba_tdb
        cache directory = /samba/samba_cache
        pid directory = /var/run/samba
        utmp directory = 
        wtmp directory = 
        utmp = No
        default service = 
        message command = 
        get quota command = 
        set quota command = 
        remote announce = 
        remote browse sync = 
        socket address = 0.0.0.0
        nmbd bind explicit broadcast = Yes
        homedir map = auto.home
        afs username map = 
        afs token lifetime = 604800
        log nt token command = 
        time offset = 0
        NIS homedir = No
        registry shares = Yes
        usershare allow guests = No
        usershare max shares = 100
        usershare owner only = Yes
        usershare path = /samba/samba_tdb/usershares
        usershare prefix allow list = 
        usershare prefix deny list = 
        usershare template share = 
        panic action = /usr/share/samba/panic-action %d
        perfcount module = 
        host msdfs = Yes
        passdb expand explicit = No
        idmap backend = tdb2
        idmap alloc backend = 
        idmap cache time = 604800
        idmap negative cache time = 120
        idmap uid = 10000-20000
        idmap gid = 10000-20000
        template homedir = /home/%D/%U
        template shell = /bin/bash
        winbind separator = \
        winbind cache time = 300
        winbind reconnect delay = 30
        winbind enum users = No
        winbind enum groups = No
        winbind use default domain = No
        winbind trusted domains only = No
        winbind nested groups = Yes
        winbind expand groups = 1
        winbind nss info = template
        winbind refresh tickets = No
        winbind offline logon = No
        winbind normalize names = No
        winbind rpc only = No
        create krb5 conf = Yes
        fileid:algorithm = fsname
        groupdb:backend = tdb
        comment = 
        path = 
        username = 
        invalid users = 
        valid users = 
        admin users = 
        read list = 
        write list = 
        printer admin = 
        force user = 
        force group = 
        read only = Yes
        acl check permissions = Yes
        acl group control = No
        acl map full control = Yes
        create mask = 0744
        force create mode = 00
        security mask = 0777
        force security mode = 00
        directory mask = 0755
        force directory mode = 00
        directory security mask = 0777
        force directory security mode = 00
        force unknown acl user = No
        inherit permissions = No
        inherit acls = No
        inherit owner = No
        guest only = No
        administrative share = No
        guest ok = No
        only user = No
        hosts allow = 
        hosts deny = 
        allocation roundup size = 1048576
        aio read size = 16384
        aio write size = 16384
        aio write behind = 
        ea support = Yes
        nt acl support = Yes
        profile acls = No
        map acl inherit = No
        afs share = No
        smb encrypt = auto
        block size = 131072
        change notify = Yes
        directory name cache size = 100
        kernel change notify = Yes
        max connections = 0
        min print space = 0
        strict allocate = No
        strict sync = No
        sync always = No
        use sendfile = No
        write cache size = 262144
        max reported print jobs = 0
        max print jobs = 1000
        printable = No
        printing = bsd
        cups options = 
        print command = lpr -r -P'%p' %s
        lpq command = lpq -P'%p'
        lprm command = lprm -P'%p' %j
        lppause command = 
        lpresume command = 
        queuepause command = 
        queueresume command = 
        printer name = 
        use client driver = No
        default devmode = Yes
        force printername = No
        printjob username = %U
        default case = lower
        case sensitive = Auto
        preserve case = Yes
        short preserve case = Yes
        mangling char = ~
        hide dot files = Yes
        hide special files = No
        hide unreadable = No
        hide unwriteable files = No
        delete veto files = No
        veto files = 
        hide files = 
        veto oplock files = 
        map archive = Yes
        map hidden = No
        map system = No
        map readonly = yes
        mangled names = Yes
        store dos attributes = No
        dmapi support = No
        browseable = Yes
        access based share enum = No
        blocking locks = Yes
        csc policy = manual
        fake oplocks = No
        locking = Yes
        oplocks = Yes
        level2 oplocks = Yes
        oplock contention limit = 2
        posix locking = Yes
        strict locking = Auto
        share modes = Yes
        dfree cache time = 0
        dfree command = 
        copy = 
        preexec = 
        preexec close = No
        postexec = 
        root preexec = 
        root preexec close = No
        root postexec = 
        available = Yes
        volume = 
        fstype = NTFS
        set directory = No
        wide links = No
        follow symlinks = Yes
        dont descend = 
        magic script = 
        magic output = 
        delete readonly = No
        dos filemode = No
        dos filetimes = Yes
        dos filetime resolution = No
        fake directory create times = No
        vfs objects = 
        msdfs root = No
        msdfs proxy = 

[demo]
        path = /samba/demo
        valid users = demo001
        read only = No
        allocation roundup size = 104857600
        vfs objects = fileid

root at smb-cluster-1:~# pdbedit -Lv demo001 -d0
Unix username:        demo001
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-492197969-2239311281-455079153-1000
Primary Group SID:    S-1-5-21-492197969-2239311281-455079153-513
Full Name:            Elso User
Home Directory:       \\smb-cluster-1\demo001
HomeDir Drive:        
Logon Script:         
Profile Path:         \\smb-cluster-1\demo001\profile
Domain:               SMB-CLUSTER-1
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          9223372036854775807 seconds since the Epoch
Kickoff time:         9223372036854775807 seconds since the Epoch
Password last set:    Fri, 26 Aug 2011 09:15:10 CEST
Password can change:  Fri, 26 Aug 2011 09:15:10 CEST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

root at smb-cluster-2:~# pdbedit -Lv demo001 -d0
Unix username:        demo001
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-2892382283-3955325303-665883438-1000
Primary Group SID:    S-1-5-21-2892382283-3955325303-665883438-513
Full Name:            Elso User
Home Directory:       \\smb-cluster-2\demo001
HomeDir Drive:        
Logon Script:         
Profile Path:         \\smb-cluster-2\demo001\profile
Domain:               SMB-CLUSTER-1
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          9223372036854775807 seconds since the Epoch
Kickoff time:         9223372036854775807 seconds since the Epoch
Password last set:    Fri, 26 Aug 2011 09:15:10 CEST
Password can change:  Fri, 26 Aug 2011 09:15:10 CEST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

The demo001 user's password is the same on both computer
(smb-cluster-1 and smb-cluster-2).

tesztxp:
c:\> net use z: \\samba\demo /USER:demo001 /PERSISTENT:YES
The command completed successfully.
c:\> net use
New connections will be remembered.

Status	Local	Remote		Network
----------------------------------------------------------
OK	Z:	\\samba\demo	Microsoft Windows Network
The command completed successfully.
c:\> z:
z:\> dir
 Volume in drive Z is demo
 Volume Serial Number is 213F-0262

 Directory of Z:\

2011.09.07.  10:26      <DIR>        .
2011.09.07.  10:26      <DIR>        ..
2011.09.07.  10:26      <DIR>        DATA2
2011.09.07.  10:28      <DIR>        DATA1
               0 File(s)            0 bytes
               4 Dir(s)  4,861,984,768 bytes free
z:\>

root at smb-cluster-1:~# ctdb status
Number of nodes:2
pnn:0 10.10.10.1       OK (THIS NODE)
pnn:1 10.10.10.2       OK
Generation:1071551548
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:0
root at smb-cluster-1:~# smbstatus -npd0

Samba version 3.5.6
PID     Username      Group         Machine                        
-------------------------------------------------------------------
0:31636   1000          1000          tesztxp      (192.168.100.128)

root at smb-cluster-2:~# ctdb status
Number of nodes:2
pnn:0 10.10.10.1       OK
pnn:1 10.10.10.2       OK (THIS NODE)
Generation:1071551548
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:0


z:\> xcopy /S /E /F /Y /Z DATA1 DATA2 <Enter>
Z:\DATA1\0122 -> Z:\DATA2\0122
Z:\DATA1\0404 -> Z:\DATA2\0404
...

root at smb-cluster-2:~# ctdb disable -n 0
root at smb-cluster-2:~# ctdb status
Number of nodes:2
pnn:0 10.10.10.1       DISABLED
pnn:1 10.10.10.2       OK (THIS NODE)
Generation:1071551548
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:0

root at smb-cluster-2:~# smbstatus -npd0

Samba version 3.5.6
PID     Username      Group         Machine                        
-------------------------------------------------------------------
1:29139   1000          1000          tesztxp      (192.168.100.128)

Z:\DATA1\0119 -> Z:\DATA2\0119
Z:\DATA1\0819 -> Z:\DATA2\0819
155 files copy
z:\> 

-- 
		Cheers,
				    Zsiga


More information about the samba-technical mailing list