skrew
March 16th, 2007, 12:19 PM
I tried to use ssh-copy plugin to securely backup MySQL database from remote server. Testing on local server that have mysql ports firewalled - only ssh connection allowed.
This is my configs /etc/mysql-zrm/mysql-zrm.conf
backup-level=0
backup-mode=logical
destination=/backup/database
retention-policy=2M
compress=1
all-databases=1
user="root"
verbose=1
mailto="root"
html-reports=backup-status-info
html-report-directory=/var/www/mysql-zrm/reports/
webserver-url=http://zrmserver.localdomain/reports/html/
copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
ssh-user="mysql"
This is my /etc/mysql-zrm/testserver/mysql-zrm.conf
password="root"
host="192.168.0.203"
copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
And this is the result:
[root@zrmserver tmp]# mysql-zrm --action backup --backup-set testserver
INFO: ZRM for MySQL Community Edition - version 1.1.5
INFO: Mail address: root is ok
INFO: Input Parameters Used {
INFO: verbose=1
INFO: retention-policy=2M
INFO: tmpdir=/tmp
INFO: default-character-set=utf8
INFO: all-databases=1
INFO: destination=/backup/database
INFO: password=******
INFO: backup-mode=logical
INFO: user=root
INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
INFO: backup-level=0
INFO: webserver-url=http://zrmserver.localdomain/reports/html/
INFO: mailto=root
INFO: html-reports=backup-status-info
INFO: ssh-user=mysql
INFO: host=192.168.0.203
INFO: html-report-directory=/var/www/mysql-zrm/reports/
INFO: compress=
INFO: }
INFO: ZRM Temporary configuration file = /etc/mysql-zrm/testserver/tmpywVzR.conf
WARNING: Could not open file /etc/mysql-zrm/testserver/last_backup. No such file or directory
INFO: Getting mysql variables
INFO: mysqladmin --user="root" --password="*****" --host="192.168.0.203" variables
ERROR: Command returned error
ERROR: Output of command: 'mysqladmin --user="root" --password="*****" --host="192.168.0.203" variables' is {
mysqladmin: connect to server at '192.168.0.203' failed
error: 'Lost connection to MySQL server during query'
}
ERROR: Cannot connect to mysql server!
INFO: mailing file /tmp/G9poB6sbvM
INFO: mail command is cat "/tmp/G9poB6sbvM"|mail -s "Errors while running MySQL ZRM" root
As I understand from configs, ssh-copy.pl plugin make a backup on the remote MySQL server and then just transfer a dump to ssh pipe. Anyway any mysqladmin command run on the remote MySQL server. Why it not happens?
Info in log file is the same as in console.
This is my configs /etc/mysql-zrm/mysql-zrm.conf
backup-level=0
backup-mode=logical
destination=/backup/database
retention-policy=2M
compress=1
all-databases=1
user="root"
verbose=1
mailto="root"
html-reports=backup-status-info
html-report-directory=/var/www/mysql-zrm/reports/
webserver-url=http://zrmserver.localdomain/reports/html/
copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
ssh-user="mysql"
This is my /etc/mysql-zrm/testserver/mysql-zrm.conf
password="root"
host="192.168.0.203"
copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
And this is the result:
[root@zrmserver tmp]# mysql-zrm --action backup --backup-set testserver
INFO: ZRM for MySQL Community Edition - version 1.1.5
INFO: Mail address: root is ok
INFO: Input Parameters Used {
INFO: verbose=1
INFO: retention-policy=2M
INFO: tmpdir=/tmp
INFO: default-character-set=utf8
INFO: all-databases=1
INFO: destination=/backup/database
INFO: password=******
INFO: backup-mode=logical
INFO: user=root
INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
INFO: backup-level=0
INFO: webserver-url=http://zrmserver.localdomain/reports/html/
INFO: mailto=root
INFO: html-reports=backup-status-info
INFO: ssh-user=mysql
INFO: host=192.168.0.203
INFO: html-report-directory=/var/www/mysql-zrm/reports/
INFO: compress=
INFO: }
INFO: ZRM Temporary configuration file = /etc/mysql-zrm/testserver/tmpywVzR.conf
WARNING: Could not open file /etc/mysql-zrm/testserver/last_backup. No such file or directory
INFO: Getting mysql variables
INFO: mysqladmin --user="root" --password="*****" --host="192.168.0.203" variables
ERROR: Command returned error
ERROR: Output of command: 'mysqladmin --user="root" --password="*****" --host="192.168.0.203" variables' is {
mysqladmin: connect to server at '192.168.0.203' failed
error: 'Lost connection to MySQL server during query'
}
ERROR: Cannot connect to mysql server!
INFO: mailing file /tmp/G9poB6sbvM
INFO: mail command is cat "/tmp/G9poB6sbvM"|mail -s "Errors while running MySQL ZRM" root
As I understand from configs, ssh-copy.pl plugin make a backup on the remote MySQL server and then just transfer a dump to ssh pipe. Anyway any mysqladmin command run on the remote MySQL server. Why it not happens?
Info in log file is the same as in console.