Installing Drupal 7 with Akiban
Dries recently published a post highlighting some work we’ve done with a particular customer in the Acquia cloud. What I wanted to cover in this post was to how to perform an installation of Akiban and get a Drupal 7 site up and running on Akiban. This post only covers a fresh installation; later posts will cover how to do migration and augmenting an existing site instead of running it entirely on Akbian.
This post is specific to Ubuntu but Akiban runs on CentOS too (as well as OSX and Windows which we have installers for). If people would like to see information specific to those platforms, please let me know in the comments.
First things first, lets install Akiban!
<span class="go">sudo apt-get install -y python-software-properties</span><span class="go">sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0AA4244A</span><span class="go">sudo add-apt-repository "deb http://software.akiban.com/apt-developer/ lucid main"</span><span class="go">sudo apt-get update</span><span class="go">sudo apt-get install -y akiban-server postgresql-client</span>
The above will automatically start the Akiban server process and half of your available memory will be allocated for the JVM heap by default. If interested in modifying any configuration options, please see our documention on how to do this.
Next, we’ll download Drupal 7 and install Apache along with the needed PHP database drivers for Akiban.
<span class="go">wget http://ftp.drupal.org/files/projects/drupal-7.17.tar.gz</span><span class="go">tar zxvf drupal-7.17.tar.gz</span><span class="go">sudo apt-get install -y apache2 php5-pgsql php5-gd libapache2-mod-php5 php-apc</span><span class="go">sudo mkdir /var/www/drupal</span><span class="go">sudo mv drupal-7.17/* drupal-7.17/.htaccess /var/www/drupal</span><span class="go">sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php</span><span class="go">sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php</span><span class="go">sudo mkdir /var/www/drupal/sites/default/files</span><span class="go">sudo chown www-data:www-data /var/www/drupal/sites/default/files/</span><span class="go">sudo service apache2 restart</span>
The final piece of software we need is the Akiban database module for Drupal. Right now, this module is a sandbox project on drupal.org so the only way to download it is to check it out with git
:
<span class="go">sudo apt-get install -y git</span><span class="go">git clone http://git.drupal.org/sandbox/posulliv/1835778.git akiban</span><span class="go">cd akiban</span><span class="go">git checkout 7.x</span><span class="go">cd ../</span><span class="go">sudo cp -R akiban /var/www/drupal/includes/database/.</span><span class="go">sudo chown -R www-data:www-data /var/www/drupal/includes/database/akiban</span>
Notice we had to switch to the 7.x
branch. The master
branch in this repository is for running the module with Drupal 8.
The last thing which needs to be done is apply a tiny patch to Drupal core. This patch only avoids the creation of 2 indexes in the menu
module. These index defitions are not compatible with Akiban with our current release. Its likely this will be resolved in a future Akiban release and so the need for this patch will be removed:
<span class="go">sudo cp akiban/core.patch /var/www/drupal</span><span class="go">cd /var/www/drupal</span><span class="go">sudo patch -p1 < core.patch</span><span class="go">cd</span>
Drupal 7 can now be installed as you normally would. Just make sure to select Akiban as the database during installation!
After installation completes successfully we want to group the tables and gather statistics for out cost-based optimizer. 2 SQL scripts are provided to achieve this. They can be run using psql
as so:
<span class="go">psql -h localhost -p 15432 drupal -f akiban/grouping.sql</span><span class="go">psql -h localhost -p 15432 drupal -f akiban/gather_stats.sql</span>
The commands above assume drupal
is the name of schema in which Drupal was installed. That should obviously be changed to the name of the schema you specified during installation.
Thats it! You now have a bare Drupal 7 site running on the Akiban database! I have some plans for more posts in the coming weeks. In particular, some things I plan on covering are how to migrate a Drupal site running on MySQL to Akiban and how to use Akiban as a query accelerator for a Drupal site similar to the use case in the post Dries wrote. I’ll also show what is possible with the REST access that we enable straight to our database (hint: its on port 8091).
If there is anything you would like more information on, please let me know in the comments or hit me up on twitter and I’d be more than happy to dig in. We also have a public mailing list for the Akiban project and I’d encourage anyone who’s interested to subscribe to that list and let us know how we’re doing!