mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-427: systemd - use galera_new_cluster instead of bootstrap
Use galera_new_cluster instead. systemctl start mariadb@bootstrap will generate error message, use_galera_new_cluster.conf is the name of the file that will generate this error. Output: Job for mariadb@bootstrap.service failed. See "systemctl status mariadb@bootstrap.service" and "journalctl -xe" for details. ● mariadb@bootstrap.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb@.service; disabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/mariadb@bootstrap.service.d └─use_galera_new_cluster.conf Active: failed (Result: exit-code) since Thu 2015-10-15 19:27:52 CEST; 5s ago Process: 24334 ExecStart=/usr/bin/false (code=exited, status=1/FAILURE) Process: 24330 ExecStart=/usr/bin/echo Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster (code=exited, status=0/SUCCESS) Main PID: 24334 (code=exited, status=1/FAILURE) Oct 15 19:27:52 spaceman systemd[1]: Starting MariaDB database server... Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service: main process exited, code=exited, status=1/FAILURE Oct 15 19:27:52 spaceman systemd[1]: Failed to start MariaDB database server. Oct 15 19:27:52 spaceman systemd[1]: Unit mariadb@bootstrap.service entered failed state. Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service failed.
This commit is contained in:
parent
7877438f31
commit
a2c3549404
7 changed files with 47 additions and 24 deletions
|
@ -55,11 +55,12 @@ MACRO(CHECK_SYSTEMD)
|
|||
IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
|
||||
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
|
||||
ADD_DEFINITIONS(-DHAVE_SYSTEMD)
|
||||
SET(SYSTEMD_SCRIPTS mariadb-service-convert)
|
||||
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster)
|
||||
SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert
|
||||
usr/bin/galera_new_cluster
|
||||
${INSTALL_SYSTEMD_UNITDIR}/mariadb.service
|
||||
${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service
|
||||
${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/wsrep-new-cluster.conf")
|
||||
${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf")
|
||||
IF(DEB)
|
||||
SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
|
||||
SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start")
|
||||
|
|
14
scripts/galera_new_cluster.sh
Executable file
14
scripts/galera_new_cluster.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# 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.
|
||||
|
||||
VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@"
|
||||
COMPILATION_COMMENT="@COMPILATION_COMMENT@"
|
||||
|
||||
/usr/bin/systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
|
||||
/usr/bin/systemctl start {1:-mariadb@service}
|
||||
|
||||
/usr/bin/systemctl set-environment _WSREP_NEW_CLUSTER=''
|
|
@ -79,10 +79,10 @@ IF(UNIX)
|
|||
IF(HAVE_SYSTEMD)
|
||||
CONFIGURE_FILE(mariadb.service.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service @ONLY)
|
||||
IF(NOT RPM)
|
||||
IF(CMAKE_VERSION VERSION_LESS 3.3.0)
|
||||
CONFIGURE_FILE(mariadb@.service.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service @ONLY)
|
||||
INSTALL(FILES wsrep-new-cluster.conf
|
||||
INSTALL(FILES use_galera_new_cluster.conf
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service
|
||||
DESTINATION ${inst_location}/systemd COMPONENT SupportFiles)
|
||||
|
@ -90,8 +90,8 @@ IF(UNIX)
|
|||
IF(INSTALL_SYSTEMD_UNITDIR)
|
||||
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
|
||||
# http://public.kitware.com/Bug/view.php?id=14782
|
||||
IF(NOT RPM)
|
||||
INSTALL(FILES wsrep-new-cluster.conf
|
||||
IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM)
|
||||
INSTALL(FILES use_galera_new_cluster.conf
|
||||
DESTINATION
|
||||
"${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d"
|
||||
COMPONENT Server)
|
||||
|
|
|
@ -52,8 +52,9 @@ PermissionsStartOnly=true
|
|||
# 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
|
||||
@SYSTEMD_EXECSTARTPRE@
|
||||
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS
|
||||
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
|
||||
@SYSTEMD_EXECSTARTPOST@
|
||||
|
||||
KillMode=process
|
||||
|
|
|
@ -59,9 +59,10 @@ PermissionsStartOnly=true
|
|||
# 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
|
||||
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf
|
||||
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf
|
||||
# Alternate: (remove ConditionPathExists above)
|
||||
# use [mysqld.INSTANCENAME] as sections in my.cnf
|
||||
#
|
||||
|
|
22
support-files/use_galera_new_cluster.conf
Normal file
22
support-files/use_galera_new_cluster.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# Install as /etc/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf
|
||||
#
|
||||
# MariaDB uses /usr/bin/galera_new_cluster
|
||||
#
|
||||
# This is here to help guide people that may have used Percona mysql@bootstrap
|
||||
# to the correct implementation.
|
||||
|
||||
[Unit]
|
||||
|
||||
ConditionPathExists=
|
||||
|
||||
[Service]
|
||||
|
||||
Type=oneshot
|
||||
Restart=no
|
||||
|
||||
# Override the multi instance service for a bootstrap start instance
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/echo "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
|
||||
ExecStart=/usr/bin/false
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#
|
||||
# Install as /etc/systemd/system/mariadb@bootstrap.service.d/wsrep-new-cluster.conf
|
||||
#
|
||||
# This uses the multi instance version as a base.
|
||||
#
|
||||
|
||||
[Unit]
|
||||
|
||||
ConditionPathExists=
|
||||
|
||||
[Service]
|
||||
|
||||
# Override the multi instance service for a bootstrap start instance
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --wsrep-new-cluster
|
||||
|
Loading…
Reference in a new issue