Building MyRocks in MariaDB

This page describes how to get MyRocks in MariaDB when compiling MariaDB from source.

(See for instructions how to build the upstream)

Build process and requirements

MariaDB compile process will compile MyRocks into by default if the platform supports it (That is, no WITH_ROCKSDB switch is necessary).

Platform requirements:

  • A 64-bit platform (due to some 32 bit compilers having difficulties with RocksDB)
  • git installed (or git submodules fetched somehow)
  • A sufficiently recent compiler:
    • gcc >= 4.8, or
    • clang >= 3.3, or
    • MS Visual Studio 2015 or newer

Building on Ubuntu 16.04

The steps were checked on a fresh install of Ubuntu 16.04.2 LTS Xenial.

sudo apt-get update
sudo apt-get -y install g++ cmake libbz2-dev libaio-dev bison zlib1g-dev libsnappy-dev 
sudo apt-get -y install libgflags-dev libreadline6-dev libncurses5-dev libssl-dev liblz4-dev gdb git
git clone mariadb-10.2
cd mariadb-10.2
git checkout bb-10.2-mariarocks
git submodule init
git submodule update
cmake .
make -j10

This should produce storage/rocksdb/ which is MyRocks storage engine in the loadable form.

Starting MyRocks

MyRocks does not require any special way to initialize the data directory. Minimal my.cnf flle:

cat > ~/my1.cnf <<EOF



Run the server like this

(cd mysql-test; ./mtr alias)
cp -r mysql-test/var/install.db ~/data1
cd ../sql
./mysqld --defaults-file=~/my1.cnf

Compression libraries. Supported compression libraries are listed in @@rocksdb_supported_compression_types. Compiling like the above, I get:



Comments loading...