Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 30th July 2012, 14:50
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
There is a error in the mysql library indeed, thansk for pointing that out. Ine the datalogSave function, it has to be:

$this->query($sql);

instead of:

$app->db->query($sql);

and the two quote calls should be also to $this. I fixed that in svn. It currently works but it was not intended this way and I had not noticed it cause it worked. I will check the issue regarding permissions.
did you changed only the datalogSave function?
Reply With Quote
Sponsored Links
  #12  
Old 30th July 2012, 15:19
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,624
Thanks: 793
Thanked 4,996 Times in 3,909 Posts
Default

Yes, the other functions used already $this-> as far as I've seen.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #13  
Old 30th July 2012, 15:54
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sys_datalog on master is still not updated by client's cron.
Reply With Quote
  #14  
Old 30th July 2012, 16:25
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

With SVN changes, even the insert on web_backup on master doesn't work anymore. Our permissions are correct.
Reply With Quote
  #15  
Old 3rd August 2012, 16:06
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The same broken query apply on mail stats calculation.
From your daily_cron.php, you are calculating mail traffic saving data to the master db:

Quote:
if($tr['traffic_id'] > 0) {
$sql = "UPDATE mail_traffic SET traffic = ".$mail_traffic." WHERE traffic_id = ".intval($tr['traffic_id']);
} else {
$sql = "INSERT INTO mail_traffic (month,mailuser_id,traffic) VALUES ('".$tstamp."', ".intval($rec['mailuser_id']).", ".$size.")";
}
echo $sql."\n";
$app->dbmaster->query($sql);
($size is one on mine customization, there is no $size in SVN code)


Now, from the interface code (mail_user_stats.php), you are quering the local server and not the master:

Code:
	function prepareDataRow($rec)
    {
		global $app;
		
		$rec = $app->listform->decode($rec);

		//* Alternating datarow colors
		$this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
		$rec['bgcolor'] = $this->DataRowColor;
		
		//* Set the statistics colums
		//** Traffic of the current month
		$tmp_date = date('Y-m');
		$tmp_rec = $app->db->queryOneRecord("SELECT traffic as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month = '$tmp_date'");
		$rec['this_month'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' ');
		
		//** Traffic of the current year
		$tmp_date = date('Y');
		$tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic) as t FROM mail_traffic WHERE mailuser_id = ".$rec['mailuser_id']." AND month like '$tmp_date%'");
		$rec['this_year'] = number_format(intval($tmp_rec['t'])/1024/1024, 0, '.', ' ');
Reply With Quote
  #16  
Old 6th August 2012, 16:22
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

News about this?
Reply With Quote
  #17  
Old 6th August 2012, 16:41
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,624
Thanks: 793
Thanked 4,996 Times in 3,909 Posts
Default

Quote:
From your daily_cron.php, you are calculating mail traffic saving data to the master db:
Thats correct and intended. The stats are only shown on the master so they are saved on the master. If you would save them on the slave, nobody would be able to see them.

Quote:
ow, from the interface code (mail_user_stats.php), you are quering the local server and not the master:
Thats correct as well. The only server that runs a interface in a ISPConfig cluster is the master servers, so when you query the local database in the interface, the amster is queried.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 6th August 2012 at 16:43.
Reply With Quote
  #18  
Old 6th August 2012, 16:43
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,624
Thanks: 793
Thanked 4,996 Times in 3,909 Posts
Default

Quote:
With SVN changes, even the insert on web_backup on master doesn't work anymore. Our permissions are correct.
See #6 in this thread.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #19  
Old 6th August 2012, 21:14
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I still don't understand is:

- is ISPConfiged engineered to have different datas between master and client databases? Actually, some data (mostly coming from crontab) are saved only on master, this will make an inconsistency on the slave itself.

Is this ok?

For example, mail usage statistics are generated by slave crontab and saved on master DB. This will make a different mail_traffic table between master and slave. The slave will be always empty. Is this ok?
Reply With Quote
  #20  
Old 7th August 2012, 08:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 34,624
Thanks: 793
Thanked 4,996 Times in 3,909 Posts
 
Default

Quote:
What I still don't understand is:

- is ISPConfiged engineered to have different datas between master and client databases? Actually, some data (mostly coming from crontab) are saved only on master, this will make an inconsistency on the slave itself.

Is this ok?
Yes, ISPConfig is enginered to store only the nescessary data on a node and not all. The database of a slave contains only the data that is required on that slave locally.

Quote:
For example, mail usage statistics are generated by slave crontab and saved on master DB. This will make a different mail_traffic table between master and slave. The slave will be always empty. Is this ok?
Thats ok. Saving data on a server were this data is not needed for anything makes just no sense. So the statistics data which is only needed on the master is only saved on the master.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm attack brute force qb7 General 6 21st July 2012 21:34
Problem with fetchmail/getmail brianetilley Installation/Configuration 3 27th January 2012 12:15
ISPConfig reports SMTP-server down, with Roundcube installed toffie Installation/Configuration 2 1st December 2011 10:55
Error show pages in server qb7 General 1 31st October 2011 09:09
get thousands of "Mailsize" mails from own server torusturtle Installation/Configuration 20 24th December 2006 14:51


All times are GMT +2. The time now is 07:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.