Manual:Installation

From Pinba.org

Jump to: navigation, search


Contents

Installation requirements

Pinba requires MySQL 5.1.x sources to be built and MySQL 5.1.x installation to run.
MySQL 5.1 is the first version which supports pluggable storage engines, so older MySQL versions cannot and will not be supported.

Note:
In order to build Pinba you need to execute ./configure ..options... && cd include && make in MySQL sources, otherwise my_config.h will be missing.
Make sure you use the same configure options for the sources and MySQL server you're going to use (if you don't build it yourself using the same sources), otherwise you might experience unpredictable crashes and other problems. Pay special attention to these options: --with-big-tables, --with-debug.

See also [this bug report].

Libraries required:

Please make sure libevent is 1.4.1+ at the very least, older versions are not supported.

Optionally used:

Using --with-hoard option you can add compiled-in Hoard support. It helps to reduce memory consumption (and Pinba is quite memory hungry when it comes to millions of timers). 2x smaller memory footprint with Hoard is what we regularly see.

Building Pinba engine

Unpack Pinba engine archive and start the good old configure & make procedure:

# ./configure --with-mysql=/path/to/the/sources/of/mysql-5.1 --with-judy=/judy/prefix --with-protobuf=/protobuf/prefix \
--with-event=/event/prefix --libdir=/path/to/mysql/plugin/dir
# make install

--libdir option is required in order to get the library installed into the correct directory (but you can always put the lib there manually). Usually the path looks like <MySQL install prefix>/lib/mysql/plugin, so if you've installed MySQL using /usr/local/mysql prefix, the path should be /usr/local/mysql/lib/mysql/plugin.

Pinba engine installation

After you've installed the plugin into the correct plugin directory, you need to enable it in MySQL.
To do this log in to the MySQL console (as root) and execute the following:

mysql> INSTALL PLUGIN pinba SONAME 'libpinba_engine.so';

We'd also suggest you to create a separate database, this way:

mysql> CREATE DATABASE pinba;

And then create the default tables:

# mysql -D pinba < default_tables.sql

You can create more tables later, but these are the default ones.

Pinba extension installation

In order to build Pinba extension you need Google Protocol Buffers and PHP development package installed, which includes phpize, php-config and PHP headers. When you have it, you may proceed with unpacking the archive with Pinba PHP extension sources and the following commands:

# phpize
# ./configure --with-pinba=<Google Protobuf install prefix>
# make install

You might want to add --with-php-config=/path/to/php-config if php-config script is not in your PATH.
Don't forget to add pinba.so to your php.ini and enable Pinba using pinba.enabled=1, see PHP extension for more details.

Personal tools