Install WebScaleSQL from source on Debian/Ubuntu

Install WebScaleSQL from source

In this post we will see together how to install and configure WebScaleSQL from source using as a base Debian or Ubuntu Linux distribution.

WebScaleSQL is a new fork of MySQL with the purpose of equipping it with the feature of scalability and speed required in case of important traffic. The development team behind WebScaleSQL is formed by engineers of Facebook, Google, LinkedIn and Twitter, and the version currently used as a base is MySQL 5.6.

At the moment there is no WebScaleSQL binary package in the repository, so it is necessary to install it from source: Let’s see what is the correct procedure for your installation.

Installing prerequisites

To compile WebScaleSQL are required the same dependencies of MySQL 5.6 which this fork is based.

The packages to be installed are:

CMake
sudo apt-get install cmake
GCC
sudo apt-get install gcc
LibAIO
sudo apt-get install libaio-dev
Curses
sudo apt-get install libncurses5-dev
LibReadLine
sudo apt-get install libreadline-dev
Bison
sudo apt-get install bison
GIT
sudo apt-get install git
perl
sudo apt-get install perl

Clone WebScaleSQL from GitHub

WebScaleSQL code is released in OpenSource mode and is hosted on GitHub: therefore we will use git to clone the repository as a whole and, therefore, have the ability to maintain continuously updated our installation.

To clone WebScaleSQL, navigate to the directory where will store the source and run the following command:

cd /usr/local/src
git clone https://github.com/webscalesql/webscalesql-5.6.git 

Rights

You must create a user that will be run WebScaleSQL:

groupadd mysql
useradd -r -g mysql mysql

Compile

Now it is time to proceed with the compilation; navigate to the directory created by git and run:

cmake .

If at this stage it returns an error such as a missing library, you have to resolve the dependency and clean your CMakeCache.txt.

The next operation will last long, so once launched you can safely go to drink a cup of coffee:

make

Installation

Once the build process is done, let’s do the install. For the installation are needed administrator privileges:

sudo make install

Base configuration and test

Now that the whole process of installation is finished, you must perform the basic configuration. First of all we create the necessary files for WebScaleSQL:

cd /usr/local/mysql
sudo chown -R mysql .
sudo chgrp -R mysql .
sudo /usr/local/mysql/scripts/mysql_install_db –defaults-file=/usr/local/mysql/my.cnf --user=mysql

Now modify the file /usr/local/mysql/my.cnf adding the line:

...
socket=/var/run/mysqld/mysqld.sock

Finally we add the service to system startup:

sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql.server

To test WebScaleSQL issue the command:

sudo /usr/local/mysql/bin/mysqld_safe

Leave a Reply

Your email address will not be published. Required fields are marked *

4 × four =