trove mysql backup failure

asked 2020-08-20 22:09:13 -0600

mr-han gravatar image

updated 2020-08-20 22:18:32 -0600

My environment:

backup_strategy = InnoBackupEx
OpenStack version : Stein

I can take a backup mysql when I use the website image (http://tarballs.openstack.org/trove/images/),

But I can't backup mysql based on Centos7 by manually .

log:

IMPORTANT: Please check that the backup run completes successfully. At the end of a successful backup run innobackupex prints "completed OK!".

200821 03:13:56  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=localhost;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock' as 'os_admin'  (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;host=localhost;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock','os_admin',...) failed: Access denied for user 'os_admin'@'localhost' (using password: YES) at - line 1314.
200821 03:13:56 Connecting to MySQL server host: localhost, user: os_admin, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Failed to connect to MySQL server: Access denied for user 'os_admin'@'localhost' (using password: YES).
 check_process /usr/lib/python2.7/site-packages/trove/guestagent/strategies/backup/mysql_impl.py:94
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.strategies.backup.mysql_impl [-] Innobackupex did not complete successfully.
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent [-] Error saving backup: a5ef8b6c-e662-43be-9c79-97ef90f3df95.: BackupError
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent Traceback (most recent call last):
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent   File "/usr/lib/python2.7/site-packages/trove/guestagent/backup/backupagent.py", line 113, in stream_backup_to_storage
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent     return meta
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent   File "/usr/lib/python2.7/site-packages/trove/guestagent/strategies/backup/base.py", line 96, in __exit__
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent     raise BackupError
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent BackupError
2020-08-21 03:13:56.202 3000 ERROR trove.guestagent.backup.backupagent
2020-08-21 03:13:56.248 3000 INFO trove.guestagent.backup.backupagent [-] Completed backup a5ef8b6c-e662-43be-9c79-97ef90f3df95.
2020-08-21 03:13:56.248 3000 DEBUG trove.conductor.api [-] Making async call to cast update_backup for instance: 772aa954-681b-4176-aec5-7c49459b5d7f update_backup /usr/lib/python2.7/site-packages/trove/conductor/api.py:85
2020-08-21 03:13:56.252 3000 DEBUG trove.guestagent.backup.backupagent [-] Updated state for a5ef8b6c-e662-43be-9c79-97ef90f3df95 to {'backup_id': u'a5ef8b6c-e662-43be-9c79-97ef90f3df95', 'success': True, 'checksum': '7b3e1344d56d3e8fd7ea0efb0fdfb436', 'backup_type': 'InnoBackupEx', 'note': 'Successfully saved data to Swift!', 'state': 'FAILED', 'location': u'http://10.18.140.130:8080/swift/v1/AUTH_9ced828a52e24a9387fc818eb470d28b/database_backups/a5ef8b6c-e662-43be-9c79-97ef90f3df95.xbstream.gz.enc', 'size': 0.1}. stream_backup_to_storage /usr/lib/python2.7/site-packages/trove/guestagent/backup/backupagent.py:127
2020-08-21 03:13:56.265 3000 DEBUG trove.conductor.api [-] Making async call to cast error notification notify_exc_info /usr/lib/python2.7/site-packages/trove/conductor/api.py:115
2020-08-21 03:13:56.268 3000 ERROR oslo_messaging.rpc.server [-] Exception during message handling: BackupError
2020-08-21 03:13:56.268 3000 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2020-08-21 03:13:56.268 3000 ERROR oslo_messaging.rpc.server   File ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2020-08-21 01:53:27 -0600

mr-han gravatar image

updated 2020-08-21 01:55:20 -0600

I have solved the problem ,Because of the crete_user function,Modify the following:

    def _create_admin_user(self, client, password):
        """
        Create a os_admin user with a random password
        with all privileges similar to the root user.
        """
        LOG.debug("Creating Trove admin user '%s'.", ADMIN_USER_NAME)
 #       host = "127.0.01"    
        host = "localhost"    
        try:
            cu = sql_query.CreateUser(ADMIN_USER_NAME, host=host,
                                      clear=password)
            t = text(str(cu))
            client.execute(t, **cu.keyArgs)
        except (exc.OperationalError, exc.InternalError) as err:
            # Ignore, user is already created, just reset the password
            # (user will already exist in a restore from backup)
            LOG.debug(err)
            uu = sql_query.SetPassword(ADMIN_USER_NAME, host=host,
                                       new_password=password)
            t = text(str(uu))
            client.execute(t)

        g = sql_query.Grant(permissions='ALL', user=ADMIN_USER_NAME,
                            host=host, grant_option=True)
        t = text(str(g))
        client.execute(t)
        LOG.debug("Trove admin user '%s' created.", ADMIN_USER_NAME)
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2020-08-20 22:09:13 -0600

Seen: 66 times

Last updated: Aug 21 '20