Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: ssh copy plugin

  1. #1

    Default ssh copy plugin

    i cannot seem to get this to work. i can ssh to the remote box using a password or through public key. i get the error below. the hostname and db's in the log below has been modified so please do not go by it.

    Mon Mar 24 11:14:14 2008: host1.domain.com:backup:ERROR: Output of command: 'mysqlhotcopy' is {
    DBI connect(';host=host1.domain.com;mysql_read_default _group=mysqlhotcopy','root',...) failed: Access denied for user 'root'@'host1.domain.com' (using password: YES) at /usr/bin/mysqlhotcopy line 178
    mysqlhotcopy on host host1.domain.com failed at /usr/share/mysql-zrm/plugins/ssh-copy.pl line 200.
    }
    Mon Mar 24 11:14:14 2008: host1.domain.com:backup:ERROR: mysqlhotcopy command did not succeed. Command used is /usr/share/mysql-zrm/pl
    ugins/ssh-copy.pl --mysqlhotcopy --user="root" --password="*****" --host="host1.domain.com" --quiet db1 db2 db3 "/var/lib/mysql-zrm/host1.domain.com/20080324111408" > /tmp/qCq7EXaSDl 2>&1 Return value is 65280
    Mon Mar 24 11:14:14 2008: host1.domain.com:backup:INFO: backup-status=Backup failed
    Mon Mar 24 11:14:14 2008: host1.domain.com:backup:INFO: Backup failed

  2. #2

    Default

    Please check the privileges in your database. The error message you are receiving seems to indicate that the user "root" does not have the proper access in MySQL when the request originates from "host1.domain.com". For information on the correct user privileges please read the following knowledgebase article:

    [url]http://network.zmanda.com/lore/article.php?id=064[/url]

    The first part of the article will detail the privileges that the backup user will need.

  3. #3

    Default

    This is the root privileges which is also described in [url]http://www.zmanda.com/quick-mysql-backup.html[/url].

    mysql> show grants for 'root'@'host1.domain.com';
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Grants for [email]root@host1.domain.com[/email] |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | GRANT SELECT, INSERT, UPDATE, CREATE, DROP, RELOAD, SHUTDOWN, ALTER, SUPER, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'root'@'host1.domain.com' IDENTIFIED BY PASSWORD '*A98955EE171dfsdfsdfdfVDVDVD178A4255BECACCB750' |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.06 sec)

  4. #4
    Join Date
    Oct 2006
    Posts
    199

    Default

    Quote Originally Posted by slackamp View Post
    This is the root privileges which is also described in [url]http://www.zmanda.com/quick-mysql-backup.html[/url].

    mysql> show grants for 'root'@'host1.domain.com';
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Grants for [email]root@host1.domain.com[/email] |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | GRANT SELECT, INSERT, UPDATE, CREATE, DROP, RELOAD, SHUTDOWN, ALTER, SUPER, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'root'@'host1.domain.com' IDENTIFIED BY PASSWORD '*A98955EE171dfsdfsdfdfVDVDVD178A4255BECACCB750' |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.06 sec)
    Could you run the following command on the client and post what error you get
    mysqlhotcopy --user="root" --password="*A98955EE171dfsdfsdfdfVDVDVD178A4255BECACCB750" --host="host1.domain.com" --quiet db1 db2 db3 /tmp/testdir

    BTW please see [url]http://mysqlbackup.zmanda.com/index.php/Pre-Installation#MySQL_Backup_User[/url]
    for the minimal set of privileges you need.

    --kkg

  5. #5

    Unhappy Similar error occuring with me - command outputs attached

    Hi!

    I ran into a similar error as slackamp. I've checked for perl-DBD, perl-DBI, and perl-XML-Parser - All are installed properly. I have also granted the minimum rights to the backup user. Also generated the passfiles on both the database and backup servers. I have mysqlhotcopy installed on both, the database as well as the backup servers. On running the following command on the backup server:

    mysql-zrm-scheduler --backup-set DailyBackup --backup-level 0 --now

    I got the following output:

    backup:~ /#mysql-zrm-scheduler --backup-set DailyBackup --backup-level 0 --now
    schedule:INFO: ZRM for MySQL Community Edition - version 2.0
    Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
    backup:INFO: ZRM for MySQL Community Edition - version 2.0
    DailyBackup:backup:INFO: START OF BACKUP
    DailyBackup:backup:INFO: PHASE START: Initialization
    DailyBackup:backup:INFO: Mail address: [email]username@companyname.com[/email] is ok
    DailyBackup:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/DailyBackup/tmp0w54z.conf
    DailyBackup:backup:INFO: {
    DailyBackup:backup:INFO: verbose=1
    DailyBackup:backup:INFO: encrypt-plugin=/usr/share/mysql-zrm/plugins/encrypt.pl
    DailyBackup:backup:INFO: retention-policy=30D
    DailyBackup:backup:INFO: decrypt-option=-d
    DailyBackup:backup:INFO: password=******
    DailyBackup:backup:INFO: tables=student
    DailyBackup:backup:INFO: backup-mode=raw
    DailyBackup:backup:INFO: compress-plugin=/usr/bin/gzip
    DailyBackup:backup:INFO: user=mysql_backup_usr
    DailyBackup:backup:INFO: copy-plugin=/usr/share/mysql-zrm/plugins/ssh-copy.pl
    DailyBackup:backup:INFO: backup-level=0
    DailyBackup:backup:INFO: quiet=0
    DailyBackup:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
    DailyBackup:backup:INFO: mailto=username@companyname.com
    DailyBackup:backup:INFO: ssh-user=mysql
    DailyBackup:backup:INFO: host=remote.mysql.net
    DailyBackup:backup:INFO: database=sample
    DailyBackup:backup:INFO: passfile=/tmp/a.pass
    DailyBackup:backup:INFO: compress=/usr/bin/gzip
    DailyBackup:backup:INFO: }
    DailyBackup:backup:INFO: Getting mysql variables
    DailyBackup:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" variables
    DailyBackup:backup:INFO: datadir is /usr/local/mysql/var/
    DailyBackup:backup:INFO: mysql_version is 5.0.67-log
    DailyBackup:backup:INFO: InnoDB data file are /usr/local/mysql/var/ibdata1
    DailyBackup:backup:INFO: InnoDB log dir is /usr/local/mysql/var/.
    DailyBackup:backup:INFO: backup set being used is DailyBackup
    DailyBackup:backup:INFO: backup-set=DailyBackup
    DailyBackup:backup:INFO: backup-date=20080828003428
    DailyBackup:backup:INFO: mysql-server-os=Linux/Unix
    DailyBackup:backup:INFO: host=remote.mysql.net
    DailyBackup:backup:INFO: backup-date-epoch=1219863868
    DailyBackup:backup:INFO: retention-policy=30D
    DailyBackup:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
    DailyBackup:backup:INFO: mysql-version=5.0.67-log
    DailyBackup:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackup/20080828003428
    DailyBackup:backup:INFO: backup-level=0
    DailyBackup:backup:INFO: backup-mode=raw
    DailyBackup:backup:INFO: PHASE END: Initialization
    DailyBackup:backup:INFO: PHASE START: Running pre backup plugin
    DailyBackup:backup:INFO: Executing pre-backup-plugin
    DailyBackup:backup:INFO: PHASE END: Running pre backup plugin
    DailyBackup:backup:INFO: PHASE START: Flushing logs
    DailyBackup:backup:INFO: Flushing the logs
    DailyBackup:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" flush-logs
    DailyBackup:backup:INFO: Getting master logname using command mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show master status"
    DailyBackup:backup:INFO: PHASE END: Flushing logs
    DailyBackup:backup:INFO: Command used for getting engine type mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show table status from \`sample\` like 'student'"
    DailyBackup:backup:INFO: For database sample
    DailyBackup:backup:INFO: and for table student
    DailyBackup:backup:INFO: engine
    DailyBackup:backup:INFO: MyISAM
    DailyBackup:backup:INFO: PHASE START: Creating raw backup
    DailyBackup:backup:INFO: Command used for raw backup is /usr/share/mysql-zrm/plugins/ssh-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup/20080828003428" > /tmp/StIIpYTbXY 2>&1
    Password:
    Password:
    Password:
    DailyBackup:backup:ERROR: Output of command: 'mysqlhotcopy' is {
    Permission denied (publickey,keyboard-interactive).
    Could not create directory /tmp/HUYMluAhjh on host remote.mysql.net at /usr/share/mysql-zrm/plugins/ssh-copy.pl line 313.
    }
    DailyBackup:backup:ERROR: mysqlhotcopy did not succeed. Command used is /usr/share/mysql-zrm/plugins/ssh-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup/20080828003428" > /tmp/StIIpYTbXY 2>&1 Return value is 65280
    DailyBackup:backup:INFO: PHASE START: Cleanup
    DailyBackup:backup:INFO: backup-status=Backup failed
    DailyBackup:backup:INFO: Backup failed
    DailyBackup:backup:INFO: mailing file /tmp/fQMTHKI1pN
    DailyBackup:backup:INFO: mail command is cat "/tmp/fQMTHKI1pN"|mail -s "[ZRM for MySQL Report] ERROR during backup of backup-set DailyBackup" [email]username@companyname.com[/email]
    DailyBackup:backup:INFO: PHASE END: Cleanup
    DailyBackup:backup:INFO: END OF BACKUP
    ERROR: /usr/bin/mysql-zrm did not finish successfully


    I ran the test given below as mentioned by kkg on both the database as well as the backup servers:

    mysqlhotcopy --user="mysql_backup_usr" --password="password" --host="remote.mysql.net" --quiet sample /tmp/testdir

    I got the following output from the database server:

    remote:~ # mysqlhotcopy --user="mysql_backup_usr" --password="password" --addtodest --host="remote.mysql.net" sample /tmp/mysql-zrm-testdir
    Locked 1 tables in 0 seconds.
    Flushed tables (`sample`.`student`) in 0 seconds.
    Copying 4 files...
    Copying indices for 0 files...
    Unlocked tables.
    mysqlhotcopy copied 1 tables (4 files) in 0 seconds (0 seconds overall).


    I got the following output from the backup server:

    backup:/ # mysqlhotcopy --user="mysql_backup_usr" --password="password" --addtodest --host="remote.mysql.net" sample /tmp/mysql-zrm-testdir
    'sample' is an empty database
    Invalid db.table name 'sample.sample`.`student' at /usr/bin/mysqlhotcopy line 854.
    You have new mail in /var/mail/root


    Can anyone help??!!

  6. #6
    Join Date
    Oct 2006
    Posts
    199

    Default

    Quote Originally Posted by mrigank.mishra View Post
    Hi!


    DailyBackup:backup:INFO: Command used for raw backup is /usr/share/mysql-zrm/plugins/ssh-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup/20080828003428" > /tmp/StIIpYTbXY 2>&1
    Password:
    Password:
    Password:
    DailyBackup:backup:ERROR: Output of command: 'mysqlhotcopy' is {
    Permission denied (publickey,keyboard-interactive).
    Could not create directory /tmp/HUYMluAhjh on host remote.mysql.net at /usr/share/mysql-zrm/plugins/ssh-copy.pl line 313.
    }
    The issue here is that the ssh password needs to be supplied at time of backup. If you want to enable automatic login, you should do the ssh key exchange and ensure that the user running the backup (for e.g. mysql) is able to automatically login to the remote host without password being asked for.

    --kkg

  7. #7

    Unhappy Having mysqlhotcopy errors with socket-copy as well.

    Quote Originally Posted by kkg View Post
    The issue here is that the ssh password needs to be supplied at time of backup. If you want to enable automatic login, you should .

    --kkg
    I had duly supplied the password(thrice, as you can see from the output I attached) but somehow it is not authenticating properly...

    Also, could you please elaborate a little bit on How to do the SSH key exchange and ensure that the user running the backup is able to automatically login to the remote host without password being asked for.

    If by "key exchange" you mean that we're supposed to copy the contents of /root/.ssh/id_rsa.pub file located on backup server to the file “authorized_keys” on database server, I have done that as well.

    Also, I tried doing the backup with socket-copy plugin, with the options given below:

    compress=1
    compress-plugin=/usr/bin/gzip
    encrypt=1
    encrypt-plugin="/usr/share/mysql-zrm/plugins/encrypt.pl"
    tables=student
    database="sample"
    user="mysql_backup_usr"
    password="password"
    host="remote.mysql.net"
    mailto="username@companyname.com"
    copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl


    I got the output below:

    backup:/ # mysql-zrm-scheduler --backup-set DailyBackup --backup-level 0 --now
    schedule:INFO: ZRM for MySQL Community Edition - version 2.0
    Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
    backup:INFO: ZRM for MySQL Community Edition - version 2.0
    DailyBackup:backup:INFO: START OF BACKUP
    DailyBackup:backup:INFO: PHASE START: Initialization
    DailyBackup:backup:INFO: Mail address: [email]username@companyname.com[/email] is ok
    DailyBackup:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/DailyBackup/tmpeD1WO.conf
    DailyBackup:backup:INFO: {
    DailyBackup:backup:INFO: verbose=1
    DailyBackup:backup:INFO: encrypt-plugin=/usr/share/mysql-zrm/plugins/encrypt.pl
    DailyBackup:backup:INFO: retention-policy=30D
    DailyBackup:backup:INFO: decrypt-option=-d
    DailyBackup:backup:INFO: password=******
    DailyBackup:backup:INFO: tables=student
    DailyBackup:backup:INFO: backup-mode=raw
    DailyBackup:backup:INFO: compress-plugin=/usr/bin/gzip
    DailyBackup:backup:INFO: user=mysql_backup_usr
    DailyBackup:backup:INFO: copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl
    DailyBackup:backup:INFO: backup-level=0
    DailyBackup:backup:INFO: quiet=0
    DailyBackup:backup:INFO: encrypt=/usr/share/mysql-zrm/plugins/encrypt.pl
    DailyBackup:backup:INFO: mailto=username@companyname.com
    DailyBackup:backup:INFO: host=remote.mysql.net
    DailyBackup:backup:INFO: database=sample
    DailyBackup:backup:INFO: compress=/usr/bin/gzip
    DailyBackup:backup:INFO: }
    DailyBackup:backup:INFO: Getting mysql variables
    DailyBackup:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" variables
    DailyBackup:backup:INFO: datadir is /usr/local/mysql/var/
    DailyBackup:backup:INFO: mysql_version is 5.0.67-log
    DailyBackup:backup:INFO: InnoDB data file are /usr/local/mysql/var/ibdata1
    DailyBackup:backup:INFO: InnoDB log dir is /usr/local/mysql/var/.
    DailyBackup:backup:INFO: backup set being used is DailyBackup
    DailyBackup:backup:INFO: backup-set=DailyBackup
    DailyBackup:backup:INFO: backup-date=20080828191929
    DailyBackup:backup:INFO: mysql-server-os=Linux/Unix
    DailyBackup:backup:INFO: host=remote.mysql.net
    DailyBackup:backup:INFO: backup-date-epoch=1219931369
    DailyBackup:backup:INFO: retention-policy=30D
    DailyBackup:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
    DailyBackup:backup:INFO: mysql-version=5.0.67-log
    DailyBackup:backup:INFO: backup-directory=/var/lib/mysql-zrm/DailyBackup/20080828191929
    DailyBackup:backup:INFO: backup-level=0
    DailyBackup:backup:INFO: backup-mode=raw
    DailyBackup:backup:INFO: PHASE END: Initialization
    DailyBackup:backup:INFO: PHASE START: Running pre backup plugin
    DailyBackup:backup:INFO: Executing pre-backup-plugin
    DailyBackup:backup:INFO: PHASE END: Running pre backup plugin
    DailyBackup:backup:INFO: PHASE START: Flushing logs
    DailyBackup:backup:INFO: Flushing the logs
    DailyBackup:backup:INFO: mysqladmin --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" flush-logs
    DailyBackup:backup:INFO: Getting master logname using command mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show master status"
    DailyBackup:backup:INFO: PHASE END: Flushing logs
    DailyBackup:backup:INFO: Command used for getting engine type mysql --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" -e "show table status from \`sample\` like 'student'"
    DailyBackup:backup:INFO: For database sample
    DailyBackup:backup:INFO: and for table student
    DailyBackup:backup:INFO: engine
    DailyBackup:backup:INFO: MyISAM
    DailyBackup:backup:INFO: PHASE START: Creating raw backup
    DailyBackup:backup:INFO: Command used for raw backup is /usr/share/mysql-zrm/plugins/socket-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup/20080828191929" > /tmp/LV9jY1qJYh 2>&1
    DailyBackup:backup:ERROR: Output of command: 'mysqlhotcopy' is {
    close of pipe failed
    }
    DailyBackup:backup:ERROR: mysqlhotcopy did not succeed. Command used is /usr/share/mysql-zrm/plugins/socket-copy.pl --mysqlhotcopy --user="mysql_backup_usr" --password="*****" --host="remote.mysql.net" --quiet sample./^student$/ "/var/lib/mysql-zrm/DailyBackup/20080828191929" > /tmp/LV9jY1qJYh 2>&1 Return value is 512
    DailyBackup:backup:INFO: PHASE START: Cleanup
    DailyBackup:backup:INFO: backup-status=Backup failed
    DailyBackup:backup:INFO: Backup failed
    DailyBackup:backup:INFO: mailing file /tmp/MT28qoSHhc
    DailyBackup:backup:INFO: mail command is cat "/tmp/MT28qoSHhc"|mail -s "[ZRM for MySQL Report] ERROR during backup of backup-set DailyBackup" [email]username@companyname.com[/email]
    DailyBackup:backup:INFO: PHASE END: Cleanup
    DailyBackup:backup:INFO: END OF BACKUP
    ERROR: /usr/bin/mysql-zrm did not finish successfully


    Could you kindly shed some light on this as well??

  8. #8

    Default

    To set RSA key based password less authentication:

    Perform following steps on Backup server:
    1. Become the mysql user:
    #su mysql
    2. Generate public and private keys:
    #ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key
    /var/lib/mysql/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in
    /var/lib/mysql/.ssh/id_rsa.
    Your public key has been saved in
    /var/lib/mysql/.ssh/id_rsa.pub.
    The key fingerprint is:
    61:b3:88:a4:dd:86:2c:ef:2f:73:8b:91:ec:aa:3d:4a mysql@host
    3. Copy id_rsa.pub from the ZRM server file to the mysql client machine. This file is located in the .ssh directory in the mysql user's home directory.

    Perform following steps on MySQL Database server:

    1. Login to mysql client machine as the mysql user:
    #su mysql
    2. If the authorized_keys file is not present in the .ssh folder in the home directory of mysql user,� create the file. Append the contents of id_rsa.pub to the authorized_keys file.
    # cat id_rsa.pub >> authorized_keys
    After performing these steps, the mysql user from the ZRM Server will be able to login to the mysql client machine without a password by using key-based authentication

  9. #9

    Default

    Failing of Socket copy, seems to be permission issue.

    Please check to see that the directory /var/log/mysql-zrm exists on the system where you have installed the ZRM for MySQL client libraries, and that the directory is owned by the mysql user and is writeable.

    Following are some general guide lines for remote backup to work:

    1. Make sure that UID and GID of “myslq” user are matching on Backup server and MySQL database server.
    2. RSA key based authentication has been set properly.
    3. Backup user has enough permissions to perform backup and restore of selected database.

  10. #10

    Default

    Quote Originally Posted by kulkarni_mangesh View Post
    To set RSA key based password less authentication:

    Perform following steps on Backup server:
    1. Become the mysql user:
    #su mysql
    2. Generate public and private keys:
    #ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key
    /var/lib/mysql/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in
    /var/lib/mysql/.ssh/id_rsa.
    Your public key has been saved in
    /var/lib/mysql/.ssh/id_rsa.pub.
    The key fingerprint is:
    61:b3:88:a4:dd:86:2c:ef:2f:73:8b:91:ec:aa:3d:4a mysql@host
    3. Copy id_rsa.pub from the ZRM server file to the mysql client machine. This file is located in the .ssh directory in the mysql user's home directory.

    Perform following steps on MySQL Database server:

    1. Login to mysql client machine as the mysql user:
    #su mysql
    2. If the authorized_keys file is not present in the .ssh folder in the home directory of mysql user,� create the file. Append the contents of id_rsa.pub to the authorized_keys file.
    # cat id_rsa.pub >> authorized_keys
    After performing these steps, the mysql user from the ZRM Server will be able to login to the mysql client machine without a password by using key-based authentication
    No. This didn't help me... :-(

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •