debian

Installing an rpm on Debian

My days of supporting Debian are numbered.  That isn’t a complaint, it will actually be nice to support one platform soon.  Until then I thought I’d share a little.

I needed to install oci8 to support a PHP application.  In doing this I ran into the following two problems, here are the solutions that worked for me (results may vary).

# apt-get install alien
# alien -d oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm 
error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)
error: cannot open Packages database in /tmp/.rpmdb
error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)
error: cannot open Packages database in /tmp/.rpmdb

The solution for this to do the following:

# rpm --rebuilddb
# alien -d oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm

That worked, next up the fix the pecl issue:

# pecl install oci8
Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249
PHP Stack trace:
PHP 1. {main}() /usr/share/php/peclcmd.php:0
PHP 2. require_once() /usr/share/php/peclcmd.php:31
PHP 3. PEAR_Command::getCommands() /usr/share/php/pearcmd.php:54
PHP 4. PEAR_Command::registerCommands() /usr/share/php/PEAR/Command.php:302

This one was not as obvious, it required a reinstallation as follows:

# apt-get purge php*-xml
# apt-get autoremove php*-xml
# apt-get install php-xml php7.0-xml
# apt-get purge php*-xml
# pecl install oci8
    (now add extension=oci8.so to the follwing ini files)
# vim /etc/php/7.0/apache2/php.ini 
# vim /etc/php/7.0/cli/php.ini 
# php --ri oci8

That should be it.  Good luck

UCARP and Squeeze

IP fault tolerance on Debian Squeeze couldn’t be easier than with UCARP!:

  • Install UCARP on all nodes:
    apt-get install ucarp
  • Edit /etc/network/interfaces on all nodes, replacing <CLUSTER IP> and <PASSWORD> as appropriate:
    iface eth0 inet static
    ...
    ucarp-vid 3
    ucarp-vip <CLUSTER IP>
    ucarp-password <PASSWORD>
    ucarp-xparam -n
    iface eth0:ucarp inet static
    address <CLUSTER IP>
    netmask 255.255.255.255
  • Reboot, and you’re done!  <CLUSTER IP> will now be available from one of the nodes in your cluster at all times!

A few notes:

  • All nodes in your UCARP cluster must be in the same subnet, and the shared cluster IP must also be in the same subnet.
  • UCARP does not do cluster resource management for you, but it does provide hooks.  You will need to write some scripts to handle unmounting/mounting of shared storage, etc.
  • UCARP does not detect service failures, only whole-host (or IP stack) failures.  But if you can detect the failure, simply send SIGUSR2 to the ucarp process to force into passive mode, forcing another node to become master.
All-in-all, about as simple and sufficient as one can get!