Weston, I do this here on my primary gmetad collector. I have built my clusters by function, "Web Servers", "LDAP Servers", etc. Each of these runs on a different port and on the collector I run multiple gmond processes, one for each port.
To do this, I create a conf file for each,
/etc/ganglia/gmond-<port>.conf and modified the startup script to walk
them. My start function in /etc/init.d/gmond now looks like:
start)
echo -n "Starting GANGLIA gmond: "
[ -f $GMOND ] || exit 1
for CONFFILE in /etc/ganglia/gmond-*.conf; do
PORT=`echo $CONFFILE| sed 's/.*gmond-//;s/.conf$//'`
echo -n " [$PORT] ";
daemon $GMOND -c $CONFFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/gmond
done
;;
Stevens, Weston J wrote:
> MUCH obliged. I'll try this stuff out tomorrow and let you guys know how
> things go.
>
> -----Original Message-----
> From: Jesse Becker [mailto:[email protected]]
> Sent: Monday, August 02, 2010 3:19 PM
> To: Rick Cobb
> Cc: Stevens, Weston J; [email protected]
> Subject: Re: [Ganglia-general] Multiple gmonds or gmetads on same host
>
> Ah, then I mis-understood.
>
> Yes, you will need different configurations for this, and will need to make
> use of the -c option (and -p, if you want to track the PID files). The
> different configuration files will still need to make use of different ports
> though. Gmond will run quite happily from the command line.
>
> You can start gmond and gmetad without their respective startup
> scripts--neither one does anything fancy, and both are largely boilerplate
> scripts from Red Hat.
>
> If you want to make a startup script for your test versions then you will
> need to make a new file in /etc/init.d/ for each "new" instance you want to
> run. So /etc/init.d/gmond_test-ramdisk and /etc/init.d/gmond_test-3.1.7, for
> example.
>
> As mentioned, you will need to use different configuration files for each
> gmond instance. It should be simple to add to this to each of the startup
> scripts. For example, on my Centos system, the gmond script has a line at
> the top that reads:
>
> GMOND=/usr/sbin/gmond
>
> This can be changed to
>
> GMOND=/usr/sbin/gmond -c /etc/ganglia/gmond.conf-ramdisk
>
> and nothing else should need to change in the rest of the file--so a minor
> change may be warranted, *if* you want to use init scripts (the use of which
> is not actually required).
>
>
>
>
>
> On Mon, Aug 2, 2010 at 18:07, Rick Cobb <[email protected]> wrote:
>
>> That's a different use-case than I understood Mr. Stevens to be asking
>> about. As I understand it, he wants to test ganglia configurations
>> themselves, not just segment his grid between test clusters &
>> development clusters.
>>
>> E.g., he might want to model his clusters' memberships differently, or
>> run on RRDcache instead of ramdisk, or find out if the latest Python
>> module locks up gmond, etc., without affecting his ability to measure
>> the stuff his team knows works.
>>
>> In that case, he will need to use the '-c' option when starting his
>> daemons. OTOH, there's no reason to touch the stuff in
>> /etc/init.d/functions; *nobody* needs to touch those outside of the
>> fedora/redhat/etc., folks.
>>
>> (That does remind me that you'll probably also need to use the '-p'
>> option to set the pidfile name of each daemon instance.)
>>
>> -- ReC
>>
>> On Mon, Aug 2, 2010 at 2:29 PM, Jesse Becker <[email protected]> wrote:
>>
>>> No, I don't think so.
>>>
>>> I have a server that collects metrics from three different ganglia
>>> "clusters", and just have multiple udp_recv_channel stanzas, one for
>>> each unicast port, and another for each multicast port. I only have
>>> gmond process running, bound to multiple ports. For example:
>>>
>>> udp_recv_channel {
>>> mcast_join = 239.2.11.71
>>> port = 8649 /* cluster */
>>> bind = 239.2.11.71
>>> }
>>> udp_recv_channel {
>>> mcast_join = 239.2.11.71
>>> port = 8648 /* workstations */
>>> bind = 239.2.11.71
>>> }
>>> udp_recv_channel {
>>> port = 8649 /* cluster */ } udp_recv_channel {
>>> port = 8648 /* workstations*/ }
>>>
>>> # lsof -i |grep gmond
>>> gmond 3950 nobody 3u IPv4 32629 UDP
>>> 239.2.11.71:8649 gmond 3950 nobody 4u IPv4 32633
>>> UDP 239.2.11.71:8648 gmond 3950 nobody 6u IPv4 32635
>>> UDP *:8648 gmond 3950 nobody 7u IPv4 32636 UDP
>>> *:8649 gmond 3950 nobody 8u IPv4 32637 TCP
>>> *:8649 (LISTEN)
>>>
>>>
>>> Now, the gmond.conf files in the "cluster" and "workstation" groups
>>> are different, since they need to send to differen port numbers.
>>>
>>> On Mon, Aug 2, 2010 at 16:39, Stevens, Weston J
>>> <[email protected]> wrote:
>>>
>>>> Wouldn't I need different versions of gmetad.conf and gmond.conf, like
>>>> gmetad-test.conf and gmond-test.conf for instance, in order to have
>>>> different ganglia configurations running at the same time? And wouldn't I
>>>> need separate startup scripts for running these different versions, in
>>>> which case the test version startups would need to be changed with the -c
>>>> option?
>>>>
>>>> -----Original Message-----
>>>> From: Jesse Becker [mailto:[email protected]]
>>>> Sent: Monday, August 02, 2010 12:56 PM
>>>> To: Stevens, Weston J
>>>> Cc: Rick Cobb; [email protected]
>>>> Subject: Re: [Ganglia-general] Multiple gmonds or gmetads on same
>>>> host
>>>>
>>>> No changes should be required in the startup scripts. Just changes to the
>>>> gmetad.conf/gmond.conf files are needed.
>>>>
>>>> On Mon, Aug 2, 2010 at 15:41, Stevens, Weston J
>>>> <[email protected]> wrote:
>>>>
>>>>> Great stuff. Is it true that no changes will need to be made to
>>>>> /etc/init.d/functions?
>>>>>
>>>>> -----Original Message-----
>>>>> From: Rick Cobb [mailto:[email protected]]
>>>>> Sent: Monday, August 02, 2010 10:35 AM
>>>>> To: Stevens, Weston J
>>>>> Cc: [email protected]
>>>>> Subject: Re: [Ganglia-general] Multiple gmonds or gmetads on same
>>>>> host
>>>>>
>>>>> It's not all that painful, but you do have to modify those init scripts.
>>>>>
>>>>> First, you'll need a passel of configuration files. E.g.,
>>>>> /etc/ganglia/gmond-test.conf vs. /etc/ganglia/gmond-release.conf; same
>>>>> for gmetad,....
>>>>> You'll need a port set for each configuration (i.e., an equivalent to
>>>>> 8649-8652; say 8749-8752 for 'test' or whatever).
>>>>>
>>>>> Then you'll set up your init scripts so wherever it starts the daemon
>>>>> you're trying to start, it uses the '-c' option to name that
>>>>> configuration's .conf file.
>>>>>
>>>>> And you'll need a copy of the init script per configuration of each
>>>>> daemon. I.e., /etc/init.d/gmond-test, etc . Remember to chkconfig -add
>>>>> each of your "new services".
>>>>>
>>>>> It's probably possible to set up the init script so it inspects $0 to
>>>>> identify the config file; for my use cases it's always been more
>>>>> straightforward to cut & paste.
>>>>>
>>>>> Then you'll need to symlink or copy or git pull or whatever floats your
>>>>> fancy a web tree per configuration, and set up the 'conf.php'
>>>>> file so it points @ the right gmetad for that configuration.
>>>>>
>>>>> Good luck --
>>>>> -- ReC
>>>>>
>>>>> On Mon, Aug 2, 2010 at 9:55 AM, Stevens, Weston J
>>>>> <[email protected]> wrote:
>>>>>
>>>>>> There are a couple uses for this:
>>>>>> 1) Testing different configurations of these daemons on the same
>>>>>> host concurrently and seeing which one we like better
>>>>>> 2) A "release" version and a test version so tests on the test version
>>>>>> will not screw with the release. I'm basically working toward two
>>>>>> separate ganglias running on the same host that don't collide with one
>>>>>> another in any way and basically may as well not know the other one
>>>>>> exists.
>>>>>>
>>>>>> I'm pretty sure I'd like to have this capability. I would just like to
>>>>>> know how? Would I have to change the C source code? I can't seem to do
>>>>>> it with /etc/init.d/gmond and /etc/init.d/gmond and
>>>>>> /etc/init.d/functions scripts alone, this looks like it could be painful.
>>>>>>
>>>>>>
>>>>>>
--
Dan Rich <[email protected]> | http://www.employees.org/~drich/
| "Step up to red alert!" "Are you sure, sir?
| It means changing the bulb in the sign..."
| - Red Dwarf (BBC)
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

