Master / Slave(s) patch for Cacti 0.8.7b
Moderators: Developers, Moderators
Master / Slave(s) patch for Cacti 0.8.7b
Hi !
Here's my simple modification to have a master / slave architecture. Just replace the original poller.php with the one below and:
1- install cacti on slave servers without the DB setup. Install the new poller.php also.
2- configure cacti to use the existing master mysql server. (and set-up mysql for remote TCP connections)
3- run 'poller.php --slave' in the cron, on slaves.
4- if a device should use a slave poller, simply add 'slave:theslavehostname' in the device's notes field.
Note that time sync between the master and the slaves is important so use NTP.
All suggestions are welcome ! Only a few dozen lines were modified for this first implementation, so it's not optimal regarding the current threads/processes launched by the poller. Anyway it works !
Ludovic.
Here's my simple modification to have a master / slave architecture. Just replace the original poller.php with the one below and:
1- install cacti on slave servers without the DB setup. Install the new poller.php also.
2- configure cacti to use the existing master mysql server. (and set-up mysql for remote TCP connections)
3- run 'poller.php --slave' in the cron, on slaves.
4- if a device should use a slave poller, simply add 'slave:theslavehostname' in the device's notes field.
Note that time sync between the master and the slaves is important so use NTP.
All suggestions are welcome ! Only a few dozen lines were modified for this first implementation, so it's not optimal regarding the current threads/processes launched by the poller. Anyway it works !
Ludovic.
Last edited by ldrolez on Thu Feb 21, 2008 9:28 am, edited 1 time in total.
Updated poller.php
Hi !
I've fixed the 'slaves must be last' bug. However, please note that the slaves should not run 'poller.php --slave', before the master, because the "poller_output" table would be cleared by the master.
So here is my crontab entry:
*/5 * * * * sleep 20;php /home/cacti-0.8.7b/poller.php --slave >/tmp/poller.log 2>&1
I've attached an updated version of poller.php and the patch fof Cacti 0.8.7b.
Cheers,
Ludo.
I've fixed the 'slaves must be last' bug. However, please note that the slaves should not run 'poller.php --slave', before the master, because the "poller_output" table would be cleared by the master.
So here is my crontab entry:
*/5 * * * * sleep 20;php /home/cacti-0.8.7b/poller.php --slave >/tmp/poller.log 2>&1
I've attached an updated version of poller.php and the patch fof Cacti 0.8.7b.
Cheers,
Ludo.
- Attachments
-
- poller.php.gz
- (4.88 KiB) Downloaded 641 times
-
- poller.php.patch.gz
- (2.4 KiB) Downloaded 598 times
-
- Posts: 18
- Joined: Tue Oct 02, 2007 3:19 pm
- chrisgapske
- Cacti User
- Posts: 278
- Joined: Tue May 22, 2007 7:56 am
- Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL
1) you realize this is being talked about to be implemented in the future, right? http://forums.cacti.net/viewtopic.php?t=24869
2) Consider submitting it to http://www.cacti.net/bugs.php
2) Consider submitting it to http://www.cacti.net/bugs.php
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Also, just to note, I have basically took the same concept and made a plugin using it. You can select a poller per device using a drop down menu. New slave Pollers automatically register themselves with the master. It also doesn't require any wierd stuff like making sure the master poller runs first. Doesn't work with boost though, as it actually uses a few of the same concepts (separate poller_output table).
I'm still working on a few minor things, but overall seems to work just fine.
I'm still working on a few minor things, but overall seems to work just fine.
-
- Cacti User
- Posts: 175
- Joined: Sun May 27, 2007 5:42 pm
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I'm trying to free up some of my rare personal time these days, evident by my absence on the forums, to remove the fundamental issues that prevent us from doing the remote pollers.
I have given this topic so much thought, I need to do the development, so I can make some room in my brain for other things
TheWitness
I have given this topic so much thought, I need to do the development, so I can make some room in my brain for other things
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Take all the time you need, to achieve this milestone in the Cacti architecture.TheWitness wrote:I'm trying to free up some of my rare personal time these days, evident by my absence on the forums, to remove the fundamental issues that prevent us from doing the remote pollers.
I have given this topic so much thought, I need to do the development, so I can make some room in my brain for other things
TheWitness
Let's have a talk about your ideas at the 3.CCC.eu (via Skype) at the 11.october 2008.
We're all very curious.
regards
-Frizz
Cacti 0.8.6j | Cactid 0.8.6j | RRDtool 1.2.23 |
SuSe 9.x | PHP 4.4.4 | MySQL 5.0.27 | IHS 2.0.42.1
Come and join the 3.CCC.eu
http://forums.cacti.net/viewtopic.php?t=27908
SuSe 9.x | PHP 4.4.4 | MySQL 5.0.27 | IHS 2.0.42.1
Come and join the 3.CCC.eu
http://forums.cacti.net/viewtopic.php?t=27908
Who is online
Users browsing this forum: No registered users and 2 guests