Data Backup and Recovery Discussions

snapcreator 3.3 and mysql

jmberoud

Hello,

I'm trying to use snapcreator 3.3 with mysql. But this doesn't work.

# ./snapcreator --profile mysql --action snap --policy hourly --config test --verbose --debug
....
########## Application quiesce ##########
[Wed Feb  9 23:02:39 2011] INFO: Quiescing databases
[Wed Feb  9 23:02:39 2011] INFO: Quiescing database demo
[Wed Feb  9 23:02:39 2011] DEBUG: Connection to demo successfully established
[Wed Feb  9 23:02:39 2011] DEBUG: Executing sql command 'flush tables with read lock' for database demo
[Wed Feb  9 23:02:39 2011] ERROR: #08S01Bad handshake
[Wed Feb  9 23:02:39 2011] ERROR: Application quiesce for plugin mysql failed with exit code 1, Exiting!
########## Application unquiesce ##########
[Wed Feb  9 23:02:39 2011] ERROR: send: Cannot determine peer address at /</var/tmp/scServer3.3.0/snapcreator>Net/MySQL.pm line 100
[Wed Feb  9 23:02:39 2011] ERROR: Application unquiesce for plugin mysql failed with exit code 1, Exiting!
########## PRE EXIT COMMANDS ##########
[Wed Feb  9 23:02:39 2011] INFO: No commands defined
########## PRE EXIT COMMANDS FINISHED SUCCESSFULLY ##########
[Wed Feb  9 23:02:39 2011] DEBUG: Exiting with error code - 2

I can confirm that this works:

mysql -h 127.0.0.1 -P 3306 -u root -p demo

I've attached the config file. Any ideas?

Greets Jean-Marc

14 REPLIES 14

Re: snapcreator 3.3 and mysql

jmberoud

Hello,

the snapcreator mysql plugin seems to use Net::MySQL, which is quite old (latest version 0.09 = March 2006)

I did some googling and I found this:

List of Net::MySQL Bugs: https://rt.cpan.org/Public/Dist/Display.html?Name=Net-MySQL

A bug description and a possible fix (not included in the latest version) for my problem:

https://rt.cpan.org/Public/Bug/Display.html?id=21462

Best regards

jm

Re: snapcreator 3.3 and mysql

ktenzer

Hi Jean-Marc,

What version of MySQL server and Client are you running? Also did you try installing the MySQL-devel package? Your SC config file looks good.

SC 3.3 supports following MySQL versions according to IMT http://now.netapp.com/matrix :

MySQL Enterprise Server 5.1.30
MySQL Enterprise Server 5.1.31
MySQL Enterprise Server 5.1.32
MySQL Enterprise Server 5.1.33
MySQL Enterprise Server 5.1.34
MySQL Enterprise Server 5.1.35
MySQL Enterprise Server 5.1.36
MySQL Enterprise Server 5.1.37
MySQL Enterprise Server 5.1.38
MySQL Enterprise Server 5.1.39
MySQL Enterprise Server 5.1.40
MySQL Enterprise Server 5.1.41
MySQL Enterprise Server 5.1.42
MySQL Enterprise Server 5.1.43
MySQL Enterprise Server 5.1.44
MySQL Enterprise Server 5.1.45
MySQL Enterprise Server 5.1.46
MySQL Enterprise Server 5.1.47
MySQL Enterprise Server 5.1.48
MySQL Enterprise Server 5.1.49
MySQL Enterprise Server 5.1.50
MySQL Enterprise Server 5.1.51
MySQL Enterprise Server 5.1.52

I think probably this is a compadibility issue between Net::MySQL and MySQL client libs. We will try and reproduce this issue and find a solution. The best thing you can do is if your config is supported open an NGS support case. This will force a BURT to be opened and the problem will be addressed much quicker.

Best Regards,

Keith

Re: snapcreator 3.3 and mysql

ktenzer

A workaround solution to this problem is simply not use MYSQL plugin.

You can try using mysql command to send sql needed to quiesce/unquiesce MySQL

APP_QUIESCE_CMD01=mysql <arguments> <sql query=flush tables with read lock>

