Click here to register.
      
PBWG Banner


     Install/Upgrade Help > Wre Installation - Mysql process problems

Wre Installation - Mysql process problems

User Pentatonic
Date 3/27/2008 5:02 am
Views 572
Rating -1    Rate [
|
]
Previous · Next
User Message
Pentatonic

Hi Folks,

I have carried out a wre install on Linux and I'm having some problems with the console restarting the MySql process (other processes modprox/perl/spectre all seem fine).

Whenever I try to start/restart I get the messege "MySQL did not restart successfully." However when I check the linux console I can see the process running and there are no errors in the log.

How does the wre console determine if the process has started successfully ?

 Thanks in advance.

Process/log info

 ps -ef | grep mysql
root     15910     1  0 09:32 pts/7    00:00:00 /bin/sh /data/wre/prereqs/bin/mysqld_safe --datadir=/data/wre/var/mysqldata --pid-file=/data/wre/var/mysqldata/myserver.pid --user=a_webgui
a_webgui 15943 15910  0 09:32 pts/7    00:00:00 /data/wre/prereqs/libexec/mysqld --basedir=/data/wre/prereqs --datadir=/data/wre/var/mysqldata --user=a_webgui --pid-file=/data/wre/var/mysqldata/myserver.pid --skip-external-locking --port=3306

mysql log file

080327 09:32:32  mysqld started
080327  9:32:33 [Note] /data/wre/prereqs/libexec/mysqld: ready for connections.
Version: '5.0.45'  socket: '/data/wre/var/mysqldata/mysql.sock'  port: 3306  Source distribution

--- (Edited on 3/27/2008 5:02 am [GMT-0500] by Pentatonic) ---



Back to Top
Rate [
|
]
 
 
koen
The wreservice.pl does this dit: 

if (scalar(@start)) {
    if (grep /       printSuccess(sub{WRE::Mysql->new(wreConfig=>$config)->start}, "Start MySQL"); 

That subroutine ->start can be found in: /data/wre/lib/WRE/Mysql.pm

#-------------------------------------------------------------------

=head2 start ( )

Returns a 1 if the start was successful, or a 0 if it was not.

Note: The process that runs this command must be either root or the user specified in the WRE config file.


=cut

sub start {
    my $self = shift;
    my $count = 0;
    my $success = 0;
    my $config = $self->wreConfig;
    $config->set("wreMonitor/mysqlAdministrativelyDown", 0);
    my $host = WRE::Host->new(wreConfig => $config);
    my $cmd = "";
    if ($host->getOsName eq "windows") {
        $cmd = "net start WREmysql";
    }
    else {
        $cmd = $config->getRoot("/prereqs/share/mysql/mysql.server")." start --user=".$config->get("user");
    }
    `$cmd`; # catch command line output
    while ($count < 10 && $success == 0) {
        sleep(1);
        eval {$success = $self->ping };
        $count++;
    }
    return $success;
}

#-------------------------------------------------------------------

So what it (actually) does is:

create the command that is (in total) something like this:

/data/wre/prereqs/share/mysql/mysql.server start --user=webgui

It then runs this process.

After that it tries to '$self->ping' it for 10 seconds every second.

If '$self->ping' returns sucess then ->start returns success.

So success is not determined by something the above command returns.

Instead we have to look at the ->ping subroutine. 

So here is the ping subroutine:

#-------------------------------------------------------------------

=head2 ping ( )

Returns a 1 if MySQL is running, or a 0 if it is not.

=cut

sub ping {
    my $self = shift;
    my $config = $self->wreConfig;
    my $db;
    eval {$db = $self->getDatabaseHandle(password=>$config->get("mysql/test/password"), username=>$config->get("mysql/test/user"))};
    if (defined $db) {
       $db->disconnect;
       return 1;
    }
    return 0;
}

#-------------------------------------------------------------------

So this subroutine returns success if the test databaseuser can be connected with the testdatabasepassword.

Configuration of the user/password combination that is used for this is found in the wre configuration, which is configurably by editting /data/wre/etc/wre.conf

   "mysql" : {
        "test" : {
            "database" : "test",
            "password" : "test",
            "user" : "test"
        },
        "hostname" : "localhost",
        "adminUser" : "root",
        "port" : "3306"
        },

near the end of the file.  

Koen de Jonge - ProcoliX
http://www.procolix.com
Hosting - WebGUI - Virtualization

--- (Edited on 27-March-2008 23:22 [GMT+0100] by koen) ---



Back to Top
Rate [
|
]
 
 
Pentatonic

 

Thanks very much for the help Keon.  It looks like mysql hadn't installed correctly - the test db was missing. I decided to redo the install from scratch and everything seems to be working now.

 Cheers

Craig

--- (Edited on 3/28/2008 9:09 am [GMT-0500] by Pentatonic) ---



Back to Top
Rate [
|
]
 
 

Re: Survey2 JSON Reporting by JT - Fri @ 12:50pm

Re: Pagination and Navigation Menus. by eleger81 - Fri @ 12:38pm

Re: Corrupt Asset Tree by bartjol - Fri @ 09:04am

Re: Corrupt Asset Tree by mwille64 - Fri @ 09:01am

Survey2 JSON Reporting by perlmonkey2 - Fri @ 08:46am

7.5.18 translation too by bartjol - Fri @ 06:58am

Re: Corrupt Asset Tree by bartjol - Fri @ 06:42am

Smoketest For nightly_2008-07-25 by Visitor - Fri @ 01:39am

Re: Pagination and Navigation Menus. by colink - Thu @ 04:05pm

Re: Corrupt Asset Tree by mwille64 - Thu @ 02:12pm

Pagination and Navigation Menus. by eleger81 - Thu @ 11:52am

Re: Corrupt Asset Tree by preaction - Thu @ 11:44am

Corrupt Asset Tree by mwille64 - Thu @ 11:18am

Smoketest For nightly_2008-07-24 by Visitor - Thu @ 01:39am

Re: Hello! by crythias - Wed @ 01:13pm