mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
merged vsftpd event script from ronnie
(This used to be ctdb commit c0b686c43524c6a93c52d85b0079ed820983133e)
This commit is contained in:
commit
b130540102
45
ctdb/config/events.d/40.vsftpd
Executable file
45
ctdb/config/events.d/40.vsftpd
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
# event strict to manage vsftpd in a cluster environment
|
||||
|
||||
. /etc/ctdb/functions
|
||||
loadconfig vsftpd
|
||||
|
||||
[ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
|
||||
|
||||
cmd="$1"
|
||||
shift
|
||||
|
||||
case $cmd in
|
||||
startup)
|
||||
/bin/mkdir -p /etc/ctdb/state/vsftpd
|
||||
|
||||
# make sure the service is stopped first
|
||||
service vsftpd stop > /dev/null 2>&1
|
||||
service vsftpd start
|
||||
;;
|
||||
|
||||
shutdown)
|
||||
service vsftpd stop
|
||||
;;
|
||||
|
||||
takeip)
|
||||
echo "restart" >> /etc/ctdb/state/vsftpd/restart
|
||||
;;
|
||||
|
||||
releaseip)
|
||||
echo "restart" >> /etc/ctdb/state/vsftpd/restart
|
||||
;;
|
||||
|
||||
recovered)
|
||||
# if we have taken or released any ips we must
|
||||
# restart vsftpd to ensure that all tcp connections are reset
|
||||
[ -f /etc/ctdb/state/vsftpd/restart ] && {
|
||||
service vsftpd stop > /dev/null 2>&1
|
||||
service vsftpd start
|
||||
} >/dev/null 2>&1
|
||||
|
||||
/bin/rm -f /etc/ctdb/state/vsftpd/restart
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -4,7 +4,7 @@
|
||||
. /etc/ctdb/functions
|
||||
loadconfig nfs
|
||||
|
||||
[ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
|
||||
[ "$CTDB_MANAGES_NFSLOCK" = "yes" ] || exit 0
|
||||
|
||||
[ -z "$STATD_SHARED_DIRECTORY" ] && exit 0
|
||||
|
||||
|
@ -94,6 +94,7 @@ fi
|
||||
%{_sysconfdir}/ctdb/events
|
||||
%{_sysconfdir}/ctdb/functions
|
||||
%{_sysconfdir}/ctdb/events.d/10.interface
|
||||
%{_sysconfdir}/ctdb/events.d/40.vsftpd
|
||||
%{_sysconfdir}/ctdb/events.d/50.samba
|
||||
%{_sysconfdir}/ctdb/events.d/59.nfslock
|
||||
%{_sysconfdir}/ctdb/events.d/60.nfs
|
||||
|
@ -355,6 +355,17 @@ static int control_ip(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if(options.machinereadable){
|
||||
printf(":Public IP:Node:\n");
|
||||
for(i=0;i<ips->num;i++){
|
||||
printf(":%s:%d:\n",
|
||||
inet_ntoa(ips->ips[i].sin.sin_addr),
|
||||
ips->ips[i].takeover_vnn);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
printf("Number of nodes:%d\n", ips->num);
|
||||
for(i=0;i<ips->num;i++){
|
||||
printf("%-16s %d\n",
|
||||
|
@ -81,6 +81,19 @@ databases are consistent. Recovery typically takes between 1 and 3
|
||||
seconds. During the recovery period the databases are 'frozen', and
|
||||
all IO operations by ctdb clients are suspended.
|
||||
|
||||
<h3>Is CTDB a HA solution?</h3>
|
||||
Yes and no.<br>
|
||||
CTDB alone is not a HA solution, but when you combine CTDB with a clustered
|
||||
filesystem it becomes one.<br>
|
||||
CTDB is primarily developed around the concept of having a shared cluster
|
||||
filesystem shared across all the nodes in the cluster to provide the features
|
||||
required for building a NAS cluster.<br>
|
||||
Thus CTDB relies on an external component (the cluster filesystem) to provide
|
||||
the mechanisms for avoiding split-brain and other difficult tasks.<br><br>
|
||||
However, If you applications do need a clustered filesystem for all the nodes,
|
||||
in that scenario CTDB will provide a very easy to install and manage
|
||||
solution for your clustering HA needs.
|
||||
|
||||
<h3>IP Takeover</h3>
|
||||
|
||||
When a node in a cluster fails, CTDB will arrange that a different
|
||||
|
Loading…
Reference in New Issue
Block a user