Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Install CUBRID remotely with knife-solo and Chef Cookbook

This tutorial is a part of CUBRID Chef Cookbook series where I show how to install CUBRID Database, its drivers and tools, and configure High-Availability and Database Sharding with a single command.

Unlike in previuos tutorials, in this tutorial I will not use Vagrant. Instead, I will show how to install CUBRID on a remote Linux server using knife-solo, another great command line tool which allows to cook (i.e. install) cookbooks on remote machines. It's really easy, you will see!


  1. A remote Linux server which you can SSH. It can be a local virtual machine.
  2. knife-solo installed via gem or source code on your working machine.

Getting Started

I will assume that you have already created a remote Linux server which you can connect to via SSH. Therefore I will directly show how to install knife-solo on your local development machine.

Install knife-solo prerequisites

knife-solo is available in RubyGems repository, therefore it can be installed via gem. But in this tutorial we will install knife-solo from its source code because the knife-solo gem on RubyGems is old. Actually it's just because the latest code in Github has not been released yet.

To build and install knife-solo from the source code, we need gem and bundler programs. If they are already installed on your working machine, you can proceed to the next step. If they are not, you can install them as shown below.

Debian based Linux

sudo apt-get install rubygems libxslt-dev libxml2-dev unzip git
sudo gem install bundler rdoc-data
sudo rdoc-data --install

This will install gem program, XML libraries which bundler program depends on, unzip necessary to extract knife-solo source code from ZIP archive, git necessary to download cookbooks, bundler and rdoc-data gems.

RPM based Linux

sudo yum install rubygems ruby-devel libxslt-devel libxml2-devel unzip git wget
 sudo gem install bundler rdoc-data
 sudo rdoc-data --install

Build knife-solo

unzip master*
cd knife-solo-master
sudo bundle
sudo bundle exec rake install

This will download the source ZIP from knife-solo Github repo, etract it, build the source, and install the generated knife-solo gem.

Check knife-solo

Type the following command to check if knife-solo has been successfully installed. You should see something like:

~$ gem list | grep knife
knife-solo (0.2.0.pre2)

Prepare the working directory structure

Once knife-solo is ready, we go and create a directory structure where we will be working.

mkdir cubrid-knife
cd cubrid-knife
knife solo init .

This will create a cubrid-knife directory in your user home directory where knife-solo will initialize the working directory. The directory structure that knife-solo will create looks as follows:


Prepare the remote server

Once we have initialized the working directory on our local working machine, we need to prepare our remote server. For this run knife solo prepare command by specifying your remote server username and IP. In this case, my remote server username is user, and remote server IP is By default SSH port number which knife-solo will use to connect to your remote server is 22. If it is different from the default value, you can specify it with additional -p option.

~$ knife solo prepare user@
WARNING: No knife configuration file found
Bootstrapping Chef...
Enter the password for user@ 
--2013-02-11 23:02:58--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6471 (6.3K) application/x-sh
Saving to: `'

100%======================================> 6,471       --.-K/s   in 0s      

2013-02-11 23:02:59 (956 MB/s) - `' saved 6471/6471

Downloading Chef  for ubuntu...
Installing Chef 
Selecting previously unselected package chef.
(Reading database ... 24087 files and directories currently installed.)
Unpacking chef (from .../tmp.Afy1f2L1/chef__amd64.deb) ...
Setting up chef (11.2.0-1.ubuntu.11.04) ...
Thank you for installing Chef!
Generating node config 'nodes/'...

This will:

  1. prepare the remote Linux server by installing a Chef Client;
  2. generate a nodes/ configuration file for this particular remote server with an empty runlist which means no cookbook will be installed until we populate the runlist manually.

Download necessary cookbooks

Now we can go and download all cookbooks we want to install on our remote Linux server. In this tutorial we will install the latest version of CUBRID Database Server, PHP, Python, and Perl drivers.

cd ~/cubrid-knife
git init
git submodule add cookbooks/cubrid
git submodule add cookbooks/build-essential
git submodule add cookbooks/mysql
git submodule add cookbooks/openssl
git submodule add cookbooks/perl
git submodule add cookbooks/php
git submodule add cookbooks/python
git submodule add cookbooks/yum
git submodule add cookbooks/xml

This will clone each cookbook under cookbooks/ directory.

Choose which cookbook to install

Once we have downloaded the cookbook, we need to tell knife-solo that we want to cook a particular cookbook. For this we need to add the cookbook name to the runlist. Edit the nodes/ file as shown below.


This will tell knife-solo, which will tell to Chef installed on the remote server, to install CUBRID Database, its demodb database, PHP/PDO, Perl, and Python drivers, as well as CUBRID Web Manager, all from cubrid cookbook that we have downloaded.

Cook the remote server

Now as we are ready to cook our remote Linux server, let's do it.

~$ knife solo cook user@
Checking Chef version...
Enter the password for user@ 
user@'s password: 
user@'s password: 
user@'s password: 

Starting Chef Client, version 11.2.0
Compiling Cookbooks...
Converging 58 resources
Chef Client finished, 48 resources updated

Bingo! You have installed CUBRID and all the necessary drivers and even a Web Manager on your remote server.

Testing CUBRID Web Manager

Let's access CUBRID Web Manager at Notice HTTPS and 8282 port. The default username and password to connect to CUBRID Manager Server are admin/admin. Once you login for the first time, CWM will prompt you to change the password. Visit CWM Wiki for more information and tutorials.


If you have questions, feel free to ask at CUBRID Q&A site, forum, our Facebook page, Twitter, or online chat.

If you have issues or feature requests to cubrid-cookbook, create a new issue at its Github repo.

comments powered by Disqus
Page info
viewed 11489 times
translations en
posted 4 years ago by
Esen Sagynov
updated 4 years ago by
View revisions
Share this article