Bug #34958 New parameter to name a cluster for logging and identification purposes
Submitted: 29 Feb 2008 10:03
Reporter: Henrik Ingo Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: cluster, config.ini

[29 Feb 2008 10:03] Henrik Ingo
Description:
Use case / background:

A customer had the following idea which I thought I should suggest as a new feature and might be at least reasonably simple to implement. (This is a convenience request, not critical.)

The general context is a site running multiple MySQL clusters. These could be independent databases or replicating each other. Further, log messages are consolidated by a 3rd party or proprietary monitoring server. The problem in such a setting is that a single log line doesn't contain any hostname or other info where it would be immediately obvious *which* cluster the message is from.

Ex.
2007-12-20 08:20:43 [MgmSrvr] ALERT    -- Node 1: Node 3 Disconnected

We know that Node 3 disconnected, but in which cluster?

The same question is also valid in other use cases where log messages are detached from their original context, for instance copy-pasted into an email.

It is worth mentioning that currently the monitoring application/server could insert Cluster identification information itself, based on the source the messaging arrived from (each cluster has separate log file, etc...). Yet, it would be convenient if it is possible to implement directly in the MySQL Cluster.

How to repeat:
tail /var/log/mysql.log

Suggested fix:
For instance:

Introduce parameter
[ndb default]
ClusterName= Ebba

And output logs as

2007-12-20 08:20:43 [Ebba MgmSrvr] ALERT    -- Node 1: Node 3 Disconnected

Alternatively, use current HostName parameter and add that into log. Yet this is often an ip address, thus not as informative and is also longer than a name might be. (And it is per node name, not per cluster.)