Skip to content

Monitoring the MySQL master slave replication status

If you run MySQL in a production environment chances are you are using a master/slave replication set-up. This brings two major benefits: higher availability (multiple nodes to read from) and quicker response times (when doing reads from slaves).

When you are running a master/slave replication set-up, monitoring the replication state becomes critical. Especially when doing reads from slave nodes you want them to stay in sync as much as possible. Using a simple Bash script we can easily monitor the replication link state.

Read on to learn how to detect master/slave replication problems

Categories: MySQL.

Tags: , , ,

Automatic reboot after Linux kernel panic

Kernel panics for all sorts of reasons. Both hardware failures and software failures. It is always important to investigate the reason for the kernel panic so you can resolve it. However, sometimes system update is critical and you want the system to reboot automatically after a kernel panic. Luckily this is very easy to achieve.

Read on to learn how to configure automatic kernel panic reboots

Categories: CentOS Linux.

Tags: , ,

Override excludes and force include packages in yum

Previously I explained how to exclude certain packages from being updated when running yum update. As kernel updates require a system reboot and have a big impact on the system it makes sense to exclude kernel packages from yum update. However, when you want to do a kernel update it’s annoying that you need to change your yum config file to comment the exclude line. Luckily, there’s a handy yum switch for that.

Read on to learn how to force include excluded packages in yum

Categories: CentOS Linux.

Tags: , ,

Change the Vim temp file location

When opening a file with Vim it creates two temporary files:

  • a *.ext~ file, which servers as a backup file in case Vim crashes; and
  • a *.ext.swp file, which stores undo/redo changes and ensures that no two people are editing the same file.

That’s a great function, but it can give problem in “hot directories”: directories that are watched for updates. Opening a file with Vim will then lead to the creation of two additional files, which may trigger an action. We have had this problem while working on an HTML5 app which checks a certain directory for changes to its JS assets: just opening one of the JS files made the app trigger an update. Let’s fix this default Vim behaviour.

Read on to change the Vim swap and temp file location

Categories: CentOS Linux.

Tags: , ,

Installing Gearman PHP extension on CentOS

Recently I’ve covered the installing Gearman on CentOS. A lot of people write their Gearman clients (the application side) or workers in PHP. For this there’s a great PHP extension available, based on the libgearman API. Let’s install this PHP extension.

Read on to learn how to install the Gearman PHP extension on CentOS

Categories: CentOS Linux.

Tags: ,

Keep SSH sessions alive, preventing time-outs

A lot of systems, including CentOS Linux, have the problem that their OpenSSH server is configured not to keep sessions alive. This means that when there’s a short break in the connectivity, for example when your SSH client is on wifi or 3G, the connection to the server is lost and you need to restart the server. Of course you can install and use screen to keep the sessions active even if you disconnect, it’s still a hassle. Let’s fix that!

Read on to learn how to keep SSH sessions alive, preventing time-outs

Categories: CentOS Linux.

Tags: ,

Fixing the LC_CTYPE: cannot change locale (UTF-8) error on CentOS

If you’ve recently upgraded to CentOS 6.3 you might have seen the following error message after logging in to your system via SSH:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

Although it’s easy to asume the problem must be on the server-side (and in a part it is), but you actually have to fix an ssh_config setting on your local system.

Read on to learn how to fix the

Categories: CentOS Linux.

Tags: ,

CentOS 6.3 VMware ESXi 5 network interface problem

I’ve been running CentOS on VMware ESXi 5 hosts for quite some time without any problems. However, after updating CentOS 6.2 to CentOS 6.3 (using the trusty-old ‘yum update’) I found myself presented with the following problem after guest OS reboot:

Bringing up interface eth0: eth0: vmxnet_init_ring alloc_page failed.
RTNETLINK answers: cannot allocate memory

This error is typical for driver issues, so I quickly knew where to look.

Read on to learn how to fix this CentOS networking error on VMware ESXi 5

Categories: VMware.

Tags: ,

Renumber ethernet interface on CentOS Linux to eth0

When changing network cards (either physical or virtual) it’s often the case that the new card gets a higher interface number. For example, your old card was identified as ‘eth0′ and the new card gets identified as ‘eth1′. This may cause problems in your scripts (networking scripts, iptables settings, network traffic counters, etc.). But it’s also not as clean as you would want (you’re obsessive about these things, admit it!). Fortunately, we can easily renumber the ethernet interfaces!

Read on to learn how to renumber your ethernet interfaces

Categories: CentOS Linux.

Tags: , ,

Installing Gearman on CentOS 6.2

For one of our projects we are using Gearman to handle enormous import tasks of CSV files supplied via HTTP upload. Before the dawn of Gearman you could either do the whole import in the session (which is very susceptible to ending prematurely due to user browsing away or the PHP process timing out) or you could run some periodic cronjob to check for work. Nowadays Gearman is the new kid on the block, and damn is he cool.

Read on to learn how to install Gearman on CentOS Linux 6.2

Categories: CentOS Linux.

Tags: ,