방금 MariaDB 설치를 10.2로 업그레이드했습니다.
이제 서비스를 시작하려고 하면 실패했다는 메시지가 나타나고 상태를 확인하면 다음과 같은 다소 이상한 메시지가 표시됩니다.
root@server # systemctl status mariadb
* mariadb.service - MariaDB 10.2.20 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
`-migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Wed 2018-12-26 01:54:50 CET; 9min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 13690 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=127)
Main PID: 10811 (code=exited, status=0/SUCCESS)
CPU: 0
Dec 26 01:54:50 server systemd[1]: Starting MariaDB 10.2.20 database server...
Dec 26 01:54:50 server systemd[1]: mariadb.service: Control process exited, code=exited status=127
Dec 26 01:54:50 server systemd[1]: Failed to start MariaDB 10.2.20 database server.
Dec 26 01:54:50 server systemd[1]: mariadb.service: Unit entered failed state.
Dec 26 01:54:50 server systemd[1]: mariadb.service: Failed with result 'exit-code'.
그런 말은 아니고ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=127)
(mariabd.service 파일을 확인하세요. 부팅 전 및 부팅 후 단계를 루트로 실행하도록 구성되어 있습니다.)상태 코드 127을 반환합니다. 내가 아는 한 이는 명령을 찾을 수 없음을 의미합니다.
루트와 정확히 동일한 명령을 수동으로 실행하면 종료 상태가 0으로 나에게 직접 작동했습니다.
여전히 달리고 mysqld_safe
일하고 mysqld
있습니다. 그러니 문제 없습니다.
고쳐 쓰다:
내 콘텐츠를 요청하면/lib/systemd/system/mariadb.service
#
# /etc/systemd/system/mariadb.service
#
# 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
[Unit]
Description=MariaDB 10.2.20 database server
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target
After=syslog.target
[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
ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld
# 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 environment variable.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
&& systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
# Needed to create system tables etc.
# ExecStartPre=/usr/bin/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
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
ExecStartPost=/etc/mysql/debian-start
# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
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 under [Service] 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=false
##
## 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
LimitNOFILE=16364
# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=
# 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 /usr/sbin/mysqld......
# crash-script equalivent
# FailureAction=
또한 저는 Debian 9를 실행하고 있습니다.
업데이트 2:
내가 한 일은 apt
평범하지 않은 일을 통과한 것뿐이다. 따라서 구성을 제외한 모든 파일은 표준이어야 합니다.
답변1
이런 일이 나에게 일어났습니다. 문제는 systemd가 mariadb.service 구성과 호환되는 버전으로 업데이트되지 않았다는 것입니다. systemd를 241로 업데이트하고 작동하기 시작했습니다.
답변2
나로서는
systemctl daemon-reexec
그 다음에
service mysql start
답변3
나에게 도움이 된 유일한 명령은 aptitude
새 패키지를 설치할 때 필요한 모든 종속성 등을 확인하는 것입니다.
sudo aptitude install mariadb-server
발생할 수 있는 또 다른 문제는 특히 다른 데이터베이스 서버가 설치된 경우 의류가 연결을 차단하는 것입니다. 이 시도:
sudo /etc/init.d/apparmor stop sudo /etc/init.d/apparmor teardown sudo update-rc.d -f apparmor remove
답변4
데이터를 복사하고 mariadb를 다시 설치할 수 있으면 다음을 시도해 볼 수 있습니다.
Debian amd64를 사용한다고 가정합니다.
다운로드https://packages.debian.org/stretch/amd64/libmariadb-dev/downloadapt-get install libmariadb2
후에dpkg -i libmariadb-devxxxxx.deb ./configure --with-tls --with-virtualchroot --with-puredb --with-quotas --with-throttling --with-mysql make install-strip