2015/07/12

Backups with duply: the root file system

I like duply, but unfortunately there is not much in the documentation about best practices or howtos. So here is the first post in my duply series: how to back up the root file system.

The obvious approach is to set SOURCE=/ in the duply conf file and we are done. The problem is there are lots of other filesystems mounted under root, like /sys, /proc, /dev, /run, etc. So we could come up with a long list of excludes and try it that way and this setup would still be wrong and fragile.

The correct way to do this is to bind mount the root filesystem somewhere else, and back up that mountpoint. This way we shall get the root, the whole root and nothing but the root. So create a pre script like this:

# This script shouldn't have chmod +x because in older duply version we don't have access to variables like $SOURCE

set -o pipefail
set -o nounset
set -o errexit

# Bind mount:
if ! mountpoint -q "$SOURCE"; then
 mount "$REAL_SOURCE" "$SOURCE" -o bind
 mountpoint "$SOURCE" || exit $?
fi
Now add a new variable into the duply conf file and change the SOURCE variable to the bind mountpoint. I like to use /mnt/root-bind:
# The duply pre script will bind mount $REAL_SOURCE under $SOURCE
REAL_SOURCE="/" 
SOURCE="/mnt/root-bind"
One more thing to take care of is now we will have to make sure duply doesn't start the backup in case the pre script fails. So instead of starting the backup with
duply $profile backup
we'll have to do it like this:
duply $profile pre_and_bkp
That's it, enjoy your root filesystem backups.

Coming up next: how to run duply from cron, how to encrypt and sign your backups, how to backup btrfs, lvm, mysql and svn repos.

2015/05/19

lsmcli with netapp on ubuntu

Skimming through the RHEL 7.1 Release Notes on Storage I noticed libStorageMgmt, and got curious. Netapp provides an oncommand system manager rpm, which when extracted works on ubuntu too, but it starts a web application on localhost and then opens a browser, and that's how you manage the storage. Yuck! So let's try this libStorageMgmt stuff:

$ suod apt-get install libstoragemgmtd libstoragemgmt-tools

$ lsmcli
Traceback (most recent call last):
  File "/usr/bin/lsmcli", line 19, in 
    import lsm.cmdline
  File "/usr/lib/python2.7/dist-packages/lsm/__init__.py", line 23, in 
    from smis import Smis
  File "/usr/lib/python2.7/dist-packages/lsm/smis.py", line 20, in 
    import pywbem
ImportError: No module named pywbem

$ sudo apt-get install python-pywbem

$ sudo service libstoragemgmtd start
$ sudo gpasswd -a paul.tobias libstoragemgmt

$ lsmcli --list=SYSTEMS
ID         | Name     | Status
-----------+----------+-------
1918101635 | netapp01 | OK    

$ lsmcli --list POOLS
ID                                   | Name  | Total space    | Free space    | System ID 
-------------------------------------+-------+----------------+---------------+-----------
c6b01446-7146-11e3-a01e-123478563412 | aggr0 | 11322462519296 | 3456236142592 | 1918101635

$ lsmcli --list POOLS -H
ID                                   | Name  | Total space | Free space | System ID 
-------------------------------------+-------+-------------+------------+-----------
c6b01446-7146-11e3-a01e-123478563412 | aggr0 | 10.30 TiB   | 3.14 TiB   | 1918101635

$ lsmcli --list FS -H
ID                                   | Name                      | Total space | Free space | Pool ID                             
-------------------------------------+---------------------------+-------------+------------+-------------------------------------
c7b367ea-7146-11e3-a01e-123478563412 | vol0                      | 171.00 GiB  | 164.84 GiB | c6b01446-7146-11e3-a01e-123478563412
7ff4e8db-bb3b-11e3-821a-123478563412 | vms                       | 4.75 TiB    | 1.63 TiB   | c6b01446-7146-11e3-a01e-123478563412
04d28a88-12f9-425a-8149-5b70d1d9951d | brush_backup_restore_test | 2.50 TiB    | 2.46 TiB   | c6b01446-7146-11e3-a01e-123478563412
2f228ee9-4b09-4ce2-9e05-ca5bcdbbcc7c | brush_extra               | 1.00 TiB    | 63.63 GiB  | c6b01446-7146-11e3-a01e-123478563412
5548a33d-d0f7-4dd1-ac49-3ca07f5d76a9 | test                      | 1.24 GiB    | 1.23 GiB   | c6b01446-7146-11e3-a01e-123478563412