APP_QUIESCE_CMD02=mysql <arguments> <sql query=flush logs>

APP_UNQUIESCE_CMD01=mysql <arguments> <sql query=unlock tables>

PRE_EXIT_CMD01=mysql <arguments> <sql query=unlock tables>

Quiesce SQL:

flush tables with read lock

flush logs

Unquiesce SQL:

unlock tables

Let us know if this helps?

Regards,

Keith

Re: snapcreator 3.3 and mysql

jmberoud

Hello Keith,

My bad. i didn't chek the compatibility matrix. I was testing with centos 5.5, which has only  MySQL 5.0.77

I wanted to test with RHEL6 x86_64 but it's no listed in the compatibility list either.

Thanks.

Jean-Marc

Re: snapcreator 3.3 and mysql

ktenzer

No problem

SC will run on centOS and redhat6. There isn't NGS support for that but that doesnt prevent you from providing a solution. You can still use SC as basis to quickly get a scripting solution going. This saves time and provides the customer I think with a great solution.

If the MySQL plugin doesn't work (has issues with certain versions) the try using mysql cli in combo with APP_QUIESCE_CMDS and APP_UNQUIESCE_CMDS. If you want any further help getting that going then let us know. We are happy to help!

Keith

Re: snapcreator 3.3 and mysql

jmberoud

Hello Keith,

The workaround is working. In the config file, you have to modify the following line too:

APP_NAME=mysql   => APP_NAME=

Actually one could write a small perl script wraper to quiesce/unquiesce the db. The needed infos are available as environment variables. I'll have a look at tthis

and try to make this work on rhel6 too.

Thanks

Jean-Marc

Re: snapcreator 3.3 and mysql

ktenzer

Yep I forgot about APP_NAME. You have to turn that off, that basically turns off plugin and allows you to work with quiesce|unquiesce|pre_exit cmds.

If you figure this out please share your scripts and config file, this type of knowledge really helps everyone in the SC community.

Good Luck!

Keith

Re: snapcreator 3.3 and mysql

jmberoud

Actually I tried on RHE6 x86_64 too. It is a minimal install, so some libraries are possibly missing.

I'll take a look after my holidays

I get this

