Using MySQL on Openshift - Red Hat's public cloud
- It's based on a gear and cartridge concept that abstracts container provisioning.
- Application deployment through Git, updating the application with each push to the remote repo.
Cartridges are what provide the run-time for each of the supporting technologies. Remote access is through a Web console and a dedicated SSH client (RHC). For the purpose of this post, we'll go through the following scenario:
1. Creating a new application on Openshift
2. Deploying the MySQL gear
3. Deploy the phpMyAdmin gear
4. Accessing phpMyAdmin to manage the database instance
5. Port forwarding to attach a local machine MySQL administration software
For the first step, you'll first have to:
- Register on Openshift
- Install the client tools, according to these instructions
- Configure the client tools for remote access.
After successfully finishing the pre-requisites, you can create a new application, called "mysqllab" for our MySQL scenario, with the PHP programming language specified using the following command:
C:\mysqllab> rhc app create mysqllab php-5.4
It will create the application with the PHP cartdrige. OpenShift provides a wide range of languages and services, deployed in applications through a cartridge. Cartridges can be web frameworks, databases, monitoring services, or connectors to external backends:
On the following step, we'll provision the MySQL gear, to provide a database server for our scenario. To add it to the "mysqllab" application, use the command:
On the following step, we'll provision the MySQL gear, to provide a database server for our scenario. To add it to the "mysqllab" application, use the command:
C:\mysqllab> rhc cartridge add mysql-5.5 -a mysqllab
After the database gear creation, you're presented with the database credentials information. You can also access those credentials at any time using the Web console:
C:\mysqllab> rhc cartridge add phpmyadmin -a mysqllab
Going over to the Web console, our gears are presented on the application. You can open phpMyAdmin from the popout link. The username and password are the same as the database credentials:
You can save the phpMyAdmin cartridge if you forward the MySQL port and use your local admin software to attach and manage the database server. To perform port forwarding, enter on the the command line:
C:\mysqllab> rhc port-forward -a mysqllab
Afterwards, try connecting your usual DBA tool. While the command prompt window is open, the ports are forwarded to and from the local host:
If you need some help to get things going and go deeper into Red Hat's cloud platform, I recommend the book Learning OpenShift
.
If you need some help to get things going and go deeper into Red Hat's cloud platform, I recommend the book Learning OpenShift
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment