Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task [mariadb : Start MariaDB Service] fails on Centos7 vm #214

Open
Sebbenbear opened this issue Nov 27, 2017 · 6 comments
Open

Task [mariadb : Start MariaDB Service] fails on Centos7 vm #214

Sebbenbear opened this issue Nov 27, 2017 · 6 comments

Comments

@Sebbenbear
Copy link

States the control process exits with an error code, and suggests running "systemctl status mariadb.service" and "journalctl -xe". However, there are no entries in journalctl and systemctl just has (Result: exit-code) instead of a way to debug the issue.

@jpollardRH
Copy link

Had a quick look, this is because the install for mariadb uses the old log file location which SELinux labelling doesn't like. Will update config file to use mariadb default log location (/var/log/mariadb/mariadb.log)

jpollardRH added a commit to jpollardRH/ansible-examples that referenced this issue Feb 28, 2018
@sumitsu25
Copy link

I have tried changing the log file location but still the issue is not resolved, mariadb is not able to start

@sumitsu25
Copy link

TASK [mariadb : Start MariaDB Service] *****************************************************************************************************
fatal: [node1]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to start service mariadb: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.\n"}
to retry, use: --limit @/root/github/ansible-examples/wordpress-nginx_rhel7/site.retry

@jpollardRH
Copy link

@sumitsu25 did you try from a new VM? If retrying on the same instance, you may need to remove mariadb/mysql packages to try again.

@scheerchrs
Copy link

Good concise answer JP. Recreate to node from scratch and if duplicated, examine GIT or SubV json files for change dates and who. Back one code revision and see if all good. Then smack the developer on the forhead. :-)

@MegandM
Copy link

MegandM commented Apr 10, 2020

Hi everyone!

This worked for me.

First, make sure the following variables are set (my.cnf):

[mysqld_safe]
log-error                      = /var/log/mariadb/mariadb.log
pid-file                       = /var/run/mariadb/mariadb.pid

[mysqld]
socket                         = /var/lib/mysql/mysql.sock
datadir                        = /var/lib/mysql

Before re-starting MariaDB Server and after modifying datadir, make sure datadir is empty.

Steps for unistalling and re-starting MariaDB Server are the followings (you'll need to be root user):

  1. yum remove mariadb mariadb-server
  2. rm -rf <datadir> (for the example above: /var/lib/mysql)
  3. rm /etc/my.cnf
  4. yum install mariadb mariadb-server
  5. service mariadb start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants