Manage your AppFog data from your workstation

While operating MySQL and MongoDB for AppFog, our users often requested direct access to their data, bypassing things like running phpMyAdmin or writing custom management code. We have been listening, and while we had our own ideas for solving this problem, the CloudFoundry project has recently offered up a solution that exceeded all of our expectations.

Enter Caldecott

As described on the CloudFoundry blog, Caldecott is an extension to the CloudFoundry command line that allows you to establish a tunnel to any CloudFoundry service. It works by proxying TCP traffic on localhost via HTTPS, and uploading an app to your CloudFoundry account to direct it any service hosted by CloudFoundry. With Caldecott, you can use the mysql and mysqldump commands, Sequel Pro.app, or even rake db:migrate to rule your data. The best part? It works with AppFog now!

Getting Started

Caldecott is currently in beta, so here are the steps for getting started. First, if you don’t already have an AppFog account, head on over to http://appfog.com to request one. Then install the latest beta CloudFoundry command line and the Caldecott extension via RubyGems.

$ sudo gem install af
$ sudo gem install caldecott

Now, login to AppFog and establish your tunnel.

$ af login --email jvoorhis@gmail.com

Attempting login to [http://api.appfog.com]
Password: *********
Successfully logged into [http://api.appfog.com]

$ af tunnel
1: mysql-ed8f9
Which service to tunnel to?: 1
Password: ********
Getting tunnel connection info: OK

Service connection info:
username : uaLDy9EhhvMLq
password : p5Odjf6E5O7uW
name : dc1aaa897343f4eb1aed047ec7c86f19f

Starting tunnel to mysql-ed8f9 on port 10000.
1: none
2: mysql
Which client would you like to start?: 2
Launching 'mysql --protocol=TCP --host=localhost --port=10000 --user=uaLDy9EhhvMLq --password=p5Odjf6E5O7uW dc1aaa897343f4eb1aed047ec7c86f19f'

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12250844
Server version: 5.5.12-log Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql >

Now you’re in! In this sample, I chose to connect with the mysql command, but had I chose “none”, vmc would remain in the foreground, proxying TCP traffic to my MySQL database on port 10000.

In summary, the cloud is no longer a barrier between you and your data, with AppFog and CloudFoundry!

Share this post
Facebook Twitter Google
  • http://dharanasoft.com Vagmi Mudumbai

    Couldn’t you always do a “ssh -TNL localport:localhost:remoteport server”?

  • Jeremy

    Good question. As I mentioned on our Hacker News thread (http://news.ycombinator.com/item?id=3300891), we have not offered SSH tunneling because of the high impedance mismatch between OpenSSH and platform as a service in general.

    We have looked at other SSH server implementations and held internal hack days for this, but VMware has created an elegant solution and we’re proud to support it.

  • Hector

    Wow, you guys are so behind with other clouds like dotcloud.com.   No ssh, no tunneling for mysql, you stage git changes and have to wait minutes for your changes to appear on the live site.  Plain pathetic, you really need to get going if you want this service to ever be mainstream.  I like to use navicat and guess what no tunneling.  Wow! very pathetic.

  • Anonymous

    No, the tunnel command does not currently work with PHP Fog

  • Anonymous

    No, the security in most PaaS prevent you from getting direct access to ssh into services like this.

Powered by Olark