diff --git a/api-ref/source/samples/db-list-cfg-defaults-response.json b/api-ref/source/samples/db-list-cfg-defaults-response.json index 58422431f5..c506d3aac2 100644 --- a/api-ref/source/samples/db-list-cfg-defaults-response.json +++ b/api-ref/source/samples/db-list-cfg-defaults-response.json @@ -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, diff --git a/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt new file mode 100644 index 0000000000..d8d78fc397 --- /dev/null +++ b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt @@ -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 + diff --git a/trove/guestagent/strategies/backup/mysql_impl.py b/trove/guestagent/strategies/backup/mysql_impl.py index 8cd6c6466d..6721aa69b0 100644 --- a/trove/guestagent/strategies/backup/mysql_impl.py +++ b/trove/guestagent/strategies/backup/mysql_impl.py @@ -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 diff --git a/trove/templates/mariadb/config.template b/trove/templates/mariadb/config.template index 88614bdeaf..8507e0f3dd 100644 --- a/trove/templates/mariadb/config.template +++ b/trove/templates/mariadb/config.template @@ -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 diff --git a/trove/tests/unittests/backup/test_backupagent.py b/trove/tests/unittests/backup/test_backupagent.py index 8bbf70dc84..c692cb0a58 100644 --- a/trove/tests/unittests/backup/test_backupagent.py +++ b/trove/tests/unittests/backup/test_backupagent.py @@ -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 ' diff --git a/trove/tests/unittests/guestagent/test_backups.py b/trove/tests/unittests/guestagent/test_backups.py index 1f4644b189..565fd1ce2c 100644 --- a/trove/tests/unittests/guestagent/test_backups.py +++ b/trove/tests/unittests/guestagent/test_backups.py @@ -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"