Maria DB - Après migration 10.5 -> 10.6 - Problème mariadb.socket

a marqué ce sujet comme résolu.

Bonjour à tous, j’ai besoin d’une petite aide SVP.

En suivant à la lettre la doc Doc MariaDB Migration

J’ai migré de 10.5 vers 10.6. Je l’ai fais sur 3 serveurs : 1 Ubuntu 20 (mon Laptop), et sur 2 Debian 10 (2 serveurs de prod, mais ce sont pour des petits projets persos, donc je me suis permis de prendre le risque de migrer vers la 10.6 malgré que cette version est encore en développement, bien qu’elle soit stable depuis quelques jours).

Sous Ubuntu 20, j’ai eu aucun problème, et il y a aucun log d’erreur.

Mais sous Debian 10, j’ai un problème (et j’ai exacte le même problème sur les 2 serveurs) :

Quand je fais sudo service mysql start, j’ai ce message dans mon terminal :

Jul 11 16:24:13 vps-XXX ntpd[555]: bind(21) AF_INET6 fe80::f816:3eff:fee8:2298%2#123 flags 0x11 failed: Cannot assign requested address
Jul 11 16:24:13 vps-XXX ntpd[555]: unable to create socket on eth0 (5) for fe80::f816:3eff:fee8:2298%2#123

(J’ai aussi cette même erreur quand je fais un sudo service mysql stop. Par contre je n’ai pas cette erreur quand je fais un sudo service mysql restart)

Et quand je fais sudo journalctl -p 3 -xb, je vois ces lignes :

Jul 11 16:24:11 vps-XXX ntpd[535]: bind(21) AF_INET6 fe80::f816:3eff:fe6f:b5f0%2#123 flags 0x11 failed: Cannot assign requested address
Jul 11 16:24:11 vps-XXX ntpd[535]: unable to create socket on eth0 (5) for fe80::f816:3eff:fe6f:b5f0%2#123
Jul 11 16:41:58 vps-XXX systemd[1]: mariadb-extra.socket: Socket service mariadb.service already active, refusing.
Jul 11 16:41:58 vps-XXX systemd[1]: Failed to listen on MariaDB 10.6.3 database server (socket activation extra port).

Et aussi ces lignes :

-- The job identifier is 573 and the job result is failed.
Jul 11 16:41:58 vps-XXX systemd[1]: mariadb.socket: Socket service mariadb.service already active, refusing.
Jul 11 16:41:58 vps-XXX systemd[1]: Failed to listen on MariaDB 10.6.3 database server (socket activation).

J’ai pourtant l’impression que mon serveur marche bien. Avez-vous une idée de ce qui a pu provoquer ces erreurs sous mes serveurs Debian 10 ? Et comment puis-je y résoudre ? Dans Google je n’ai pas trouvé.

Merci d’avance.

+0 -0

Manifestement, t’as un problème IPv6 avec ntpd. Et un problème avec MariaDB.

J’analyse juste ça : fe80::f816:3eff:fee8:2298%2#123

fe80::f816:3eff:fee8:2298 :Ça c’est une adresse link-local.

%2 : Ça je comprend pas. Pour une adresse link-local normalement, tu devrais avoir ici l’interface associée. Ici ça devrait être eth0 par 2.

#123 : Le port 123. C’est le port utilisé NTP. (astuce, je les apprends pas par-cœur, je tape juste dans le terminal cat /etc/services | grep -e "\s123/"). Le journal signale que c’est ntpd qui rapporte l’erreur. C’est cohérent. Vérifie que le serveur est à l’heure.

Bref, faudrait regarder sur internet s’il y a un truc lié a NTP dans la dernière version de MariaDB. Et voir si tu n’as pas un problème de configuration de NTP (si tu l’utilises car manifestement, oui).

Je ne connais pas bien MariaDB, j’utilise principalement SQLite dans des situations où un SGBDD est dispropotionné. Bref, j’ai tapé : mariadb-extra.socket et mariadb-extra.

Grosso modo, c’est pour ajouter un socket, juste pour être disponible sur un autre port. Tu n’en as pas forcément besoin. Si tu n’en as pas besoin :

sudo systemctl disable mariadb-extra.socket
+0 -0

Merci pour vos réponses

Hello !

Si tu peux lister les éléments du répertoire /var/run/mysqld/ et les interfaces réseaux ip addr show. Ça sent le conflit réseau.

