All posts by admin

MySQL 5.5 Server as Replication Slave

I had some trouble configuring a MySQL 5.5 Server as Replication Slave as I c&p’ed the configuration data into the slaves’s my.cnf: MySQL did not not start.

A look into the error log showed:

[ERROR] /opt/lampp/sbin/mysqld: unknown variable 'master-host=1$
[ERROR] Aborting

Obviously the Replication Master data cannot be set in slave my.cnf for MySQL 5.5 Server, though the my.cnf sample files still proposes this.

To define the Replication Master, connect through a shell to your MySQL server and enter:

mysql> CHANGE MASTER TO MASTER_HOST='N.N.N.N', 
MASTER_PORT=N,
MASTER_USER='NAME', 
MASTER_PASSWORD='PASSWORD';

This will create a master.info file, where this data and information about the master bin-log and the log position is stored.

Start the replication:

mysql> START SLAVE;

Confirm your configuration:

mysql> SHOW SLAVE STATUS \G;

Piwik Notes #1 :: Cascading Include References

In ‘index.php’ (line 35) a ‘testMinimumPhpVersion.php’ is required. If you comment this line out, taking it for what it seems, Piwik dies with a Fatal Error, since the file includes another file, which defines necessary functions etc.

This is an example for using Cascading Include References. Do not take this as a role model for software development, it makes your code confusing, since you do not expect an all-purpose loader defined in a file ‘upgrade.php’ included in a file ‘testMinimumPhpVersion.php’ required in your ‘index.php’. Dig it?

Btw, PHP version and Zend PHP4 compatibility mode indeed are checked in the ‘testMinimumPhpVersion.php’, and, if inappropriate, a warning message is defined, but not displayed at first. Why not? A function showing error messages in an indeed! ‘friendly UI’ is defined. Then, if a warning message is set, this function is called with the warning message.

Don’t do this, unless you intend to rename your error message display function every now and then. Keep your processes in logical blocks, the refactoring guy will be grateful.

The mentioned error message display function is referenced in five different files.

The checks for PHP version and Zend PHP4 compatibility mode can be commented out once your Piwik instance is running, due to scalability reasons, such tests belong to a prerequisite check upon the installation process.

Piwik is a high end Open Source Web Analytics Tool.