$ lsmcli --list EXPORTS
Key            | Value                                                  
---------------+--------------------------------------------------------
ID             | 998e7bde67701ad96ebb14cbb5927c90                       
File system ID | 7ff4e8db-bb3b-11e3-821a-123478563412                   
Export Path    | /vol/vms                                               
Authentication | sys                                                    
Root           | 172.28.50.100, 172.28.50.63, 172.28.50.62, 172.28.50.61
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | f962aa0dc595c52f676bc3d52b8e9c92                       
File system ID | c7b367ea-7146-11e3-a01e-123478563412                   
Export Path    | /vol/vol0                                              
Authentication | sys                                                    
Root           | 172.28.50.21                                           
Read/Write     | 172.28.50.21                                           
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | f962aa0dc595c52f676bc3d52b8e9c92                       
File system ID | c7b367ea-7146-11e3-a01e-123478563412                   
Export Path    | /vol/vol0/home                                         
Authentication | sys                                                    
Root           | 172.28.50.21                                           
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | 8aa21057ed71d0c1b579db8ea1f3e5ae                       
File system ID | 2f228ee9-4b09-4ce2-9e05-ca5bcdbbcc7c                   
Export Path    | /vol/brush_extra                                       
Authentication | sys                                                    
Root           | 172.28.5000.21, 172.28.50.100                          
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | ca24797f40f9b55a2c6aa8174f1f0fee                       
File system ID | 04d28a88-12f9-425a-8149-5b70d1d9951d                   
Export Path    | /vol/brush_backup_restore_test                         
Authentication | sys                                                    
Root           | 172.28.50.100                                          
Read/Write     | 172.28.50.100                                          
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   

$ lsmcli --create-fs=test --size 1G --pool c6b01446-7146-11e3-a01e-123478563412
ID                                   | Name | Total space | Free space | Pool ID                             
-------------------------------------+------+-------------+------------+-------------------------------------
5548a33d-d0f7-4dd1-ac49-3ca07f5d76a9 | test |  1326075904 | 1325924352 | c6b01446-7146-11e3-a01e-123478563412

Sweet! I can finally forget that oncommand system manager and use the command line to manage netapp.

2014/02/26

scp protocol error: mtime.sec not present

After setting up a chroot sftp as described here https://wiki.archlinux.org/index.php/SFTP-chroot, I ran into a problem. Trying to scp fails with the following error:
protocol error: mtime.sec not present
There was no google result for this error, so I'm documenting it, maybe it will come handy for others. The best thing to do in this case is to run scp -v. That gave me a bit more information:
Sink: This service allows sftp connections only.
protocol error: mtime.sec not present
And really, silly me, trying scp where I should use sftp. And indeed, with sftp it works.

2014/02/15

"Boot failed: Could not read from CDROM (code 0003)" on ganeti

I couldn't find the right pages with a google search for the following error while booting a virtual machine on ganeti:
Boot failed: Could not read from CDROM (code 0003)
The virtual machine was started to boot from a cdrom like this:

gnt-instance start -H kvm:boot_order=cdrom -H cdrom_image_path=/boot/systemrescuecd-x86-4.0.0.iso $INSTANCE

The problem is that ganeti by default uses the same value for cdrom_disk_type than what's set for disk_type. This means if you set disk_type=paravirtual, then you'll get the following as a parameter to kvm:
-drive file=/boot/systemrescuecd-x86-4.0.0.iso,format=raw,media=cdrom,if=virtio
and this fails to boot because of the if=virtio part. It seems the kvm bios can't boot from virtio cdrom. The best way to fix this is to change cdrom_disk_type from default to scsi or ide:
gnt-cluster modify -H kvm:cdrom_disk_type=scsi

2014/01/13

File "something.php" is writeable by group on cPanel

On a cPanel system, if your php files are group writable, then you'll get HTTP 500 Internal Server Errors, and the following in /usr/local/apache/logs/error_log (not in the error_log in the documentroot):