Yarflam

ls -la /var/run/mysqld/

total 4
drwxr-xr-x  2 mysql root   80 Jul 11 16:52 .
drwxr-xr-x 24 root  root  760 Jul 12 08:31 ..
-rw-rw----  1 mysql mysql   5 Jul 11 16:52 mysqld.pid
srwxrwxrwx  1 mysql mysql   0 Jul 11 16:52 mysqld.sock

ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fa:16:3e:e8:22:98 brd ff:ff:ff:ff:ff:ff
    inet 146.59.233.223/32 brd 146.59.233.223 scope global dynamic eth0
       valid_lft 28086sec preferred_lft 28086sec
    inet6 fe80::f816:3eff:fee8:2298/64 scope link 
       valid_lft forever preferred_lft forever
sudo systemctl disable mariadb-extra.socket

ache

Ça ne change rien, j’ai toujours le même problème lorsque je start MariaDB.

Bon, ton problème de ntp est pas clair. Tu sembles à l’heure.

Pour Mariadb, Il faudrait que tu nous affiches ce qu’il se passe. La configuration des unités de mariadb.

Tu peux l’obtenir comme ça :

$ EDITOR=cat sudo -E systemctl edit --full mariadb.service
$ EDITOR=cat sudo -E systemctl edit --full mariadb-extra.socket
+0 -0

Ok merci.

Y voici :

EDITOR=cat sudo -E systemctl edit —full mariadb.service

# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades.  If you want to customize, the
# best way is to create a file "/etc/systemd/system/mariadb.service",
# containing
#       .include /usr/lib/systemd/system/mariadb.service
#       ...make your changes here...
# or create a file "/etc/systemd/system/mariadb.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file mariadb.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# https://mariadb.com/kb/en/mariadb/systemd/
#
# Copyright notice:
#
# 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.

[Unit]
Description=MariaDB 10.6.3 database server
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target

[Install]
WantedBy=multi-user.target


[Service]

##############################################################################
## Core requirements
##

Type=notify

# Setting this to true can break replication and the Type=notify settings
# See also bind-address mariadbd option.
PrivateNetwork=false

##############################################################################
## Package maintainers
##

User=mysql
Group=mysql

# CAP_IPC_LOCK To allow memlock to be used as non-root user
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0
#   does nothing for non-root, not needed if /etc/shadow is u+r
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason
CapabilityBoundingSet=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE

# PrivateDevices=true implies NoNewPrivileges=true and
# SUID auth_pam_tool suddenly doesn't do setuid anymore
PrivateDevices=false

# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full

# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=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=`cd /usr/bin/..; /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/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION

# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"

ExecStartPost=/etc/mysql/debian-start

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 mariadbd 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

# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
# this is the same value as used in SysV init scripts in the past
# Galera might need a longer timeout, check the KB if you want to change this:
# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout
TimeoutStartSec=900
TimeoutStopSec=900

##
## 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-files-limit
LimitNOFILE=32768

# 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/mariadbd......

# crash-script equalivent
# FailureAction=

Et :

EDITOR=cat sudo -E systemctl edit —full mariadb-extra.socket

[Unit]

Description=MariaDB 10.6.3 database server (socket activation extra port)
Documentation=man:mariadbd(8)
Documentation=https://mariadb.com/kb/en/library/systemd/

[Socket]

Service=mariadb.service

# An "extra" as a descriptor name that means treat these ListenStreams as
# the same as an extra_port.
# Ref: https://mariadb.com/kb/en/thread-pool-system-status-variables/#extra_port

FileDescriptorName=extra

ListenStream=@mariadb-extra
ListenStream=/run/mysqld/mysqld.sock-extra

Pour les distrib Linux, la règle est de d’abord rapporter à la distrib.

Tu ignores les patches éventuels de Debian, ni si elle fournit tout. Si le bug est spécifique à leur installation et connu, ça fait du travail inutile de rapporter chez MariaDB. Pour finir, les mainteneurs Debian connaissent surement ceux de MariaDB, ce sera donc plus facile et rapide pour eux.

+0 -0

En fait, j’ai l’impression que le problème c’est juste que le port de Extra devrait être différent de celui de base.

Je prendrais j’espère le temps de vraiment regarder le problème.

+0 -0
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte