Hi,
I know that fact,
however in default MariaDB settings my. cnf points to !/etc/my.cnf.d/
where server.cnf resides. Also do note that
/etc/my.cnf.d/server.cnf by default stores the configuration for the node.
Also, MySQL init script reads the correct configurations, but does not pass them on to mysqladmin, while calling it from within the init script.
While I do agree an explicit out of environment call to mysqladmin should default to /etc/my.cnf, however if being called from another script it should inherit the environment of its calling script.
Hi Joy!This is reflected in my configuration as:[mysqld]datadir = /datadrive/galera/mysqlsocket = /datadrive/galera/mysql/mysql.sockYou also need to set socket for your client tools. (mysqladmin --print-defaults)$ mysqladmin --help | grep -A2 ^DefaultDefault options are read from the following files in the given order:/etc/my.cnf ~/.my.cnfThe following groups are read: mysqladmin client client-server client-mariadbBest,NirbhayIssue:--------Coming to the issue at hand;When starting the primary component through:$ sudo service mysql bootstrapor,$ sudo service mysqld start --wsrep-new-cluster( Essentially same, as bootstrap differs to start --wsrep_new_cluster )The bootstrap sequence correctly calls mysqldsafe, as below/usr/bin/mysqld_safe --datadir=/datadrive/galera/mysql --pid-file=/datadrive/galera/mysql/ciq-test-db01.pid --wsrep-new-clusterHowever,it then gets stuck in the wait_for_ready() function of /etc/init.d/mysqlThe sequence tries to ping mysqladmin through:if $bindir/mysqladmin ping >/dev/null 2>&1; thenlog_success_msgreturn 0elif kill -0 $! 2>/dev/null ; then: # mysqld_safe is still runningelse# mysqld_safe is no longer running, abort the wait loopbreakIt gets stuck here as the test:if $bindir/mysqladmin ping >/dev/null 2>&1; thenAlways fails and the counter keeps increasing till 900 and Error's out with thelog_failure_msgreturn 1Test:I tested that line from the console as:$mysqladmin ping >dev/null 2>&1and, was thrown the following error:Obviously, '/var/lib/mysql' does not exist in my setup, and the socket file was at '/datadrive/galera/mysql/mysql.sock'mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")'Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!But, my socket can be passed explicitly to mysqladmin by doing,$mysqladmin --socket=/datadrive/galera/mysql/mysql.sock pingThis actually worked as expected and I got the desired output,mysqld is aliveSolution:-----------
What I surmised through my novice abilities was that the init script was not passing the variables it read from /etc/my.cnf.d/server.cnf to mysqladminSo, for now I have done a hackjob by altering the init script function wait_for_ready() with the test:if $bindir/mysqladmin --socket=/datadrive/galera/mysql/mysql.sock ping >/dev/null 2>&1; thenlog_success_msgreturn 0And voila,$ sudo service mysql start$ sudo service mysql start --wsrep-new-cluster$ sudo service mysql bootstrapAll above works. It is evident that I should be passing all the variables from /etc/my.cnf.d/server.cnf that mysqladmin needs to set it's environement correctly.However I think that this could be / should be done on the pre-distributed init script itself rather than a user-side hack.While I have tried to be thorough in my inspection of the issue, I may have missed either something very basic or inherently complex that's currently is inherent to the process of initializing the mysql service. Please redirect me to a corrected course if that is the case.
P.S. First time post in the list, I may have stated things unacceptablyP.P.S. Merry Christmas to you all.Thanks and regards,_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to : maria-discuss@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-discuss
More help : https://help.launchpad.net/ListHelp