
30th July 2012, 14:50
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by till
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?
|

30th July 2012, 15:19
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
Yes, the other functions used already $this-> as far as I've seen.
|

30th July 2012, 15:54
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
sys_datalog on master is still not updated by client's cron.
|

30th July 2012, 16:25
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
With SVN changes, even the insert on web_backup on master doesn't work anymore. Our permissions are correct.
|

3rd August 2012, 16:06
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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, '.', ' ');
|

6th August 2012, 16:22
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
News about this?
|

6th August 2012, 16:41
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
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.
Last edited by till; 6th August 2012 at 16:43.
|

6th August 2012, 16:43
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
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.
|

6th August 2012, 21:14
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

7th August 2012, 08:42
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,184 Times in 3,202 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 16:13.
|
Recent comments
1 day 7 hours ago
1 day 15 hours ago
1 day 18 hours ago
1 day 20 hours ago
1 day 21 hours ago
1 day 23 hours ago
2 days 36 min ago
2 days 1 hour ago
2 days 17 hours ago
2 days 18 hours ago