Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
764a10a9
Commit
764a10a9
authored
Feb 12, 2019
by
Daniel Black
Committed by
Axel Schwenke
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11670: mariadb@.service remove alias, clean up documentation/order
parent
6e5c2466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
36 deletions
+62
-36
support-files/mariadb@.service.in
support-files/mariadb@.service.in
+62
-36
No files found.
support-files/mariadb@.service.in
View file @
764a10a9
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
#
#
# Use this if you run multiple instances of MariaDB on a single server.
# Use this if you run multiple instances of MariaDB on a single server.
#
#
# This systemd service is not suitable for Galera as specialised SST recovery
# scripts are needed.
#
#
# Copyright notice:
# Copyright notice:
#
#
# This file is free software; you can redistribute it and/or modify it
# This file is free software; you can redistribute it and/or modify it
...
@@ -9,40 +13,25 @@
...
@@ -9,40 +13,25 @@
# the Free Software Foundation; either version 2.1 of the License, or
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
#
# MULTI INSTANCES
# MULTI INSTANCES
#
#
# When multiple instances of MariaDB are running on a server they need to
# When multiple instances of MariaDB are running on a server they need to
# ensure that they don't conflict with each other. This includes elements
# ensure that they don't conflict with each other. This includes elements
# like network ports, sockets and data directories. The systemd environment
# like network ports, sockets and data directories listed under CONFLICTING
# variable MYSQLD_MULTI_INSTANCE controls each instance to ensure it is
# VARIABLES below. The systemd environment variable MYSQLD_MULTI_INSTANCE
# run independently.
# controls each instance to ensure it is run independently. It is passed to
#
# mysqld and mysql_install
# This is not suitable for Galera as specialised SST recovery scripts are
# needed.
#
# Suffix Mechanism (default):
#
# MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=@prefix@
#
# With this option, the [mysqld.{instancename}] group is read from the default
# configuration file.
#
# Command Line Mechanism:
#
# MYSQLD_MULTI_INSTANCE="--socket=/var/run/mysqld/%I.sock \
# --datadir=/var/lib/mysqld-multi/%I \
# --skip-networking"
#
# This is a good way run multiple instance where there is little difference
# in configuration between instances.
#
#
# Configuration File Based Mechanism:
# By default, a group suffix exists andw ithin the default configuration
# files, a group [mysqld.{instancename}] is read for each service. Other
# default groups, like [server.{instancename}] and [mariadb.{instancename}],
# are also read. For each instance, one of the groups will need to contain
# the conflicting variables listed below under CONFLICTING VARIABLES.
#
#
# MYSQLD_MULTI_INSTANCE=@sysconfdir@/my%I.cnf
# The MYSQLD_MULTI_INSTANCE environment used is:
# Environment='MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=@prefix@'
#
#
# Here you need to create a file for each instance. Recommend the systemd
# configuration "ConditionPathExists=@sysconf@/my%I.cnf" at the same time to
# ensure the file exists for the instance before starting.
#
#
# APPLYING YOUR MULTI INSTANCE MECHANISM
# APPLYING YOUR MULTI INSTANCE MECHANISM
#
#
...
@@ -55,18 +44,53 @@
...
@@ -55,18 +44,53 @@
# Include any other settings you which to override. Directives like Exec* are
# Include any other settings you which to override. Directives like Exec* are
# lists and adding a directive will append to the list. You can clear the list
# lists and adding a directive will append to the list. You can clear the list
# by starting with "Directive=" and no value. Follow this by the list that you
# by starting with "Directive=" and no value. Follow this by the list that you
# do want.
# do want.
See the systemd.unit(5) manual page for more information.
#
#
# Then run "systemctl daemon-reload".
# Then run "systemctl daemon-reload".
#
#
# Multi User Based Mechanism
#
# EXAMPLE MYSQLD_MULTI_INSTANCE CONFIGURATIONS
#
# Configuration File Based Mechanism:
#
# This has a configuration file per instance.
#
# [Unit]
# ConditionPathExists=@sysconfdir@/my.%I.cnf
#
# [Service]
# Environment=MYSQLD_MULTI_INSTANCE=--defaults-file=@sysconfdir@/my.%I.cnf
#
# Here you need to create a configuration file @sysconfdir@/my.%I.cnf for each
# instance, each containing the conflicting variables to separate instances.
#
#
# Multi User Based Mechanism:
#
# Here each user (the instance name) has their own mysql instance.
#
#
# Create instances in users home directory with abstract socket:
# Create instances in users home directory with abstract socket:
#
#
# [Service]
# [Service]
# User=%I
# User=%I
# ProtectHome=false
# ProtectHome=false
# Environment=MYSQLD_MULTI_INSTANCE="--defaults-file=/home/%I/my%I.cnf --datadir=/home/%I/mysqldatadir --skip-networking --socket=@mysql-%I"
# ExecStartPre=
# ExecStartPre=@scriptdir@/mysql_install_db $MYSQLD_MULTI_INSTANCE \
# --auth-root-authentication-method=socket --auth-root-socket-user=%I
# Environment=MYSQLD_MULTI_INSTANCE="--defaults-file=/home/%I/my%I.cnf \
# --datadir=/home/%I/mysqldatadir --skip-networking --socket=@mysql-%I"
#
#
# Command Line Mechanism:
#
# This is a good way run multiple instance where there is little difference
# in configuration between instances.
#
# [Service]
# Environment=MYSQLD_MULTI_INSTANCE="--socket=/var/run/mysqld/%I.sock \
# --datadir=/var/lib/mysqld-multi/%I \
# --skip-networking"
#
#
#
# CONFLICTING VARIABLES
# CONFLICTING VARIABLES
#
#
...
@@ -76,6 +100,7 @@
...
@@ -76,6 +100,7 @@
# * port
# * port
# * datadir
# * datadir
#
#
#
# PRE-10.3
# PRE-10.3
#
#
# Before 10.3 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=@sysconf2dir@/my%I.cnf
# Before 10.3 MYSQLD_MULTI_INSTANCE was effectively --defaults-file=@sysconf2dir@/my%I.cnf
...
@@ -84,6 +109,7 @@
...
@@ -84,6 +109,7 @@
# continue a file based multi-instance mysqld, recommend the Configuration File
# continue a file based multi-instance mysqld, recommend the Configuration File
# Based Mechanism above and moving @sysconf2dir@/my%I.cnf files to @sysconfdir@/my%I.cnf.
# Based Mechanism above and moving @sysconf2dir@/my%I.cnf files to @sysconfdir@/my%I.cnf.
#
#
#
# SELINUX
# SELINUX
#
#
# As basic selinux rules are written around a single instance of MariaDB you may need
# As basic selinux rules are written around a single instance of MariaDB you may need
...
@@ -91,10 +117,12 @@
...
@@ -91,10 +117,12 @@
#
#
# See: https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#selinux
# See: https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#selinux
#
#
#
# STARTING
# STARTING
#
#
# Start the instance: systemctl start mariadb@{instancename}.service
# Start the instance: systemctl start mariadb@{instancename}.service
#
#
#
# DOCUMENTATION:
# DOCUMENTATION:
#
#
# Read https://mariadb.com/kb/en/mariadb/systemd/ regarding customisation.
# Read https://mariadb.com/kb/en/mariadb/systemd/ regarding customisation.
...
@@ -108,7 +136,7 @@ Documentation=man:mysqld(8)
...
@@ -108,7 +136,7 @@ Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target
After=network.target
# Negated condition here is because 10.
2
had @sysconf2dir@/my%I.cnf
# Negated condition here is because 10.
3 and before
had @sysconf2dir@/my%I.cnf
# as the configuration difference for multiple instances. This condition here
# as the configuration difference for multiple instances. This condition here
# to prevent an accidental change during an upgrade in the case the user
# to prevent an accidental change during an upgrade in the case the user
# created these file(s).
# created these file(s).
...
@@ -116,14 +144,12 @@ After=network.target
...
@@ -116,14 +144,12 @@ After=network.target
## See Environment=MYSQLD_MULTI_INSTANCE below for current recommended options.
## See Environment=MYSQLD_MULTI_INSTANCE below for current recommended options.
ConditionPathExists=!@sysconf2dir@/my%I.cnf
ConditionPathExists=!@sysconf2dir@/my%I.cnf
[Install]
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
Alias=mysql.service
Alias=mysqld.service
[Service]
[Service]
##############################################################################
##############################################################################
## Core requirements
## Core requirements
##
##
...
@@ -198,12 +224,12 @@ UMask=007
...
@@ -198,12 +224,12 @@ UMask=007
PrivateTmp=false
PrivateTmp=false
# Controlling how multiple instances are separated. See top of this file.
# Controlling how multiple instances are separated. See top of this file.
# Note 1: This service isn't User=mysql b
e
default so we need to be explicit.
# Note 1: This service isn't User=mysql b
y
default so we need to be explicit.
# Note 2: we set --basedir to prevent probes that might trigger SELinux alarms,
# Note 2: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485. Its as an option
# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485. Its as an option
# here as a user may want to use the MYSQLD_MULTI_INSTANCE to run multiple
# here as a user may want to use the MYSQLD_MULTI_INSTANCE to run multiple
# versions.
# versions.
Environment=
MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=@prefix@
Environment=
'MYSQLD_MULTI_INSTANCE=--defaults-group-suffix=.%I --basedir=@prefix@'
# While you can override these, you shouldn't leave them empty as that
# While you can override these, you shouldn't leave them empty as that
# will default to root.
# will default to root.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment