Subscribe

snapcreator 3.3 and mysql

[ Edited ]

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

Re: snapcreator 3.3 and mysql

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

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

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

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

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

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

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

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

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