I’m building an infrastructure on a grid using AppLogic, which is a grid OS that provides both GUI and command line interfaces to build your infrastructure. I use both interfaces, depending on the task I’m trying to perform at the time.
One thing I have discovered is that there are a lot of somewhat nebulous concepts, abstractions, lingo, etc., and a number of default configuration settings that make doing really really simple things extremely unintuitive if you’re coming from a (more or less) physical server environment.
Another thing I discovered is that, while AppLogic provides a pretty nice collection of template ‘appliances’ that you can drag around the GUI and connect to each other in various ways, the MySQL appliance in particular is somewhat lacking. Specifically, it’s a MySQL 4.0 server. Lame.
There might be better ways to do all of this, and if you know of any, I welcome the input!! For now, here’s what *I* did to build my own MySQL 5 server:
- In the GUI, at the top of the left pane, choose ‘proto’ from the drop down menu to show the appliances in the ‘proto’ catalog.
- Drag the “LUX5” appliance to the work area in the right pane. This is a very bare-bones appliance. There’s almost nothing installed on it. However, it *is* a CentOS *5* install, and the version of MySQL distributed for this version of CentOS is 5.0.x. Unfortunately, you still don’t have network access, or read-write access to /usr, or enough disk space. The /usr volume is mounted read-only, and is something like 120MB in size.
- Right-click the appliance and choose “Branch Class”. This is super important. If you don’t do this, you can lose any changes you make to the appliance later. Don’t proceed until you do this. Seriously.
- Once done, the first thing to do is right click the appliance, choose ‘Edit Class’, and click the ‘Interfaces’ tab. Create an interface called ‘net’, choose ‘Out’ for the Direction, ‘any’ for the Protocol, and click the ‘Gateway’ button in the Options column. In order to enable this appliance to reach the internet so it can do things like ‘yum install’, you need to connect that ‘net’ interface to a ‘NET’ appliance, which is another AppLogic-supplied appliance whose sole purpose is to be a gateway to the internet for your appliances. If you don’t have one of those yet, you’ll need to add one. See this doc on how to use NET: http://doc.3tera.net/AppLogic2/CatGatewayNet.html – creating this gateway interface will cause a new line to appear in the output of the ‘route’ command when you log in on the device showing your new gateway.
- While you’re in this tab, you can also change the protocol for the ‘in’ interface to ‘mysql’.
- Next, you’ll need to resize “/” and “/usr” on the system. The only way I know how to resize a volume on a specific appliance is using the AppLogic controller’s command line interface. Assuming you didn’t change the class name of your appliance from ‘LUX5’, here are the commands to use:
# ca myapp
# vol resize LUX5.boot size=1G
# vol resize LUX5.usr size=1G
Replace ‘myapp’ with the name of your application. Also note, the app will need to *not* be running when you do this (yes, this means volume resizes require an app restart. Yes this kinda degrades the benefits of virtualization. No, I’m not a fan of how this is implemented) - [UPDATE] forgot to mention: by default, LUX5 has like 40MB of RAM, so when you run ‘yum install whatever’, it’ll be killed at different stages in its work by the Out of Memory (OOM) killer in Linux. Right click the appliance, go to ‘Resources’, and up the minimum and default to at least 256MB. I used 512MB.
- Finally, right click your appliance, go to ‘Edit Class’ again, and then go to ‘Volumes’ and unclick the ‘read only’ button in the Options column for the ‘/usr’ volume.
Once you’ve done all of that, you can finally get some real work done. Run ‘yum install mysql-server’ to get the server installed, and you’re on your way. There are still problems to solve with this setup, such as how to manage the volumes for your data directory, how to set up, for example, phpMyAdmin if you want to use that to manage your MySQL database, and how to use things like memcached in this environment. I guess I’ll blog those as I get to them. Wish me luck!