The online copy of a database into slave.

For some time I have been thinking that the export of a large database from master into slave w/o a long breake in the production is not possible. In case you profit from LVM, it seems quite simple… I tested the b/m solution with my database which is 233G in size. A simple description of […]

Read more...

Git (many scripts on many boxes)

This post describes the situation when you keep different scripts on many servers and the aim is to aggregate them into one project as well as to ensure the versioning feature. Create a repository [e.g. sdiserverapps]. Create a branch [e.g. srv2]. You have to ensure that the option “–single-branch” is available, in contrary compile git: […]

Read more...

NFS4

I used Fedora (F16) with SELinux. On the start I advice to disable the firewall on the box where the exports are shared. I made chcon to all my exported directories: chcon -t nfs_t /home chcon -t nfs_t /home/phos # -R means reccurence chcon -R -t nfs_t /home/phos/www And encountered the following problems: 1. Cannot […]

Read more...

Firebird: downgrade to 1.5.6 problem

gbak: creating indexes gbak: ERROR: invalid request BLR at offset 2129 gbak: ERROR: BLR syntax error: expected invalid BLR code at offset 2129, encountered 181 gbak: Exiting before completion due to errors How to repeat: Backup (with gbak from version 1.5) only metadata (-m option), e.g. /opt/firebird/bin/gbak1.5 -m -g -l -b -k -e -v -t […]

Read more...

Load balance for MySQL (HaProxy vs. pure Keepalived)

My basic need was to balance to traffic between MySQL Slaves according to the application needs. Due to the MyISAM storage on some databases I let to some applications the delay up to 120 s. (I measured the delay with MySQL command `show slave status`. I created two clusters: 1) Slaves – no delay; 2) […]

Read more...

iscsi with MySQL

When the economy meets the performance the iScsi comes into play! I am using 1Gb ethernet between the target and the initiator (both on CentOs 6.3). The target consists of the 3ware controller with 4 SSD Ocz Vertex 3. So, the backing-store is the device /dev/sda/ (/etc/tgt/targets.conf). Next, Parted and LVM configured on the target […]

Read more...

Syslog & Mysql

Add to the configuration file in the section mysqld_safe [mysqld_safe] syslog Restart your rdbms and check whether your mysqld logs to your syslog file. In the contrary remove in the starting script redirecting output and background at the executing mysqld_safe $bindir/mysqld_safe –datadir=”$datadir” –pid-file=”$mysqld_pid_file_path” $other_args # >/dev/null 2>&1 & Do you see the following message? “Can’t […]

Read more...

When Sphinx Search v. 0.9.9 ends

My source data grew and grew until I encounted the problem with the version 0.9.9. 1. INDEXER While building index I received the following warning: WARNING: duplicate document ids found I checked it twice and the source data were not duplicated. This is the sample of the indexer output when the a/b warning occurred. collected […]

Read more...

Extraction of multi rows queries

Sometimes, I had encountered the problem with getting the full query which was divided into many rows (as a result of developer scripting or a literal containing NEW LINE). To obtaing the full query (I needed mainly REPLACE/INSERT) I use the following trick: #!/bin/bash # get the content w/o white NL, EOL. Input=$(cat < /tmp/my.file) […]

Read more...

MySQL queries snapshot

The gathering of the general logs would adversely affect the performance, it would take the significant space on your devices. The continuity of this log is neighter used. But sometimes it would be nice to see what is going on at runtime – I used to do the fallowing hack: # MySQL configuration file my.cnf […]

Read more...