Bug #57867 mysql service script not using my.cnf
Submitted: 31 Oct 2010 1:37 Modified: 29 Jun 2011 13:37
Reporter: Andrew Chapman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:7.1.8 OS:Linux
Assigned to: Hartmut Holzgraefe CPU Architecture:Any

[31 Oct 2010 1:37] Andrew Chapman
Description:
Running mysql using the service script /etc/init.d/mysql installed by default ignores cluster options in my.cnf (possibly the whole file)

How to repeat:
I've installed MySQL-Cluster-client-gpl-server-7.1.8-1.rhel5.i386.rpm

service mysql start 
mysqld starts but ignore all the config in /etc/my.cnf (which happens to be the ndb-connectstring. So, it doesn't connect to the cluster

/usr/sbin/mysqld --user=mysql
mysqld starts and connects to the cluster

I've checked the obvious things and excluded them as causes:
my.cnf is read only (definitely not world readable)
no other my.cnf overriding mine (did find / -name "*.cnf" -print to be sure)
[31 Oct 2010 3:02] Andrew Chapman
Further investigation suggests that /etc/my.cnf is being examined (adding garbage produces unknown variable errors but it just doesn't have any effect on the cluster config.
[1 Nov 2010 3:35] MySQL Verification Team
Uploading a copy of your my.cnf would be helpful here.

Also, can you confirm if your service script is using mysqld_safe or the mysqld daemon? The can usually be seen by a variable set at the start, something like:

use_mysqld_safe=0
[1 Nov 2010 7:44] Andrew Chapman
The problem occurs with a minimal my.cnf as follows (I gradually pared it down to be sure I didn't have a bad variable in there).

[mysqld]
ndbcluster
ndb-connectstring=<ip>:1187

[mysql-cluster]
ndb-connectstring=<ip>:1187

I have two ndb_mgmd instances on the management server. One on port 1186 for a version 5.0.41 cluster and the current one. The old one is not running though.

use_mysqld_safe=1
[19 Nov 2010 12:28] Hartmut Holzgraefe
Would it be possible that there are two different mysqld binaries on the system, and that "service start mysql" starts a different one than that in /usr/sbin/ ?

A comparison of 

  SELECT VERSION();

and 

  SHOW VARIABLES LIKE '%ndb%';

might provide further insight, together with the output of

  ps aux | grep mysqld
[20 Dec 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[12 May 2011 1:21] Rui Ferr
I am experiencing the same problem and have checked that only one binary is used and the selects return the exact same result.
[12 May 2011 1:25] Rui Ferr
It is really weird..

If i do "/etc/init.d/mysql start" mysqld does not connect to the cluster and i get :

110512  2:16:02 [Note] NDB: NodeID is 100, management server '127.0.0.1:1186'
110512  2:16:03 [Note] NDB[0]: NodeID: 100, no storage nodes connected (timed out)
110512  2:16:03 [Warning] NDB: server id set to zero - changes logged to bin log with server id zero will be logged with another server id by slave mysqlds

but if i do a 'ps aux' and run the EXACT same mysqld_safe command, everything works!
[28 Jun 2011 18:08] Jon Stephens
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
[28 Jun 2011 18:54] Rui Ferr
For me the problem was solved by disabling selinux
[29 Jun 2011 13:37] Jon Stephens
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.
[19 Mar 2012 10:54] Aleksey Hariton
Want to reopen this bug, mysqld dont work properly with ndb-connectstring from my.cnf
MySQL Cluster installed from RPM package for RHEL (MySQL-Cluster-server-gpl-7.2.4-1.rhel5.x86_64.rpm).

# cat /etc/my.cnf

[mysqld]
ndbcluster
#IP of the management server(MGM)
ndb-connectstring=10.253.16.114:1186
default-storage-engine=NDBCLUSTER
[mysql_cluster]
#IP of the management server(MGM)
ndb-connectstring=10.253.16.114:1186

# ps -ef | grep mysql

/bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/hostname.pid

For "SHOW VARIABLES ..." look at file vars1.txt

As you can see "ndb_connectstring = 10.253.16.114:1186", but I have error while creating table:

mysql> CREATE TABLE ctest (i INT) ENGINE=NDBCLUSTER;
ERROR 157 (HY000): Could not connect to storage engine

BUT when I start mysql in such way:

/bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/hostname.pid --ndb-connectstring=10.253.16.114:1186 &

All works properly

For "SHOW VARIABLES ..." look at file vars2.txt
[19 Mar 2012 10:54] Aleksey Hariton
vars1.txt

Attachment: vars1.txt (text/plain), 14.34 KiB.

[19 Mar 2012 10:55] Aleksey Hariton
vars2.txt

Attachment: vars2.txt (text/plain), 14.34 KiB.