cinder install fails at mysql Create Database

asked 2019-04-07 08:12:35 -0500

ARatcliff gravatar image

updated 2019-04-07 14:33:52 -0500

After deploying Rocky, I was surprised to find no volume service. Why is that?
I found the installation instructions https://docs.openstack.org/cinder/rocky/install/index.html (https://docs.openstack.org/cinder/roc...)
But I failed at the first step:

$ mysql -u root -p
-bash: mysql: command not found

i installed mysql, and then failed at the second step:

MariaDB [(none)]> CREATE DATABASE cinder;
ERROR 1006 (HY000): Can't create database 'cinder' (errno: 13 "Permission denied")

What am I doing wrong here? Thanks in advance.

MariaDB [(none)]> status
--------------
mysql  Ver 15.1 Distrib 10.1.20-MariaDB, for Linux (x86_64) using  EditLine wrapper

Connection id:          24178
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.1.20-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 4 days 14 hours 48 min 24 sec

Threads: 96  Questions: 14193012  Slow queries: 0  Opens: 399  Flush tables: 1  Open tables: 393  Queries per second avg: 35.580
--------------


MariaDB [(none)]> show grants for 'root'@'%';     
+--------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@%                                                                                                              |
+--------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*2D740E91859FA2915B803D2C28098923676C63B9' WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

After Bernd Bauch comment I followed the procedure to install mariadb but the service doesn't start. Here is the output:

[stack@controller ~]$ sudo systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[stack@controller ~]$ sudo systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[stack@controller ~]$ sudo systemctl status mariadb.service
● mariadb.service - MariaDB 10.1 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-04-07 19:20:45 UTC; 28s ago
  Process: 863969 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=0/SUCCESS)
  Process: 863843 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)
  Process: 863807 ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n (code=exited, status=0/SUCCESS)
  Process: 863783 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 863843 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Apr 07 19:20:44 controller.mycloud.mycompany.com systemd[1]: Starting MariaDB 10.1 database server...
Apr 07 19:20:44 controller.mycloud.mycompany.com mysql-check-socket[863783]: Socket file /var/lib/mysql/mysql.sock exists.
Apr 07 19:20:44 controller.mycloud.mycompany.com mysql-check-socket[863783]: No process is using /var/lib/mysql/mysql.sock, which means it is a garbage, so it will be removed automatically.
Apr 07 19:20:44 controller.mycloud.mycompany.com mysql-prepare-db-dir[863807]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Apr 07 19:20:44 controller.mycloud.mycompany.com mysql-prepare-db-dir[863807]: If this ...
(more)
edit retag flag offensive close merge delete

Comments

On which server do you run the mysql command? It must be the controller, and since you installed Keystone, Glance, Neutron and Nova already, the mysql command must exist on the controller.

Did you complete the steps at https://docs.openstack.org/install-gu... ?

Bernd Bausch gravatar imageBernd Bausch ( 2019-04-07 10:17:44 -0500 )edit

@Bernd Bausch Yes the controller. As you say Keystone, Glance, etc. are up already. Starting the service fails probably because the controller has a database running?

mysql-prepare-db-dir[863807]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
ARatcliff gravatar imageARatcliff ( 2019-04-07 14:25:30 -0500 )edit

@moderator I can't edit the question anymore - there is no need for the mariadb service start logs.

ARatcliff gravatar imageARatcliff ( 2019-04-07 15:07:47 -0500 )edit

I don't know what's wrong with your database service, but it is strange that the mysql client was missing although you were able to set up the other OpenStack components. Something must have happened between the Nova (or Neutron?) and Cinder setup.

Bernd Bausch gravatar imageBernd Bausch ( 2019-04-07 18:38:47 -0500 )edit

You could try MySQL safe mode to re-enable root access, but I would at least try to find out how the root privileges were lost. Perhaps you find something in the MySQL or bash command histories?

Bernd Bausch gravatar imageBernd Bausch ( 2019-04-07 18:45:10 -0500 )edit