summaryrefslogtreecommitdiff
path: root/ctdb/config
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-scripts: Use nfsconf as a last resort get nfsd thread countMartin Schwenke2020-07-271-0/+3
| | | | | | | | | | | | | | | If nfsconf exists then use it as last resort to attempt to extract [nfsd]:threads from /etc/nfs.conf. Invocation of nfsconf requires "|| true" because this script uses "set -e". Add a stub that always fails to at least test this much. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14444 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Jul 27 07:06:58 UTC 2020 on sn-devel-184
* ctdb-scripts: Use nfsconf as a last resort to set NFS_HOSTNAMEMartin Schwenke2020-07-271-4/+17
| | | | | | | | | If nfsconf exists then use it as last resort to attempt to extract [statd]:name from /etc/nfs.conf. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14444 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Change LVS to use leader/followerMartin Schwenke2020-07-241-6/+6
| | | | | | | | | | | Instead of master/slave. Nearly all of these are simple textual substitutions, which preserve the case of the original. A couple of minor cleanups were made in the documentation (such as "LVSMASTER" -> "LVS leader"). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Change NAT gateway to use leader/followerMartin Schwenke2020-07-241-22/+22
| | | | | | | | | | Instead of master/slave. Nearly all of these are simple textual substitutions, which preserve the case of the original. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: increase TasksMax limit, the systemd default is just 512Ralph Boehme2020-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2015 systemd introduced a TasksMax which limits the number of processes in a unit: https://lists.freedesktop.org/archives/systemd-devel/2015-November/035006.html The default of 512 may be too low in certain situations leading to vfork() failing with errno=EAGAIN when trying to spawn lock-helper processes. With the default for LockProcessesPerDB being 200 the increased TasksMax limit should cover the problematic scenario. Additional background: the failing vfork()s have been seen on production clusters and were tracked down to being logged in the context of ctdb calling tdb_repack(). Links: https://github.com/systemd/systemd/commit/9ded9cd14cc03c67291b10a5c42ce5094ba0912f https://www.suse.com/support/kb/doc/?id=000015901 https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting https://www.percona.com/blog/2019/01/02/tasksmax-another-setting-that-can-cause-mysql-error-messages/ Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed May 13 13:30:12 UTC 2020 on sn-devel-184
* ctdb-scripts: Change CTDB_SERVICE_NMB default value to 'nmb'Anoop C S2020-02-271-1/+1
| | | | | | | | | | | | Till now 50.samba script was based on RHEL versions <=6 where we didn't have separate start up script for nmb and smbd used to start nmbd when required. Now that nmbd has its own start up script named "nmb" it is reasonable to have "nmb" as default value for CTDB_SERVICE_NMB inside new 48.netbios ctdb script. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: add new 48.netbios script for starting nmbdGünther Deschner2020-02-272-19/+64
| | | | | | | | | This change basically moves out nmbd references from 50.samba script to a new 48.netbios script. Accordingly ctdb test scripts are tweaked to cope with newly added script. Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Strip square brackets when gathering connection infoMartin Schwenke2020-01-021-0/+6
| | | | | | | | | | | | | | | | | | ss added square brackets around IPv6 addresses in versions > 4.12.0 via commit aba9c23a6e1cb134840c998df14888dca469a485. CentOS 7 added this feature somewhere mid-release. So, backward compatibility is obviously needed. As per the comment protocol/protocol_util.c should probably print and parse such square brackets. However, for backward compatibility the brackets would have to be stripped in both places in update_tickles()... or added to the ss output when missing. Best to leave this until we have a connection tracking daemon. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14227 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop bit-rotted shellcheck directiveMartin Schwenke2019-09-171-2/+0
| | | | | | | The code has changed so this is no longer needed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Silence shellcheck warning SC2166Martin Schwenke2019-09-173-10/+11
| | | | | | | | | | | | | | | | This covers the following: SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. POSIX agrees that -a and -o should not be used: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html Fixing these doesn't cause much churn. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Remove non-posix -v option to mkdirAmitay Isaacs2019-09-061-1/+1
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Sep 6 11:11:02 UTC 2019 on sn-devel-184
* ctdb-eventscripts: Fix the regression in 01.reclock.scriptAmitay Isaacs2019-09-061-0/+2
| | | | | | | | | Commit ea7708d8c7fa674111ccea58b3cd0757765c702a simplified 01.reclock.script and removed include of functions file which is required for setting CTDB_HELPER_BINDIR and for die() function. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Simplify 01.reclock.scriptMartin Schwenke2019-07-261-35/+21
| | | | | | | | | | | The "init" event is only run once so don't bother caching the configured value of the recovery lock. Add some extra error checking. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Jul 26 04:52:04 UTC 2019 on sn-devel-184
* ctdb-scripts: Drop monitoring of recovery lockMartin Schwenke2019-07-261-28/+0
| | | | | | | The fcntl helper now does a more meaningful check. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-config: depend on /etc/ctdb/nodes fileRafael David Tinoco2019-07-051-0/+1
| | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14017 CTDB should start as a disabled unit (systemd) in most of the distributions and, when trying to enable it for the first time, user should get an unconfigured, or similar, error. Depending on /etc/ctdb/nodes file will give a clear direction to final user on what is needed in order to get cluster up and running. It should work like previous ENABLED=NO variables in SySV like initialization scripts. Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fix tcp_tw_recycle existence checkRafael David Tinoco via samba-technical2019-06-041-2/+2
| | | | | | | | | | | | | | | net.ipv4.tcp_tw_recycle has been removed from Linux 4.12 but, still, makes sense to check its existence. Unfortunately, current check does not test for the procfs file existence. This commit fixes the issue. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13984 Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jun 4 23:31:24 UTC 2019 on sn-devel-184
* ctdb-scripts: Drop script configuration variable CTDB_MONITOR_SWAP_USAGEMartin Schwenke2019-05-071-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CTDB's system memory monitoring in 05.system.script monitors both main memory and swap. The swap monitoring was originally based on the (possibly incorrect, see below) idea that swap space stacks on top of main memory, so that when a system starts filling swap space then this is supposed to be a good sign that the system is running out of memory. Additionally, performance on a Linux system tends to be destroyed by the I/O associated with a lot of swapping to spinning disks. However, some platforms default to creating only 4GB of swap space even when there is 128GB of main memory. With such a small swap to main memory ratio, memory pressure can force swap to be nearly full even when a significant amount of main memory is still available and the system is performing well. This suggests that checking swap utilisation might be less than useful in many circumstances. So, remove the separate swap space checking and change the memory check to cover the total of main memory and swap space. Test function set_mem_usage() still takes an argument for each of main memory and swap space utilisation. For simplicity, the same number is now passed twice to make the intended results comprehensible. This could be changed later. A couple of tests are cleaned up to no longer use hard-coded /proc/meminfo and ps output. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* Revert "ctdb-scripts: Do not "correct" number of nfsd threads when it is 0"Martin Schwenke2019-04-121-4/+2
| | | | | | | | | | | | I thought this was being triggered during automated testing. However, it appears that a poor choice of fixed ports for NFS RPC services was the real problem. Revert, since the original behaviour may be useful. This reverts commit f1a1c300e192d43f5c9faf9450ffbf16341a2661. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Do not "correct" number of nfsd threads when it is 0Martin Schwenke2019-03-311-2/+4
| | | | | | | | | | | | | | While 0 may indicate that all threads have exited after being stuck, it may also indicate that nfsd should not be running due to being shut down. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Sun Mar 31 11:47:44 UTC 2019 on sn-devel-144
* ctdb-scripts: Update statd-callout to try several configuration filesMartin Schwenke2019-03-311-1/+2
| | | | | | | | | | | The alternative seems to be to try something via CTDB_NFS_CALLOUT. That would be complicated and seems like overkill for something this simple. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Allow load_system_config() to take multiple alternativesMartin Schwenke2019-03-311-9/+10
| | | | | | | | | | | | The situation for NFS config has got more complicated and is probably broken in statd-callout on Debian-like systems at the moment. Allow several alternative configuration names to be tried. Stop after the first that is found and loaded. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Default to using systemd services in NFS call-outMartin Schwenke2019-03-311-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Add systemd services to NFS call-outMartin Schwenke2019-03-311-0/+23
| | | | | | | | | | | | At least Red Hat and Debian appear to use (a variant of?) the upstream systemd units for NFS, so adding support for these services is relatively easy. Distributions using Sys-V init can patch the call-out to use the relevant Sys-V init services. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Start NFS quota service if definedMartin Schwenke2019-03-311-0/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Stop/start mount/rquotad/status via NFS call-outMartin Schwenke2019-03-314-6/+88
| | | | | | | | | | | | | | | | When an NFS check restarts a failed service by hand then systemd will be unable to stop or start this service again because (at least) the PID file will be wrong. Do this via the NFS Linux kernel call-out instead. Allow the call-out to use the services instead of doing manual restarts. Add variables for mount, status and rquotad services to support this. Adding systemd NFS services to the call-out will follow. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Factor out nfs_load_config()Martin Schwenke2019-03-311-3/+11
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Add test variable CTDB_NFS_DISTRO_STYLEMartin Schwenke2019-03-311-14/+32
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Rename variable nfslock_service to nfs_lock_serviceMartin Schwenke2019-03-311-11/+11
| | | | | | | | | | There will be more of these variable for other services so, for readability, it makes sense for them to start with "nfs_". BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-scripts: Reindent some functions prior to making changesMartin Schwenke2019-03-311-44/+44
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-config: Change example recovery lock setting to one that failsMartin Schwenke2019-02-251-4/+9
| | | | | | | | | | | | | | | | | | ctdbd will start without a recovery lock configured. It will log a message saying that this is not optimal. However, a careless user may overlook both this message and the importance of setting a recovery lock. If the existing example configuration is uncommented then the directory containing it will be created (by 01.reclock.script) and the failure (i.e. multiple nodes able to take the lock) will be confusing. Instead, change the example setting to one that will result in banned nodes, encouraging users to consciously configure (or deconfigure) the recovery lock. Tweak the corresponding comment. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13790 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Replace md5sum with posix cksumAmitay Isaacs2018-07-281-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Use portable wc -c instead of stat -c "%s"Amitay Isaacs2018-07-281-1/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: date "+%N" is non-portableAmitay Isaacs2018-07-281-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Provide a gstack function if gstack is not availableMartin Schwenke2018-07-111-1/+13
| | | | | | | | | | | gstack isn't widely available, so provide a simple function that does the same thing if it gstack can't be found. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Jul 11 14:47:21 CEST 2018 on sn-devel-144
* ctdb-scripts: Drop event script CTDB_MANAGED_<service> variablesMartin Schwenke2018-07-1110-31/+4
| | | | | | | Enable required event scripts to manage services. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop 99.timeout event scriptMartin Schwenke2018-07-021-25/+0
| | | | | | | This is now implemented in local daemon testing. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Change directory for notifications to events/notificationMartin Schwenke2018-06-052-13/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Event scripts must end with ".script" suffixMartin Schwenke2018-06-0518-0/+0
| | | | | | | | Preparation for recommending configuration for each script next to the actual script. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Move event scripts to events/legacy/ directoryMartin Schwenke2018-06-0521-4/+7
| | | | | | | | This is the initial location that will be used by the new multi-component aware event daemon. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Drop configuration file ctdbd.confMartin Schwenke2018-05-173-122/+1
| | | | | | | | | | | | | Drop function loadconfig(), replacing uses with "load_system_config ctdb". Drop translation of old-style configuration to new configuration file. Drop export of debugging variables. Drop documentation and configuration examples. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu May 17 07:03:04 CEST 2018 on sn-devel-144
* ctdb-config: Add default ctdb.conf fileMartin Schwenke2018-05-171-0/+17
| | | | | | | Install it in RPM. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fetch recovery lock option from config file in 01.reclockMartin Schwenke2018-05-171-0/+18
| | | | | | | | Put it in a function so it is easy to move to common code just in case it is needed somewhere else. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fetch database options from config file in scriptsMartin Schwenke2018-05-173-6/+8
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add function ctdb_get_db_options()Martin Schwenke2018-05-171-0/+37
| | | | | | | | This pulls database options from the configuration file, caches then and makes the values available in scripts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Translate old style options into new configuration fileMartin Schwenke2018-05-171-38/+68
| | | | | | | | | | This allows the relevant command-line options to be removed from the daemon while still leaving the old ctdbd.conf options file in place. It is a temporary measure to enable testing in an old testing environment. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop CTDB_MAX_PERSISTENT_CHECK_ERRORS optionMartin Schwenke2018-05-172-3/+0
| | | | | | | | | | This must harken back to the days of yore when corrupt persistent databases were an issue. We haven't seen this used. If CTDB fails to start due to a corrupt persistent database then this database can be removed by hand. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop CTDB_SUPPRESS_COREFILE and CTDB_MAX_OPEN_FILES optionsMartin Schwenke2018-05-122-17/+0
| | | | | | | | | | These should be done using features provided by the operating system. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Sat May 12 09:13:28 CEST 2018 on sn-devel-144
* ctdb-config: Add default ctdb.sysconfig file, update ctdb.serviceMartin Schwenke2018-05-122-0/+15
| | | | | | | Install ctdb.sysconfig in RPM. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-config: Add a default script.options fileMartin Schwenke2018-05-121-0/+22
| | | | | | | Include it in the RPM. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Use load_script_options() in miscellaneous scriptsMartin Schwenke2018-05-124-4/+4
| | | | | | | | | | | | Some of these just aim to load the generic script.options file while others target more specific files. For NFS configuration, always use 60.nfs.options - even for 06.nfs. This could be carefully documented but will change a lot before release so there is no need. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>