Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10507

MariaDB 10.1 + wsrep fails to start under systemd post-reboot

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 10.1.16
    • 10.1.17
    • Scripts & Clients
    • None
    • Debian 8

    Description

      After a reboot attempting to start a Galera enabled MariaDB 10.1 fails with an error along these lines:

      WSREP: Failed to start mysqld for wsrep recovery: '2016-08-07  2:25:35 140036048377792 [Note] /usr/sbin/mysqld (mysqld 10.1.16-MariaDB-1~jessie) starting as process 5902 ...
      ...
      2016-08-07  2:25:35 140036048377792 [Note] Server socket created on IP: '0.0.0.0'.
      2016-08-07  2:25:35 140036048377792 [ERROR] Can't start server : Bind on unix socket: No such file or directory
      2016-08-07  2:25:35 140036048377792 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
      2016-08-07  2:25:35 140036048377792 [ERROR] Aborting'
      

      This is caused by a missing /var/run/mysqld/ directory under the /var/run tmpfs. The mariadb.service file includes a ExecStartPre directive to recreate this directory but this action is currently specified after the galera_recovery related directive:

      ...
      ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
      ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \
       systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
      ...
      ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld
      ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
      

      Moving the /var/run/mysqld ExecStartPre directive to before the galera_recovery line resolves this and startup works as expected.

      Attachments

        Issue Links

          Activity

            People

              nirbhay_c Nirbhay Choubey (Inactive)
              andrew.garner Andrew Garner
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.