# ./snapcreator --profile mysql --action snap --policy hourly --config test --verbose
Subroutine AUTOLOAD redefined at
        /</var/tmp/scServer3.3.0/snapcreator>Net/SSLeay.pm line 651 (#1)
    (W redefine) You redefined a subroutine.  To suppress this warning, say
   
        {
        no warnings 'redefine';
        eval "sub name { ... }";
        }
   
Subroutine print_errs redefined at
        /</var/tmp/scServer3.3.0/snapcreator>Net/SSLeay.pm line 688 (#1)
Subroutine die_if_ssl_error redefined at
        /</var/tmp/scServer3.3.0/snapcreator>Net/SSLeay.pm line 704 (#1)
Subroutine die_now redefined at
        /</var/tmp/scServer3.3.0/snapcreator>Net/SSLeay.pm line 712 (#1)
Subroutine blength redefined at (eval 242) line 1 (#1)
Can't load 'auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay: auto/Net/SSLeay/SSLeay.so: cannot open shared object file: No such file or directory at /</var/tmp/scServer3.3.0/snapcreator>DynaLoader.pm line 219.
at perlapp line 843 (#2)
    (F) The module you tried to load failed to load a dynamic extension. This
    may either mean that you upgraded your version of perl to one that is
    incompatible with your old dynamic extensions (which is known to happen
    between major versions of perl), or (more likely) that your dynamic
    extension was built against an older version of the library that is
    installed on your system. You may need to rebuild your old dynamic
    extensions.
   
Uncaught exception from user code:
        Can't load 'auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay: auto/Net/SSLeay/SSLeay.so: cannot open shared object file: No such file or directory at /</var/tmp/scServer3.3.0/snapcreator>DynaLoader.pm line 219.
at perlapp line 843
at perlapp line 950
        PerlApp::my_require('Net/SSLeay.pm') called at snapcreator.pl line 8297
        main::setEnv() called at snapcreator.pl line 558

Re: snapcreator 3.3 and mysql

ktenzer

One more thing. You mention perl, if you are interested you can create your own plugin (plugin framework is perl). There is a TR (below) which explains how to program a community plugin. This would take more time to create than wrapper scripts but if you plan on re-using your plugin and providing a unique solution (your own SnapManager using Snap Creator) you are welcome to do so.

In future releases we are looking at adding support so folks can write plugins in other languages (powershell, etc) and not just perl.

http://media.netapp.com/documents/tr-3890.pdf

Regards,

Keith 

Re: snapcreator 3.3 and mysql

ktenzer

You can either turn off HTTPS

PORT=80

TRANSPORT=HTTP

OR

Install the openssl-devel rpm. The ontap apis use Net::SSLeay and it links into ssl libraries in OS, looks like it cant find them. We link dynamically meaning you have to install openssl-devel package. Mostly this is installed but sometimes not. Let me know if this fixes the issue.

Keith

Re: snapcreator 3.3 and mysql

jmberoud

A quick Feedback:

When I trun off ssl, it works. The mysql user needs one more privilege too (if you don't use root):

mysql> update user set Reload_priv="Y" where user="demo";

mysq> flush privileges;

I install openssl and openssl-devel rpm packages (bot i686 and x86_64). But won't work too.

The solution is:

# yum install openssl098e-0.9.8e-17.el6.i686

and bingo it works!

Thanks  for the help

Greets jm

Re: snapcreator 3.3 and mysql

nkarthik

Hi,

I have also done the same script creation for SC with KVM without APP_NAME. it works pretty well. We demonstrated to airtel india customer.

Thanks for having such a custom flexibility in SC

Thanks

Karthikeyan.N

Re: snapcreator 3.3 and mysql

AVCORMACK

Hi Sorry for the stupid question but when you say not using Mysql pluglin but instead add

A workaround solution to this problem is simply not use MYSQL plugin .

You can try using mysql command to send sql needed to quiesce/unquiesce MySQL

APP_QUIESCE_CMD01=mysql <arguments> <sql query=flush tables with read lock>

APP_QUIESCE_CMD02=mysql <arguments> <sql query=flush logs>

APP_UNQUIESCE_CMD01=mysql <arguments> <sql query=unlock tables>

PRE_EXIT_CMD01=mysql <arguments> <sql query=unlock tables>

My question is , where I have to put it?

Many thanks in advanced

Al

Re: snapcreator 3.3 and mysql

ktenzer

Well you have a couple of issues

1) Redhat throwing SSL errors. This is because some shared library links are missing.

The requirements for HTTPS for Linux/Unix are as follows:

* openssl package

* SSL symlinks

Make sure the following symlinks are located under /usr/lib oder /usr/lib64 (depending on if OS is 64bit or not)

libssl.so.6

libcrypto.so.6

If the symlinks dont exist please cd to /usr/lib or /usr/lib64 and run following command to link them. Make sure what we are linking to is installed, again pre-requisite is openssl so it should be installed first.

ln -sf libssl.so.0.9.8 libssl.so.6

ln -sf libcrypto.so.0.9.8 libcrypto.so.6

2) MySQL plugin not working. This looks to me on second review that you are trying to use MySQL plugin remotely. I would try using an agent. So install agent on MySQL host and then set HOST=localhost in config. If this doesnt work then it is some connection issue with MySQL. As a workaround to this if you cant figure it out you can use the following commands in config file (this means commenting out APP_NAME=mysql #APP_NAME=mysql in config):

APP_QUIESCE_CMD01=mysql <arguments> <sql query=flush tables with read lock>

APP_QUIESCE_CMD02=mysql <arguments> <sql query=flush logs>

APP_UNQUIESCE_CMD01=mysql <arguments> <sql query=unlock tables>

PRE_EXIT_CMD01=mysql <arguments> <sql query=unlock tables>

You would need to configure these in the config file under scServer/configs/<profile>/<conf file>

Regards,

Keith

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums
Public