By default, MySQL Cluster sends log data to a file but you can also send it to the console or to Syslog; this article explains how to send it to Syslog. The example given here is for LINUX.
In this example, I’ll use the “user” syslog facility name and so the first step is to make sure that syslog is configured to route those messages. If this hasn’t already been configured then add the following lines to /etc/rsyslog.conf:
1
2
|
<span style="color: #993300;"># Log user messages to local files </span><span style="color: #993300;">user.* /var/log/user</span> |
For the changes to take effect, restart the syslog service:
1
2
3
|
<span style="color: #993300;">[root@ws1 etc]# service rsyslog restart </span><span style="color: #993300;">Shutting down system logger: [ OK ] </span><span style="color: #993300;">Starting system logger: [ OK ]</span> |
Note that you should make those changes as root.
Still as root, start up a stream of any additions to the new log file:
1 |
<span style="color: #993300;">[root@ws1 etc]# tail -f /var/log/user</span> |
To tell Cluster to use Syslog, add this line into the [ndb_mgmd] section in config.ini:
1 |
<span style="color: #993300;">LogDestination=SYSLOG:facility=user</span> |
and then start up your Cluster as normal.
You should now be able to see that MySQL Cluster information is being logged to /var/log/user.
You can adjust how much information is logged either through the config file or from the ndb_mgm tool, for example – to see when global checkpoints are written:
1
2
3
|
<span style="color: #993300;">ndb_mgm> all clusterlog checkpoint=15 </span><span style="color: #993300;">Executing CLUSTERLOG CHECKPOINT=15 on node 3 OK! </span><span style="color: #993300;">Executing CLUSTERLOG CHECKPOINT=15 on node 4 OK!</span> |