Skip to content

Musings of an Anonymous Geek

Made with only the finest 1's and 0's

Menu
  • About
  • Search Results
Menu

AppLogic Cheat Sheet

Posted on January 11, 2008 by bkjones

I’ve been using AppLogic for exactly one month today, and I’ve learned a whole heckuva lot about what it takes to build an infrastructure using the AppLogic grid operating system. One of the very first things I learned is that there is just a TON of documentation, but a very large portion of it is really heady, high-level theoretical stuff. The real practical, nuts-n-bolts, ‘click-here-type-this’, how-to-style knowledge can be had from there, but it’s kinda lost in all the nebulous conceptual stuff. I got fantastic help from 3tera in their forums, as well as from TGL, which is our actual grid host, so I wanted to take a moment and write down some tips here for my own reference, and to help anyone else who is tired of searching forum posts for this information.

1. Creating placeholder volumes, at time of writing, isn’t documented, and is a really important operation you’re going to need to know how to do. The point of confusion is that when you use a catalog appliance, you can see in the “Volumes” tab of the class editor that there’s a volume mounted to /dev/hdaN, and maybe some other volumes defined by default. This sets the expectation that if *you* create a volume, map it to /dev/hdaN, and then map a User Volume to that, then when the appliance starts up again, everything will magically fall into place. This is not how AppLogic works. You *still* need to start the application, log into the appliance, create the mount point, and edit /etc/fstab to get the mount to actually happen. You can test if it works without restarting your application by running ‘mount -a’ after you edit /etc/fstab. If that doesn’t work, then you might’ve forgotten to save the application after you created the volume. Save and restart, and try again.

2. Getting shell access to the controller is one of the first things you’ll want to do after finding your way around. The controller gives you access to all applications, all components of those applications, and all volumes used by those components. It’s quite powerful. You can get a shell on the controller from the dashboard just after you log in, but it’s kinda slow and clunky (“java-like” if you will), so you’ll want to use your own terminal application. In order to access the controller, you *must* use an ssh key. You can’t log in with a password at time of writing (and I prefer it that way). Generate an ssh key, and either send your public key to a support person and tell them to put it in place, or you can try using the “Shell Login” button on the dashboard and running this command in the resulting window:

user set <username@domain.com> sshkey="ssh-dss AAAAB3NzaC...afdk5lqEGOfJJnM+L4="

Once you do that, you can log in as root@ip.of.controller.host from your local terminal application. If you’re using openssh, you can create a ~/.ssh/config file and put in the following so that running “ssh controller” will take you to the right place automagically:


Host controller
HostName ip.of.controller.host
IdentityFile id_rsa
User root

3. If you’ve set up SSH access to the controller, you can save yourself the trouble of setting up a development box or similar that acts as the only machine with write access to your web content by uploading content directly through the controller. Here’s the general syntax:

scp myfile root@controller:/app/<appname>/<component>/mnt/data/.

That will copy ‘myfile’ in the current working directory on my local machine to /mnt/data on the component named in <component> in the app named <app>.

Since the controller has write access to everything, all you need to know is the upload path, and your web developers can use sftp to manage the site’s files. I haven’t set up my developers yet – but I’m using this sftp/scp access to volumes mounted on *running* appliances already myself during the infrastructure building and testing phase. The ability to do this through the controller has saved me a lot of headaches, as well as some disk, network, cpu, and memory resources. It also keeps you from trying what I tried: creating a placeholder volume mounted read-only by the web servers, but read-write by a dev server. It is *documented* that this will corrupt the volume. The controller would appear to be an exception to that rule.

4. If you’re using the bash shell, you might find these client side macros for bash useful!

5. In setting up MySQL, you typically do a ‘GRANT <somerights> TO <someuser>@<somehost> IDENTIFIED BY…’ to give appropriate rights to your web application. However, you’ll find at this point an interesting tidbit: your database cannot resolve your web server, and can’t otherwise connect to it except in response to calls made by the web server to the database server over the terminal you’ve defined on the web server for the sole purpose of talking to the database server. This terminal, in all default template applications at least (and it’s recommended, I would imagine), is defined to only support calls to a mysql database, and can only connect to the database server. Further, assuming it’s the only thing connected to the database server, you *can* use ‘<someuser>@’%” in your GRANT statement. In MySQL, “%” is a wildcard meaning ‘any’. If you need to give different rights to connections coming in from different hosts to the same server and database on that server, I guess the expectation is that you do that by defining different users, which seems reasonable.

6. If your app fails, the first thing you should do is run ‘log list n=30’, which spits out the last 30 lines of the controller’s log. If a particular component causes your whole app to fail to start, you can stop the app, make changes to that component, mark the component as ‘standby’, bring up the app (which will now succeed because the troubled component isn’t in the startup list), and you can then use ‘component <name> start’ and ‘component <name> stop’ to see if it’s working properly. Also, try using ‘app start –debug’! Unfortunately, changes to the appliance in the GUI editor require an application restart to take effect. I hear they’re working on that :-/

7. Stuff I am still working on which isn’t documented but which I know is possible: creating assemblies (in other words, creating a single component from multiple logical components), and linking *applications* together as if they’re components, which would be awesome to be able to do, because then if you have, say, 4 web servers, you can group them into two separate applications, separate from everything in the main application, and if you need to make changes to the web servers that would require a whole-app restart, you can just restart the app containing the two web servers. I’m working on figuring both of these out, but it’s undocumented, and I’m not sure if it’s necessarily safe for production use or not. More learning to be done, as usual.

More tips? Put ’em in the comments!!

Blogged with Flock

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Facebook (Opens in new window) Facebook

Recent Posts

  • Auditing Your Data Migration To ClickHouse Using ClickHouse Local
  • ClickHouse Cheat Sheet 2024
  • User Activation With Django and Djoser
  • Python Selenium Webdriver Notes
  • On Keeping A Journal and Journaling
  • What Geeks Could Learn From Working In Restaurants
  • What I’ve Been Up To
  • PyCon Talk Proposals: All You Need to Know And More
  • Sending Alerts With Graphite Graphs From Nagios
  • The Python User Group in Princeton (PUG-IP): 6 months in

Categories

  • Apple
  • Big Ideas
  • Books
  • CodeKata
  • Database
  • Django
  • Freelancing
  • Hacks
  • journaling
  • Leadership
  • Linux
  • LinuxLaboratory
  • Loghetti
  • Me stuff
  • Other Cool Blogs
  • PHP
  • Productivity
  • Python
  • PyTPMOTW
  • Ruby
  • Scripting
  • Sysadmin
  • Technology
  • Testing
  • Uncategorized
  • Web Services
  • Woodworking

Archives

  • January 2024
  • May 2021
  • December 2020
  • January 2014
  • September 2012
  • August 2012
  • February 2012
  • November 2011
  • October 2011
  • June 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • September 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004
  • September 2004
  • August 2004
© 2025 Musings of an Anonymous Geek | Powered by Minimalist Blog WordPress Theme