chusiang / mysql-master-master

Automatically exported from code.google.com/p/mysql-master-master
GNU General Public License v2.0
1 stars 1 forks source link

Patch: Common configuration file for mmmd_mon and mmmd_agent #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[Message/Patch from Chris on mmm-devel-list.]

I created a patch file that moves many of the common configuration
options into mmm_common.conf.

This also required modifying config.pm so it could understand an
"include mmm_common.conf" option, and them process that filename.
(This required changing the "Invalid line ###" message to report the
line that is broken, rather than the line number that is broken. If
you need to show the actual file/line#, it wouldn't be too difficult
to change that).

Other things that changed:
lib/agent_commands.pm:128 - This is the only spot $config->{mode} is
used. That can be replaced with $config->{host}->{$host_name}->{mode}
to prevent having to specify the host mode in multiple places.

Same with bin/sync_with_master; let's only have the 'peer'
specification in one spot

I also changed the 'example' configuration files. Since there are now
far fewer options in the 'agent' and 'mon' .conf files, this should be
easier for people to understand.

I have only tested this in the most basic way; I don't have a test
framework to make sure everything is working correctly (and that I
didn't break anything major). If this is something you want to apply
to trunk, it absolutely needs to be better tested first.

[google mail messed up the patch, will add it later]

Original issue reported on code.google.com by m...@pascalhofmann.de on 8 Nov 2008 at 7:59

Attachments:

GoogleCodeExporter commented 9 years ago
It's probably also worth mentioning that the "include" statement is used to 
specify
common configuration options that could (theoretically) be overwritten in the 
'agent'
or 'mon' configuration file. The "include" statement (that is used to include 
the
common config file) is equivalent to including all the lines in the included 
file in
the source file, at the location where the 'include' statement was.

If the common file specifies a particular option, and that option is again 
specified
later on in the 'agent' or 'mon' config file, the option specified last will 
take
precedence. 

Original comment by christem...@gmail.com on 10 Nov 2008 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago
Added in r148. Thanks for the patch chris.

Original comment by m...@pascalhofmann.de on 15 Nov 2008 at 6:45