SoftException in Application.cpp:256: File "/home/netfecom/subdomains/store/index.php" is writeable by group
Premature end of script headers: index.php
This check is silly, as cPanel uses user private groups. All the resources on google will tell you something like do a chmod g-w or change umask to 022. But the whole point of user private groups is to have the files group writable by default. So we need to change suphp behaviour. But unfortunately the config file is not anywhere where you would look for it, and searching for "configure suphp cpanel" leads to nothing. So the key information is that it can be found at /opt/suphp/etc/suphp.conf. These changes will do:
--- /opt/suphp/etc/suphp.conf.orig 2014-01-13 15:21:07.000000000 -0500
+++ /opt/suphp/etc/suphp.conf 2014-01-13 15:22:04.000000000 -0500
@@ -28,9 +28,9 @@
 
 
 ; Security options
-allow_file_group_writeable=false
+allow_file_group_writeable=true
 allow_file_others_writeable=false
-allow_directory_group_writeable=false
+allow_directory_group_writeable=true
 allow_directory_others_writeable=false
 
 

Correctly install xdebug on cPanel

There is a lot of conflicting and incomplete information about this around so let me write how to correctly install xdebug on a cPanel system.

First we need to actually install the xdebug php extension. This will of course not work with yum because cPanel replaces the distro php with it's own source-compiled one. So we'll need to install it through cPanel. Go to WHM -> Software -> Module Installers -> PHP Pecl -> Manage. In the search box type "xdebug", for me it currently shows version 2.2.3. Click install. It looks that it actually configures php.ini correctly and if you verify it with phpinfo(), then it actually works.

But in reality it doesn't work properly. You'll get the following messages in the error_log:

PHP Warning:  Xdebug MUST be loaded as a Zend extension in Unknown on line 0
This is annoying and fills up the logs fast. So go to WHM -> Service Configuration -> PHP Configuration Editor -> Advanced Mode. Look for "extension", you'll find that the value is "xdebug.so", delete it.

The above will take care of the warning in the error_log, but xdebug will stop working. For it to work again look for "zend_extension", you'll see "xdebug.so" as a value there, so everything looks fine. But the trick is, that you need to use the full path here. You can find it on the install screen, for me it is /usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so. Save the configuration and voila, xdebug works and there is no warning in the error_log.

PS: If you know how to do these from the command line, I'd appreciate it.

2014/01/05

Installing sysbench on cPanel

I'm making a note of it because it was non-trivial and no google search led me to the solution.

The problem is that the sysbench package won't install on cPanel infested CentOS:

# yum install sysbench
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                                                                            |  24 kB     00:00     
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
base                                                                                                                                                                                                     | 3.7 kB     00:00     
epel                                                                                                                                                                                                     | 4.2 kB     00:00     
epel/primary_db                                                                                                                                                                                          | 5.8 MB     00:00     
extras                                                                                                                                                                                                   | 3.4 kB     00:00     
updates                                                                                                                                                                                                  | 3.4 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sysbench.x86_64 0:0.4.12-5.el6 will be installed
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Running transaction check
---> Package postgresql-libs.x86_64 0:8.4.18-1.el6_4 will be installed
---> Package sysbench.x86_64 0:0.4.12-5.el6 will be installed
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Finished Dependency Resolution
Error: Package: sysbench-0.4.12-5.el6.x86_64 (epel)
           Requires: libmysqlclient_r.so.16()(64bit)
Error: Package: sysbench-0.4.12-5.el6.x86_64 (epel)
           Requires: libmysqlclient_r.so.16(libmysqlclient_16)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

The problem is that cPanel adds exclude=mysql* to /etc/yum.conf. But even when ignoring the excludes, installing sysbench won't work:

# yum install --disableexcludes=all sysbench
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sysbench.x86_64 0:0.4.12-5.el6 will be installed
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: sysbench-0.4.12-5.el6.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be installed
---> Package postgresql-libs.x86_64 0:8.4.18-1.el6_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                    Arch                                              Version                                                     Repository                                       Size
================================================================================================================================================================================================================================
Installing:
 sysbench                                                   x86_64                                            0.4.12-5.el6                                                epel                                             74 k
