Start Zend DBi MySQL daemon in PASE to review start up errors

Most Zend DBi MySQL daemon start up issues can be resolved by reviewing the known issues covered in the troubleshooting article:

Troubleshoot Zend DBi MySQL daemon start up failures (mysql.sock)

However, there may be a situation where none of the known issues seem to be the problem.  Even if one of them is, checking for that problem may not show it, for some reason.  As it happens, I have never seen a start up issue that could not be resolved from the known issues, but did once have an occasion where the customer misunderstood the instructions to check for a port conflict.  We did not know that at the time, of course.  But I came up with this procedure to check for PASE messages, and it did show us the port conflict.  So, if nothing else, this makes a good safety net, in case something is missed in researching the known issues.

This technique is also useful in researching errors for other PASE processes run by the various Zend Server components.  This article is specific to the Zend DBi MySQL daemon, but other problems can be researched by using the correct job queues and PASE programs.

For this example, I have set up a port conflict at port 3306 that will prevent the daemon from starting.  This is a known issue, but the hope is that the same procedure could reveal a helpful message that could be used to analyze and resolve a previously unknown issue.

To begin, please sign on to a 5250 session as QSECOFR or as a *SECOFR class user.

Please enter this command:

call qp2term

This will bring you into the PASE shell.

The first thing to do in the PASE shell is to check for any active MySQL processes. Please enter this command:

ps ax

This brings up a list of processes. Search the list for a process running /usr/local/mysql/bin/mysqld, or any other file named mysqld. There may be many pages, so page up and down as needed to see them all. Here is a partial example output, including a process running mysqld:

11242 - A 0:00 /usr/local/ZendSvr/bin/php-cgi.bin 
11243 - A 0:00 /usr/local/ZendSvr/bin/php-cgi.bin 
11281 - A 0:00 /usr/local/mysql/bin/mysqld --defaults-file=/usr/local 
11284 - A 0:00 /QOpenSys/usr/bin/-sh -i

In this example, we see the process number 11281 is running MySQL. If there is a MySQL process running, and you did not start it from the menu, check the following article for more information on how to deal with it:

Some problem with mysql.sock prevents Zend DBi MySQL daemon from starting

If there was no mysqld process running, please stay in the PASE shell and continue with the next steps.

Attempt to start MySQL in the PASE shell using this command:

/usr/local/mysql/bin/ start

If all is working OK, you would expect to see this message:

-n Starting MySQL ...

And after a small wait, the PASE shell prompt (usually a dollar sign or pound sign) should reappear. The normal message can appear even if the daemon does not start.  However, we want to try this step to see if there is any error in the shell script

If the normal message appears, please run the ps ax command again to see if mysqld is running.  If it is, then the MySQL daemon is running successfully, and there is no PASE problem.  Kill the process using the PASE kill command and the process number.  In this example we are killing process 11281:

kill 11281

If the daemon started, there is no need to continue checking for PASE messages.  Continue to the final debugging step:

Maximize job logging for the Zend DBi MySQL daemon start up job

In our example, the normal message did appear, but the daemon did not start.  So we will continue looking for a PASE message. This next command will run the mysqld program directly, without any shell script.   This command is long, so please try to copy and paste from here into your PASE shell.

/usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/bin/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysqldata --port=3306 --user=mysql --socket=/tmp/mysql.sock --pid-file=/usr/local/mysqldata/ --tmpdir=/tmp

If there is a problem in PASE, you should see an error when running this command.  Here is our example result:

/usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/bin/my.cnf --bas
edir=/usr/local/mysql --datadir=/usr/local/mysqldata --port=3306 --user=mysql
 --socket=/tmp/mysql.sock --pid-file=/usr/local/mysqldata/ --tmpdir
Warning: World-writable config file '/usr/local/mysql/bin/my.cnf' is ignored 
140314  0:17:09 [Warning] Setting lower_case_table_names=2 because file syste
m for /usr/local/mysqldata/ is case insensitive                              
140314  0:17:09 [Warning] One can only use the --user switch if running as ro

140314  0:17:09 [Note] Plugin 'FEDERATED' is disabled.
140314  0:17:09  InnoDB: Initializing buffer pool, size = 8.0M               
140314  0:17:09  InnoDB: Completed initialization of buffer pool             
140314  0:17:09  InnoDB: Started; log sequence number 0 44233                
140314  0:17:09 [ERROR] Can't start server: Bind on TCP/IP port: Address alre
ady in use                                                                   
140314  0:17:09 [ERROR] Do you already have another mysqld server running on 
port: 3306 ?                                                                 
140314  0:17:09 [ERROR] Aborting                                             

140314  0:17:09  InnoDB: Starting shutdown...                                
140314  0:17:15  InnoDB: Shutdown completed; log sequence number 0 44233     
140314  0:17:15 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete        


Notice the errors highlighted in red.  They pretty much tell us exactly what the problem is, and even suggest we may have another server running on port 3306.  Remember that for this example I deliberately set up a port conflict at 3306.  If you are working with Zend Support on this issue, you can copy and paste your error messages into your case email, for Zend Support to review.

If the command runs OK and MySQL starts up, you may not see the PASE prompt return. Just use F3 to return to command entry, then use the call qp2term command again to get back in to the PASE shell. You can use the ps ax and kill commands as shown above to verify mysqld is running, and to end it.  If this is the case, that mysqld started OK using the PASE command, then there is not a PASE issue.  Please continue to the final debugging step:

Maximize job logging for the Zend DBi MySQL daemon start up job


Bookmark the permalink.

Leave a Reply