OpenStack is an excellent cloud operating system, and it is wise for developers, administrators, and operators to have the skills associated with them in their virtual toolkit. Efficient cloud requires an efficient database and can accept multiple databases. But what if you want IBM? DB2 for OpenStack, what should I do? OpenStack does not support DB2 by default.
This short exercise shows how to implement DB2 support in a OpenStack environment. The 6 steps involved include:
Collect materials before starting.
Install the database access package.
Add additional support for the DB2.
Use the OpenStack script.
Configure OpenStack for DB2.
Run OpenStack and DB2.
Let's get started.
1th step: Collect material before starting
OpenStack is built on top of some other packages in Python 2.7 and Ubuntu 11.10 (64-bit environment version). IBM DB2 is the target database that you want to be able to support. Before you begin, you need the following elements:
A physical machine.
An operating system, such as Ubuntu 11.10 or later, should be a 64-bit operating system.
A programming language, such as Python 2.7+. For Python, run the following command when the system is ready:
sudo apt-get install python-software-properties
sudo apt-get update, sudo apt-get install Python-dev Libaio-dev
Install Pip:sudo apt-get Install Python-pip
Install ez_setup:sudo pip Install ez_setup
It is recommended that DB2 version 9.7 or later be used.
Step 2nd: Install the database access package
SQLAlchemy is a Python SQL toolkit and an object-relational mapper that supports SQL for Python application developers with an enterprise-class persistence model suite designed to enable efficient and High-performance database access. SQLAlchemy attempts to treat databases like relational algebra engines, rather than as a collection of tables, to accommodate two sizes and performance principles and abstract principles.
The object-relational mapper in SQLAlchemy (mapping classes to databases in an unlimited number of ways) supports the development of object models and database schemas in a completely decoupled way.
Sqlalchemy-migrate is the schema migration tool. It provides a way to handle database schema changes in SQLAlchemy projects and provides a database change repository mechanism that can be used either on the command line or within Python code.
Download SQLAlchemy. Install using the sudo pip install sqlalchemy==0.7.2 (or any version you choose).
Download Sqlalchemy-migrate. Because DB2 is not supported, install a patch Ibmdb2.patch for DB2 (see download section). Save the patch in the Sqlalchemy-migrate root folder and run the command-p1 < Ibmdb2.patch. Next, install the sqlalchemy-migrate.