Jcrespo has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/363327 )
Change subject: Update to mariadb 10.1.25, support multi-instance, move unit path ...................................................................... Update to mariadb 10.1.25, support multi-instance, move unit path Bug: T169514 Change-Id: Id065733120595050ba3cf66b712007a101e84ba4 --- M dbtools/control-mariadb-10.1-jessie M dbtools/control-mariadb-10.1-stretch M dbtools/control-mariadb-client-10.1-jessie M dbtools/control-mariadb-client-10.1-stretch M dbtools/mariadb-deb A dbtools/mariadb@.service 6 files changed, 191 insertions(+), 11 deletions(-) Approvals: jenkins-bot: Verified Jcrespo: Looks good to me, approved diff --git a/dbtools/control-mariadb-10.1-jessie b/dbtools/control-mariadb-10.1-jessie index 8680b1b..5323962 100644 --- a/dbtools/control-mariadb-10.1-jessie +++ b/dbtools/control-mariadb-10.1-jessie @@ -1,5 +1,5 @@ Package: wmf-mariadb101 -Version: 10.1.24-1 +Version: 10.1.25-1 Section: misc Priority: optional Architecture: amd64 diff --git a/dbtools/control-mariadb-10.1-stretch b/dbtools/control-mariadb-10.1-stretch index a3fb124..d7affa3 100644 --- a/dbtools/control-mariadb-10.1-stretch +++ b/dbtools/control-mariadb-10.1-stretch @@ -1,5 +1,5 @@ Package: wmf-mariadb101 -Version: 10.1.24-1 +Version: 10.1.25-1 Section: misc Priority: optional Architecture: amd64 diff --git a/dbtools/control-mariadb-client-10.1-jessie b/dbtools/control-mariadb-client-10.1-jessie index 55085fb..862f24d 100644 --- a/dbtools/control-mariadb-client-10.1-jessie +++ b/dbtools/control-mariadb-client-10.1-jessie @@ -1,5 +1,5 @@ Package: wmf-mariadb101-client -Version: 10.1.23-1 +Version: 10.1.25-1 Section: misc Priority: optional Architecture: amd64 diff --git a/dbtools/control-mariadb-client-10.1-stretch b/dbtools/control-mariadb-client-10.1-stretch index dd9d157..e25c712 100644 --- a/dbtools/control-mariadb-client-10.1-stretch +++ b/dbtools/control-mariadb-client-10.1-stretch @@ -1,5 +1,5 @@ Package: wmf-mariadb101-client -Version: 10.1.23-1 +Version: 10.1.25-1 Section: misc Priority: optional Architecture: amd64 diff --git a/dbtools/mariadb-deb b/dbtools/mariadb-deb index e51c8c3..a18587d 100755 --- a/dbtools/mariadb-deb +++ b/dbtools/mariadb-deb @@ -65,8 +65,9 @@ if [[ ! "$(cat /etc/debian_version)" < "9" ]]; then initinstall="/bin/systemctl daemon-reload" initrm="/bin/systemctl daemon-reload" - mkdir -p $makedir/etc/systemd/system - cat $vendor.service | sed "s:BASEDIR:/opt/${optname}/:g" > $makedir/etc/systemd/system/$vendor.service + mkdir -p $makedir/lib/systemd/system + cat $vendor.service | sed "s:BASEDIR:${basedir}/:g" > $makedir/lib/systemd/system/$vendor.service + cat $vendor@.service | sed "s:BASEDIR:${basedir}/:g" > $makedir/lib/systemd/system/$vendor@.service fi postinst="$makedir/DEBIAN/postinst" @@ -79,12 +80,12 @@ echo "removing unneeded files" # suite test -rm -Rf $makedir/opt/$optname/mysql-test +rm -Rf $makedir/$basedir/mysql-test # embebbed mysql & test binaries -rm -f $makedir/opt/$optname/bin/mysql_client_test_embedded -rm -f $makedir/opt/$optname/bin/mysqltest_embedded -rm -f $makedir/opt/$optname/bin/mysql_embedded -rm -f $makedir/opt/$optname/bin/mysql_client_test +rm -f $makedir/$basedir/bin/mysql_client_test_embedded +rm -f $makedir/$basedir/bin/mysqltest_embedded +rm -f $makedir/$basedir/bin/mysql_embedded +rm -f $makedir/$basedir/bin/mysql_client_test # making root the owner diff --git a/dbtools/mariadb@.service b/dbtools/mariadb@.service new file mode 100644 index 0000000..c7e8360 --- /dev/null +++ b/dbtools/mariadb@.service @@ -0,0 +1,179 @@ +# Multi instance version of mariadb. For if you run multiple versions at once. +# Also used for mariadb@bootstrap to bootstrap Galera. +# +# create config file /etc/mysql/mysqld.conf.d/my{instancename}.cnf +# +# start as systemctl start mariadb@{instancename}.server + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Thanks to: +# Daniel Black +# Erkan Yanar +# David Strauss +# and probably others +# Inspired from https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/mysql-init-scripts/files/mysqld_at.service + +# Lightly customized for WMF needs by Jaime Crespo + +[Unit] +Description=MariaDB database server +After=network.target + +ConditionPathExists=/etc/mysql/mysqld.conf.d/%I.cnf + +[Install] +WantedBy=multi-user.target +Alias=mysql.service +Alias=mysqld.service + + +[Service] + +############################################################################## +## Core requirements +## + +Type=notify + +# Setting this to true can break replication and the Type=notify settings +# See also bind-address mysqld option. +PrivateNetwork=false + +############################################################################## +## Package maintainers +## + +User=mysql +Group=mysql + +# To allow memlock to be used as non-root user if set in configuration +CapabilityBoundingSet=CAP_IPC_LOCK + +# Prevent writes to /usr, /boot, and /etc +ProtectSystem=full + +# Doesn't yet work properly with SELinux enabled +NoNewPrivileges=true + +PrivateDevices=true + +# Prevent accessing /home, /root and /run/user +ProtectHome=true + +# Execute pre and post scripts as root, otherwise it does it as User= +PermissionsStartOnly=true + +# WE DISABLE ALL GALERA RELATED FUNCTIONALITY + +# Perform automatic wsrep recovery. When server is started without wsrep, +# galera_recovery simply returns an empty string. In any case, however, +# the script is not expected to return with a non-zero status. +# It is always safe to unset _WSREP_START_POSITION%I environment variable. +# Do not panic if galera_recovery script is not available. (MDEV-10538) +#ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I" + +#ExecStartPre=/bin/sh -c "[ ! -e BASEDIR/bin/galera_recovery ] && VAR= || \ +# VAR=`BASEDIR/bin/galera_recovery --defaults-file=/my%I.cnf`; [ $? -eq 0 ] \ +# && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1" + +# Alternate: (remove ConditionPathExists above) +# use [mysqld.INSTANCENAME] as sections in my.cnf +# +#ExecStartPre=/bin/sh -c "[ ! -e BASEDIR/bin/galera_recovery ] && VAR= || \ +# VAR=`BASEDIR/bin/galera_recovery --defaults-group-suffix=%I`; [ $? -eq 0 ] \ +# && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1" + +# Needed to create system tables etc. +# ExecStartPre=BASEDIR/scripts/mysql_install_db -u mysql + +# Start main service +# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb@.service.d/MY_SPECIAL.conf +# Use the [service] section and Environment="MYSQLD_OPTS=...". +# This isn't a replacement for my.cnf. +# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster + +# Note: Place $MYSQLD_OPTS at the very end for its options to take precedence. + +#ExecStart=BASEDIR/bin/mysqld --defaults-file=/my%I.cnf \ +# $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION%I $MYSQLD_OPTS +# Alternate: (remove ConditionPathExists above) +# use [mysqld.INSTANCENAME] as sections in my.cnf +# + +# IMPORTANT: We assume the main my.cnf includes /etc/mysql/mysqld.conf.d/%I +ExecStart=BASEDIR/bin/mysqld --defaults-group-suffix=%I $MYSQLD_OPTS + +# Unset _WSREP_START_POSITION environment variable. +#ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I" + +KillMode=process +KillSignal=SIGTERM + +# Don't want to see an automated SIGKILL ever +SendSIGKILL=no + +# Restart crashed server only, on-failure would also restart, for example, when +# my.cnf contains unknown option +Restart=on-abort +RestartSec=5s + +UMask=007 + +############################################################################## +## USERs can override +## +## +## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf +## and adding/setting the following will override this file's settings. + +# Useful options not previously available in [mysqld_safe] + +# Kernels like killing mysqld when out of memory because its big. +# Lets temper that preference a little. +# OOMScoreAdjust=-600 + +# Explicitly start with high IO priority +# BlockIOWeight=1000 + +# If you don't use the /tmp directory for SELECT ... OUTFILE and +# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. +PrivateTmp=true + +## +## Options previously available to be set via [mysqld_safe] +## that now needs to be set by systemd config files as mysqld_safe +## isn't executed. +## + + +# Number of files limit. previously [mysqld_safe] open-file-limit +# Please set ulimits on a separate file, in particular the os default +# will not be enough on s3, dbstores and labs (they need ~400 000) +#LimitNOFILE=16364 + +# Maximium core size. previously [mysqld_safe] core-file-size +LimitCore=0 + +# Nice priority. previously [mysqld_safe] nice +# Nice=-5 + +# Timezone. previously [mysqld_safe] timezone +# Environment="TZ=UTC" + +# Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths +# (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD). +# Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD= + +# Flush caches. previously [mysqld_safe] flush-caches=1 +# ExecStartPre=sync +# ExecStartPre=sysctl -q -w vm.drop_caches=3 + +# numa-interleave=1 equalivant +# Change ExecStart=numactl --interleave=all BASEDIR/bin/mysqld...... + +# crash-script equalivent +# FailureAction= -- To view, visit https://gerrit.wikimedia.org/r/363327 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id065733120595050ba3cf66b712007a101e84ba4 Gerrit-PatchSet: 2 Gerrit-Project: operations/software Gerrit-Branch: master Gerrit-Owner: Jcrespo <jcre...@wikimedia.org> Gerrit-Reviewer: Jcrespo <jcre...@wikimedia.org> Gerrit-Reviewer: Marostegui <maroste...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits