
# mount.glusterfs# mount -o mountproto=tcp,async -t nfs# mount.cifs
# yum install ctdb samba nfs-utils cifs-utilsgluster1, 192.168.122.100gluster2, 192.168.122.101192.168.122.200192.168.122.201; zone file fragmentdata. 86400 IN A 192.168.122.200data. 86400 IN A 192.168.122.201# mount.glusterfs gluster1:smb /mnt/glustersmb# vim /etc/samba/smb.conf[global]clustering = yesidmap backend = tdb2private dir = /mnt/glustersmb/lock[pub]path = /mnt/glustersmb/lockbrowseable = YESforce user = smbcliforce group = smbcliwritable = yesguest ok = yesguest account = smbcliguest only = yes# mkdir /mnt/glustersmb/lock# touch /mnt/glustersmb/lock/lockfile# vim /etc/sysconfig/ctdbCTDB_RECOVERY_LOCK=/mnt/glustersmb/lock/lockfileCTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addressesCTDB_MANAGES_SAMBA=yesCTDB_NODES=/etc/ctdb/nodesCTDB_MANAGES_NFS=yesCTDB_NOTIFY_SCRIPT=/etc/ctdb/notify.sh# vim /etc/ctdb/public_addesses192.168.122.200/24 eth0192.168.122.201/24 eth0# vim /etc/ctdb/nodes192.168.122.100192.168.122.101# vim /etc/sysconfig/iptables-A INPUT -p tcp --dport 4379 -j ctdb-A INPUT -p udp --dport 4379 -j ctdb-A INPUT -p tcp -m multiport --ports 137:139,445 -m comment --comment "SAMBA" -j SMB-A INPUT -p udp -m multiport --ports 137:139,445 -m comment --comment "SAMBA" -j SMB-A INPUT -p tcp -m multiport --ports 111,2049,595:599 -j NFS-A INPUT -p udp -m multiport --ports 111,2049,595:599 -j NFS-A INPUT -p tcp -m tcp --dport 24007:24220 -m comment --comment "Gluster daemon" -j ACCEPT-A INPUT -p tcp -m tcp --dport 38465:38667 -m comment --comment "Gluster daemon(nfs ports)" -j ACCEPT# useradd smbcli# chown -R smbcli.smbcli /mnt/glustersmb/pub# chkconfig smbd off# chkconfig ctdb on# service ctdb start# ctdb statusNumber of nodes:2pnn:0 192.168.122.100 OK (THIS NODE)pnn:1 192.168.122.101 OKGeneration:1112747960Size:2hash:0 lmaster:0hash:1 lmaster:1Recovery mode:NORMAL (0)Recovery master:0# ctdb ipPublic IPs on node 0192.168.122.200 node[1] active[] available[eth0] configured[eth0]192.168.122.201 node[0] active[eth0] available[eth0] configured[eth0]# mount.cifs data:smb /mnt# mount -o mountproto=tcp,async -t nfs data:smb /mntThe host that took over the IP address of the other knows only what they were about old TCP connections and does not know the “TCP squence number” connections. Accordingly, they can not continue. As well as the client, he knows nothing about the fact that connections are now made with another node.
In order to avoid delays associated with switching the connection, the following method is used. To understand this technique, you need to understand the basic principles of the TCP protocol.
The new node, receiving its ip address, sends the client a packet with the ACK flag and the obviously “s / sequence number” equal to zero. In response, the client, in accordance with the rules of the TCP protocol, sends back an ACK Reply packet with the correct “squence number”. Having received the correct "squence number" node forms a packet with the RST flag and this "squence number". Having received it, the client immediately restarts the connection.
Source: https://habr.com/ru/post/194970/
All Articles