Pages

Welcome to My Blog

This is to share my IT experience with friends all around the world.
I have been working in Linux Fedora Systems for more than 8 years. Its fun to share knowledge and learn..
As everyone knows when a problem arises in your systems "googling" is the way that many depend on..

All the posts here are my working experiences during my working life.. So you can count on it..

I have added the references where I got help in solving IT issues


Friday, May 16, 2014

Display Time in Horde IMP

I have faced the issue of displaying date/time in Horde IMP mail client in several occasions. I have rectified those issues but failed to post it in my blog.

OK, today I had the same issue with Horde Groupware 5.1.4 IMP mail client. It displayed a wrong time for the mail arrival time.


As Horde uses PHP functions for time variable settings, the time zone setting in php.ini should be corrected according to your standard time zone.

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone ="Asia/Colombo"

Replace "Asia/Colombo" with your preferred time zone, and horde will display the correct mail arrival times accordingly.

Thursday, October 3, 2013

PHP Warning: date(): It is not safe - PHP Warning

I got this warning whenever my site was accessed. It is just a warning but error log is filled.I searched in the Internet and identified it can be simply rectified by changing the configurations at php.ini

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

By default it was commented and I have set to my time zone as follows

date.timezone = Asia/Colombo

The correct time zone values relevant to your location are listed here
http://www.php.net/manual/en/timezones.php

Good Reference
http://www.php.net/manual/en/timezones.php

Monday, May 6, 2013

MySQL error 1236: Client requested master to start replication from impossible position

We are using MySQL replication to synchronise databases in master and slave servers.(If you want to know how to set up mysql mirroring please read How To Set Up Master Slave Replication in MySQL)

Due to power failure, two servers got rebooted and we identified the replication process has not started. The mysqld.log (/var/log/mysqld.log) showed the following error:

[ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)

We tried to identify the updates missing in the slave mysql server but due to lack of information it was not possible. The only information we got from the client's log file was the location (binary file and its position) that it tried to read from the master side. It was observed the binary log file in the master server side was somewhat newer to the location indicated in the slave server side.

Ex: Client was tried to read up to log mysqld-bin.00045 and position 234994 but the serve had the newer binary log (say mysqld-bin.00048).

After referring the several web resources, we understood these positions at the slave and master can be observed by following mysql commands;

Client side status:
mysql> show slave status;
It displays the status of the slave and importantly parameters
 Master_Log_File   | Read_Master_Log_Pos
These are the positions client tries to read from master.

In the master side using the show master status command give the current location of the master. If the locations (positions) are not the same, the synchronization fails.

What to do next?
If you can synchronise two databases manually, do it (I did it with tar zip command).
Check the position of the master with show master status and set the same position parameters at the slave server.
Use following commands to set the master server parameters at the slave server;

mysql>slave stop; 
mysql>CHANGE MASTER TO MASTER_HOST='master-database.example.com', MASTER_USER='username', MASTER_PASSWORD='password', MASTER_LOG_FILE='new_binary_log_file', MASTER_LOG_POS=new_position; 
mysql>slave start;

Check the status of the replication referring /var/log/mysqld.log and show slave status command. Check Slave_IO_Running | Slave_SQL_Running parameters of the output of the show slave status. Both these parameters should be 'Yes'.



mysql>slave stop; 
mysql>CHANGE MASTER TO MASTER_HOST='master-database.example.com', MASTER_USER='username', MASTER_PASSWORD='password', MASTER_LOG_FILE='new_binary_log_file', MASTER_LOG_POS=new_position; 
mysql>slave start;

Check the status of the replication referring /var/log/mysqld.log and show slave status command. Check Slave_IO_Running | Slave_SQL_Running parameters of the output of the show slave status. Both these parameters should be 'Yes'.

I found the following references very useful in the error detection/correction process.

http://www.brianklug.com/w/page/15052161/MySQL%20Error%3A%20Client%20requested%20master%20to%20start%20replication%20from%20impossible%20position

http://dev.kafol.net/2011/09/mysql-error-1236-client-requested.html