Tested on Ubuntu 16.04.7 LTS
Make sure the required development tools are installed:
sudo apt-get update
sudo apt-get -y install g++ cmake libbz2-dev libaio-dev bison \
zlib1g-dev libsnappy-dev libboost-all-dev
sudo apt-get -y install libgflags-dev libreadline6-dev libncurses5-dev \
libssl-dev liblz4-dev gdb git libzstd-dev libzstd0 libcap-devIn MyRocks repository, update submodules.
git clone https://github.com/facebook/mysql-5.6.git
cd mysql-5.6
git submodule init
git submodule updateRun cmake
make . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system \
-DWITH_ZLIB=bundled -DMYSQL_MAINTAINER_MODE=0 -DENABLED_LOCAL_INFILE=1 \
-DENABLE_DTRACE=0 -DCMAKE_CXX_FLAGS="-march=native" \
-DWITH_ZSTD=/usrThen compile
make -j8After compile is done, this will install MyRocks in /usr/local/mysql
sudo make installGo to /usr/local/mysql and initialize MyRocks with following commands.
sudo ./scripts/mysql_install_dbThen, Run MyRocks with RocksDB Plugin.
sudo ./bin/mysqld --user=root --skip-innodb --rocksdb --default-storage-engine=rocksdb --default-tmp-storage-engine=MyISAMDuring mysqld loads RocksDB plugin, it will shows
NewFileTraceWriter Status: 0, 0
StartTrace Status: 0, 0
Each number means (code, subcode). If numbers are 0, it means tracing running successfully. If not, there is an error while starting tracing.
To check, RocksDB loaded successfully, run mysql client.
./bin/mysql -u rootAnd check default storage engine is RocksDB.
SHOW ENGINES;Then do your benchmark and shutoff mysqld.
When mysqld unloads RocksDB plugin, following output have to be printed.
EndTrace Status: 0, 0
Now, you can use the trace file /usr/local/mysql/trace_test to analyze it.