Merge "Fix backup of mysql variants on Centos"
This commit is contained in:
commit
c1fd3e3a4c
@ -22,7 +22,8 @@
|
||||
"open_files_limit": 512,
|
||||
"performance_schema": "ON",
|
||||
"pid_file": "/var/run/mysqld/mysqld.pid",
|
||||
"port": 3306,
|
||||
"socket": "/var/run/mysqld/mysqld.sock",
|
||||
"port": "3306",
|
||||
"query_cache_limit": "1M",
|
||||
"query_cache_size": "8M",
|
||||
"query_cache_type": 1,
|
||||
|
@ -0,0 +1,5 @@
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Content-Length: 1151
|
||||
Date: Mon, 18 Mar 2013 19:09:17 GMT
|
||||
|
@ -49,11 +49,18 @@ class InnoBackupEx(base.BackupRunner):
|
||||
"""Implementation of Backup Strategy for InnoBackupEx."""
|
||||
__strategy_name__ = 'innobackupex'
|
||||
|
||||
@property
|
||||
def user_and_pass(self):
|
||||
return (' --user=%(user)s --password=%(password)s ' %
|
||||
{'user': ADMIN_USER_NAME,
|
||||
'password': MySqlApp.get_auth_password()})
|
||||
|
||||
@property
|
||||
def cmd(self):
|
||||
cmd = ('sudo innobackupex'
|
||||
' --stream=xbstream'
|
||||
' %(extra_opts)s ' +
|
||||
self.user_and_pass +
|
||||
MySqlApp.get_data_dir() +
|
||||
' 2>/tmp/innobackupex.log'
|
||||
)
|
||||
@ -109,6 +116,7 @@ class InnoBackupExIncremental(InnoBackupEx):
|
||||
' --incremental'
|
||||
' --incremental-lsn=%(lsn)s'
|
||||
' %(extra_opts)s ' +
|
||||
self.user_and_pass +
|
||||
MySqlApp.get_data_dir() +
|
||||
' 2>/tmp/innobackupex.log')
|
||||
return cmd + self.zip_cmd + self.encrypt_cmd
|
||||
|
@ -1,5 +1,6 @@
|
||||
[client]
|
||||
port = 3306
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
|
||||
[mysqld_safe]
|
||||
nice = 0
|
||||
@ -13,6 +14,7 @@ basedir = /usr
|
||||
datadir = /var/lib/mysql/data
|
||||
tmpdir = /var/tmp
|
||||
pid_file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
skip-external-locking = 1
|
||||
key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M
|
||||
max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K
|
||||
|
@ -230,7 +230,8 @@ class BackupAgentTest(trove_testtools.TestCase):
|
||||
self.assertIsNotNone(inno_backup_ex.cmd)
|
||||
str_innobackup_cmd = ('sudo innobackupex'
|
||||
' --stream=xbstream'
|
||||
' %(extra_opts)s'
|
||||
' %(extra_opts)s '
|
||||
' --user=os_admin --password=123'
|
||||
' /var/lib/mysql/data 2>/tmp/innobackupex.log'
|
||||
' | gzip |'
|
||||
' openssl enc -aes-256-cbc -salt '
|
||||
|
@ -77,13 +77,16 @@ ZIP = "gzip"
|
||||
UNZIP = "gzip -d -c"
|
||||
ENCRYPT = "openssl enc -aes-256-cbc -salt -pass pass:default_aes_cbc_key"
|
||||
DECRYPT = "openssl enc -d -aes-256-cbc -salt -pass pass:default_aes_cbc_key"
|
||||
XTRA_BACKUP_RAW = ("sudo innobackupex --stream=xbstream %(extra_opts)s"
|
||||
XTRA_BACKUP_RAW = ("sudo innobackupex --stream=xbstream %(extra_opts)s "
|
||||
" --user=os_admin --password=password"
|
||||
" /var/lib/mysql/data 2>/tmp/innobackupex.log")
|
||||
XTRA_BACKUP = XTRA_BACKUP_RAW % {'extra_opts': ''}
|
||||
XTRA_BACKUP_EXTRA_OPTS = XTRA_BACKUP_RAW % {'extra_opts': '--no-lock'}
|
||||
XTRA_BACKUP_INCR = ('sudo innobackupex --stream=xbstream'
|
||||
' --incremental --incremental-lsn=%(lsn)s'
|
||||
' %(extra_opts)s /var/lib/mysql/data'
|
||||
' %(extra_opts)s '
|
||||
' --user=os_admin --password=password'
|
||||
' /var/lib/mysql/data'
|
||||
' 2>/tmp/innobackupex.log')
|
||||
SQLDUMP_BACKUP_RAW = ("mysqldump --all-databases %(extra_opts)s "
|
||||
"--opt --password=password -u os_admin"
|
||||
|
Loading…
Reference in New Issue
Block a user