Installing for dependencies:
 mysql-libs                                                 x86_64                                            5.1.71-1.el6                                                base                                            1.2 M
 postgresql-libs                                            x86_64                                            8.4.18-1.el6_4                                              base                                            201 k

Transaction Summary
================================================================================================================================================================================================================================
Install       3 Package(s)

Total download size: 1.5 M
Installed size: 4.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mysql-libs-5.1.71-1.el6.x86_64.rpm                                                                                                                                                                | 1.2 MB     00:00     
(2/3): postgresql-libs-8.4.18-1.el6_4.x86_64.rpm                                                                                                                                                         | 201 kB     00:00     
(3/3): sysbench-0.4.12-5.el6.x86_64.rpm                                                                                                                                                                  |  74 kB     00:00     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                           9.4 MB/s | 1.5 MB     00:00     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
 Userid : EPEL (6) 
 Package: epel-release-6-8.noarch (@epel/6.5)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/mysql/charsets/README from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp1251.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/koi8r.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/koi8u.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/latin1.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/latin2.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/latin5.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/latin7.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/macce.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/macroman.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/charsets/swe7.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
  file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64

Error Summary
-------------

Ok, let's try to install without dependencies:

# yumdownloader sysbench
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
sysbench-0.4.12-5.el6.x86_64.rpm                                                                                                                                                                         |  74 kB     00:00     
# rpm -ivh sysbench-0.4.12-5.el6.x86_64.rpm 
warning: sysbench-0.4.12-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
 libmysqlclient_r.so.16()(64bit) is needed by sysbench-0.4.12-5.el6.x86_64
 libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by sysbench-0.4.12-5.el6.x86_64
 libpq.so.5()(64bit) is needed by sysbench-0.4.12-5.el6.x86_64
# rpm -ivh --nodeps sysbench-0.4.12-5.el6.x86_64.rpm 
warning: sysbench-0.4.12-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:sysbench               ########################################### [100%]
Great, we have sysbench installed now, but it doesn't work:
# sysbench
sysbench: error while loading shared libraries: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
And here comes the trick, quoting cPanel support:
I can't guarantee that this will work, however the file you need is located at /usr/lib64/libmysqlclient_r.so. You may try creating a symlink from the missing file to this file to see if that resolves this issue.

# ln -s /usr/lib64/libmysqlclient_r.so /usr/lib64/libmysqlclient_r.so.16

Please note that the version installed is /usr/lib64/libmysqlclient_r.so.18 while you need /usr/lib64/libmysqlclient_r.so.16 so there is a chance that this may not work with this library, however if it will work the above should do it.
We are not done yet though, because after symlinking it still doesn't work:
# ln -s /usr/lib64/libmysqlclient_r.so /usr/lib64/libmysqlclient_r.so.16
# sysbench
sysbench: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
But that's easy to solve:
root@three [~]# yum whatprovides libpq.so.5
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
postgresql-libs-8.4.18-1.el6_4.i686 : The shared libraries required for any PostgreSQL clients
Repo        : base
Matched from:
Other       : libpq.so.5



root@three [~]# yum install postgresql-libs
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql-libs.x86_64 0:8.4.18-1.el6_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================================
 Package                                                    Arch                                              Version                                                     Repository                                       Size
================================================================================================================================================================================================================================
Installing:
 postgresql-libs                                            x86_64                                            8.4.18-1.el6_4                                              base                                            201 k

Transaction Summary
================================================================================================================================================================================================================================
Install       1 Package(s)

Total size: 201 k
Installed size: 624 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : postgresql-libs-8.4.18-1.el6_4.x86_64                                                                                                                                                                        1/1 
  Verifying  : postgresql-libs-8.4.18-1.el6_4.x86_64                                                                                                                                                                        1/1 

Installed:
  postgresql-libs.x86_64 0:8.4.18-1.el6_4                                                                                                                                                                                       

Complete!

And now we are finally happy. There is still a warning on stderr, but seems to work fine (I didn't test the mysql benchmarks):

# sysbench --version
sysbench: /usr/lib64/libmysqlclient_r.so.16: no version information available (required by sysbench)
sysbench 0.4.12