A lot has happened with Cloud Foundry since I last blogged about creating a micro cloud (almost 18 months ago!). The Micro “isn’t really maintained anymore” so instead I’m using the Nise Installer to create my private cloud. I used an Ubuntu 10.04 LTS image on a Mac running Fusion and used the easy install to get to a console. Once logged in I updated the keyboard to a Dell 101 (up and down arrows don’t work otherwise), installed a few tools, and then inquired to discover the IP address:
sudo dpkg-reconfigure console-setup sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y vim openssh-server curl ifconfig eth0 | grep inet
The last line will show you the address of the machine. Add an entry to your client’s /etc/hosts file similar to the following (using the IP address you got from the server above):
172.16.217.185 mycloud myapp.mycloud.local
Then from a Terminal (or other shell) on the client enter ‘ssh mycloud’ to get a command prompt (this is easer than using the console).
The next step is to install Cloud Foundry:
export CF_RELEASE_BRANCH=release-candidate bash < <(curl -s -k -B https://raw.github.com/yudai/cf_nise_installer/master/local/bootstrap.sh)
This will prompt for your password (a couple times!) and takes a while (a couple hours). When it finishes it will show something like the following:
Done! RESTART your server! CF target: 'cf target api.172.16.217.185.xip.io' CF login : 'cf login --password micr0@micr0 email@example.com'
The address (172.16.217.185) is the IP address for my server; yours will almost certainly be different. Follow the instructions and restart your server. Once the server is started you need to start Cloud Foundry:
cd ~/cf_nise_installer; ./local/start_processes.sh
Within a minute it should list a number of processes as running. Unfortunately, a few processes are running the command returns to the shell prompt implying that all is well. In my experience, not everything is started so I typically repeat the summary command until I see all fourteen processes:
sudo /var/vcap/bosh/bin/monit summary
From your client machine you should navigate to a directory with a sample application (like we created here) and set the target, login, do some setup, and push the application:
cf target api.172.16.217.185.xip.io cf login --password micr0@micr0 firstname.lastname@example.org # okay to ignore CFoundry::InvalidRelation error in next command (see https://github.com/cloudfoundry/cf/issues/9) cf create-space development cf target --space development cf map-domain mycloud.local cf push
At this point you can accept the defaults (the subdomain is ‘myapp’ and the domain is ‘mycloud.local’) and when the staging is finished you should see 2 applications running. On your client you can navigate to http://myapp.mycloud.local/ and test the application. From your client shell you can try out various commands listed at http://docs.cloudfoundry.com/docs/using/managing-apps/cf/.