Page 1 of 3
Gearman Load Balancer Configuration
Posted: Tue Mar 03, 2015 10:43 pm
by rajasegar
NagiosXI 2014R1.2
check_gearman: version 1.4_nagios4 running on libgearman 0.25
I have setup 2 server instances for gearman load balancer.
Can someone give me the steps to do the following
1) Configure gearman slave on the new servers
2) Redirect only requests from particular VLAN segment to this server 1. i.e only 10.10.10.0 & 10.10.11.0 etc
3) Redirect only requests from particular VLAN segment to this server 2. i.e only 10.10.15.0 etc
4) The rest of the VLAN requests stays in the main Nagios server.
Thanks
Re: Gearman Load Balancer Configuration
Posted: Wed Mar 04, 2015 11:43 am
by abrist
1) This is done the way that documentation outlines:
https://labs.consol.de/nagios/mod-gearm ... figuration
2 & 3) You will need to create a hostgroup/servicegroup for each of the gearman servers and then add the checks for each vlan segment to the respective groups. This needs to be done as these groups are how gearman will know which gearman worker to run the checks from. Please read the documentation linked above to familiarize yourself with the configuration options.
4) Easy. As long as your gearman workers are configured to only run checks for specific groups as outlined above, the rest of the checks will still run from the XI server.
Re: Gearman Load Balancer Configuration
Posted: Wed Mar 04, 2015 6:11 pm
by rajasegar
abrist wrote:1) This is done the way that documentation outlines:
https://labs.consol.de/nagios/mod-gearm ... figuration
2 & 3) You will need to create a hostgroup/servicegroup for each of the gearman servers and then add the checks for each vlan segment to the respective groups. This needs to be done as these groups are how gearman will know which gearman worker to run the checks from. Please read the documentation linked above to familiarize yourself with the configuration options.
4) Easy. As long as your gearman workers are configured to only run checks for specific groups as outlined above, the rest of the checks will still run from the XI server.
I still don't get how to define a hostgroup/servicegroup to a specific gearman worker.
Code: Select all
hostgroups
sets a list of hostgroups which will go into seperate queues. //which queue ??
hostgroups=name1,name2,name3
servicegroups
sets a list of servicegroups which will go into seperate queues. //which queue ??
servicegroups=name1,name2,name3
Thanks
Re: Gearman Load Balancer Configuration
Posted: Thu Mar 05, 2015 2:30 am
by Box293
On the master server you define the queues in mod_gearman_neb.conf
Code: Select all
# sets a list of hostgroups which will go into seperate
# queues. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3
# sets a list of servicegroups which will go into seperate
# queues.
#servicegroups=name1,name2,name3
On the specific workers, you define the queues you want them to work on in mod_gearman_worker.conf
Code: Select all
# sets a list of hostgroups which this worker will work
# on. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3
# sets a list of servicegroups which this worker will
# work on.
#servicegroups=name1,name2,name3
Re: Gearman Load Balancer Configuration
Posted: Fri Mar 06, 2015 1:11 am
by rajasegar
Box293 wrote:On the master server you define the queues in mod_gearman_neb.conf
Code: Select all
# sets a list of hostgroups which will go into seperate
# queues. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3
# sets a list of servicegroups which will go into seperate
# queues.
#servicegroups=name1,name2,name3
On the specific workers, you define the queues you want them to work on in mod_gearman_worker.conf
Code: Select all
# sets a list of hostgroups which this worker will work
# on. Either specify a comma seperated list or use
# multiple lines.
#hostgroups=name1
#hostgroups=name2,name3
# sets a list of servicegroups which this worker will
# work on.
#servicegroups=name1,name2,name3
Ok. Thanks. Will try it out
Re: Gearman Load Balancer Configuration
Posted: Fri Mar 06, 2015 11:38 am
by abrist
Great, keep us updated as to your progress.
Re: Gearman Load Balancer Configuration
Posted: Tue Mar 24, 2015 6:45 am
by rajasegar
I setup another worker server as the second worker.
Created a hostgroup for a bunch of servers and set the hostgroups.
Job Server - mod_gearman_neb.conf
hostgroups=LOAD_BALANCER_MSB
Worker 1 - hostgroups option is remarked.
Server 2
Worker 2 - mod_gearman_worker.conf
hostgroups=LOAD_BALANCER_MSB
The problem is almost all the checks are now going to server 2 instead of those related to LOAD_BALANCER_MSB only.
Both servers are in the same segment.
Since firewall rules and routing are not open for both servers most of the checks fails.
Does anyone have any idea what is happening?
In Dev it sort of works fine with the same settings. Occasionally host checks from unrelated servers are sent to worker2.
Re: Gearman Load Balancer Configuration
Posted: Tue Mar 24, 2015 4:30 pm
by tgriep
You posted
Since firewall rules and routing are not open for both servers most of the checks fails.
Unless you can fix the firewall and routing, you will have to setup separate hostgroups for each worker that can reach the hosts that you want to check remotely.
Can you post the gearman server and worker configuration files for those servers?
Re: Gearman Load Balancer Configuration
Posted: Wed Mar 25, 2015 6:24 pm
by rajasegar
tgriep wrote:You posted
Since firewall rules and routing are not open for both servers most of the checks fails.
Unless you can fix the firewall and routing, you will have to setup separate hostgroups for each worker that can reach the hosts that you want to check remotely.
Can you post the gearman server and worker configuration files for those servers?
I only added the hostgroup that the second server should handle but everything is going to it.
I have reverted back the configuration to default since it was not working.
Re: Gearman Load Balancer Configuration
Posted: Thu Mar 26, 2015 5:53 am
by rajasegar
Does anybody have any idea how to configure the worker host groups that works as expected?