Senthil Vaiyapuri
posted this on August 31, 2011 11:36
You probably arrived here because you are looking for instructions on how to stand up your own instance of Cloud Foundry. Cloud Foundry is currently under rapid development. This document is out of date, and unfortunately we have not yet compiled its replacement. At the moment, the best place to get information is our discussion lists:
Contributor : Mahesh Patil
In github.com/cloudfoundry/vcap repository, we have published a VCAP installation scheme called dev_setup which uses Chef. Please review the contents of the dev_setup directory. You can use this scheme to do a single-node or multi-node VCAP install. This document walks thru a single node and a multi node installation using the dev_setup scripts.
These scripts are tested with and assume a pristine Ubuntu 10.04 64-bit install. Other Ubuntu releases, Linux distributions, and operating systems have not been verified with this installation method and are unlikely to work.
1. Please review the vcap_dev_setup README
2. Clone VCAP repository
% git clone https://github.com/cloudfoundry/vcap.git
3. Tar up dev_setup directory
% cd vcap
% tar czvf dev_setup.tar.gz dev_setup
4. Copy over dev_setup.tar.gz file to the servers where you will be installing VCAP and components.
5. Uncompress and extract dev_setup.tar.gz file in the servers where the file was copied to.
% tar xzvf dev_setup.tar.gz
6. Login as a user who has sudo privileges
7. Set http_proxy, https_proxy environment variables if the servers are behind proxy. The installation scripts need http outbound access.
1. vcap_dev_setup : Main script which will be invoked to do the VCAP and component installation
usage: ./vcap_dev_setup options
OPTIONS:
-h Show this message
-a Answer yes to all questions
-p http proxy i.e. -p http://username:password@host:port/
-c deployment config
-d cloudfoundry home
-r cloud foundry repo
2. vcap_dev : Script to start/stop components
Usage: ./vcap_dev [--name deployment_name] [--dir cloudfoundry_home_dir] [start|stop|restart|tail|status]
-n, --name deployment_name Name of the deployment
-d, --dir cloud_foundry_home_dir Cloud foundry home directory
vcap_dev/deployments directory contains the deployment specifications. This directory has a README as well, please review.
Assuming you are in a pristine Ubuntu 10.04 64 bit environment, you can do a single node deployment using either of the following two options.
Install curl, get and execute the vcap_dev_setup script from github as below:
$ sudo apt-get install curl
$ bash < <(curl -s -k -B https://raw.github.com/cloudfoundry/vcap/master/dev_setup/bin/vcap_dev_setup)
Assuming the steps are done as mentioned in the Common section. Change directory into dev_setup/bin directory.
bin/vcap_dev_setup script without any options will install all components in the local server and is equivalent to a Single node deployment. By default, cloudfoundry software will be installed in ~/cloudfoundry/ directory. For different options supported by this script, please see the previous section.
Default Installation directory : $HOME/cloudfoundry
Please note that the vcap_dev_setup script will clone and update the Cloudfoundry open source VCAP git repo under the installation directory. Also, you will see a $HOME/cloudfoundry/.deployments directory which will contain deployment configuration and software.
We will invoke bin/vcap_dev_setup script taking all the default options. This will use the deployments/devbox.yml deployment specification, which will install all the components in the local server.
For example :
$ bin/vcap_dev_setup
Checking web connectivity.
chef-solo is required, should I install it? [Y/n]
[sudo] password for cfsupp:
deb http://apt.opscode.com/ lucid-0.10 main
OK
Hit http://theonemirror.eng.vmware.com lucid Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid/main Translation-en_US
Get:1 http://theonemirror.eng.vmware.com lucid-security Release.gpg [198B]
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-security/main Translation-en_US
Get:2 http://theonemirror.eng.vmware.com lucid-updates Release.gpg [198B]
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid Release
Get:3 http://theonemirror.eng.vmware.com lucid-security Release [44.7kB]
Get:4 http://theonemirror.eng.vmware.com lucid-updates Release [44.7kB]
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Hit http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Get:5 http://apt.opscode.com lucid-0.10 Release.gpg [198B]
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Get:6 http://theonemirror.eng.vmware.com lucid-security/main Packages [262kB]
Ign http://apt.opscode.com/ lucid-0.10/main Translation-en_US .. and more ..
You will be asked for confirmation regarding chef-solo installation and sudo password. After that the installation will continue to install the software and necessary components for a local vcap install. At the end of the script execution, you should messages similar to below.
---------------
Deployment info
---------------
Status: successful
Config files: /home/cfsupp/cloudfoundry/.deployments/devbox/config
Deployment name: devbox
Command to run cloudfoundry: /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap_dev start
Allright, let us find out the status and start all the components. Please note that now vcap software is installed under ~/cloudfoundry. We will go there and start
$ cd ~/cloudfoundry/vcap
$ dev_setup/bin/vcap_dev status
Setting up cloud controller environment
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/devbox/config
Executing /home/cfsupp/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap status mysql_backup dea mongodb_gateway health_manager redis_gateway mysql_node router mongodb_backup mongodb_node redis_node mysql_gateway redis_backup cloud_controller -c /home/cfsupp/cloudfoundry/.deployments/devbox/config -v /home/cfsupp/cloudfoundry/vcap/bin
dea : STOPPED
mongodb_gateway : STOPPED
health_manager : STOPPED
redis_gateway : STOPPED
mysql_node : STOPPED
router : STOPPED
mongodb_node : STOPPED
redis_node : STOPPED
mysql_gateway : STOPPED
cloud_controller : STOPPED
$ dev_setup/bin/vcap_dev start
Setting up cloud controller environment
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/devbox/config
Executing /home/cfsupp/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start mysql_backup dea mongodb_gateway health_manager redis_gateway mysql_node router mongodb_backup mongodb_node redis_node mysql_gateway redis_backup cloud_controller -c /home/cfsupp/cloudfoundry/.deployments/devbox/config -v /home/cfsupp/cloudfoundry/vcap/bin
dea : RUNNING
mongodb_gateway : RUNNING
health_manager : RUNNING
redis_gateway : RUNNING
mysql_node : RUNNING
router : RUNNING
mongodb_node : RUNNING
redis_node : RUNNING
mysql_gateway : RUNNING
cloud_controller : RUNNING
Voila! We are up and running. We can verify with VMC.
$ vmc target
[http://api.vcap.me]
$ vmc register
Email: user@vmware.com
Password: *******
Verify Password: *******
Creating New User: OK
Successfully logged into [http://api.vcap.me]
$ vmc info
VMware's Cloud Application Platform
For support visit http://support.cloudfoundry.com
Target: http://api.vcap.me (v0.999)
Client: v0.3.12
User: user@vmware.com
Usage: Memory (0B of 2.0G total)
Services (0 of 16 total)
Apps (0 of 20 total)
We will walkthru the deployment as described in deployments/sample/multihost_mysql. Please review the deployment configuration files in here
In this scheme, we will be installing VCAP components deployed in 4 nodes :
There are no changes required for the deployment configuration deployments/sample/multihost_mysql/rest.yml
---
deployment:
name: "rest"
jobs:
install:
- nats_server
- cloud_controller:
builtin_services:
- redis
- mongodb
- mysql
- router
- health_manager
- ccdb
- redis:
index: "0"
- redis_gateway
- mysql_gateway
- mongodb:
index: "0"
- mongodb_gateway
~/dev_setup$ bin/vcap_dev_setup -c deployments/sample/multihost_mysql/rest.yml
Checking web connectivity.
chef-solo is required, should I install it? [Y/n]
[sudo] password for cfsupp:
deb http://apt.opscode.com/ lucid-0.10 main
OK
Hit http://theonemirror.eng.vmware.com lucid Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-security Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-security/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-updates Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid Release
Hit http://theonemirror.eng.vmware.com lucid-security Release
Hit http://theonemirror.eng.vmware.com lucid-updates Release
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Hit http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Get:1 http://apt.opscode.com lucid-0.10 Release.gpg [198B]
Hit http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Hit http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://apt.opscode.com/ lucid-0.10/main Translation-en_US
Get:2 http://apt.opscode.com lucid-0.10 Release [4,477B]
Hit http://security.ubuntu.com lucid-security Release.gpg
Ign http://apt.opscode.com lucid-0.10/main Packages
Ign http://apt.opscode.com lucid-0.10/main Packages
Hit http://us.archive.ubuntu.com lucid Release.gpg
.. and more ..
Installation will end with messages similar to below. We will not start the components as instructed now, but will install other components in the other nodes and finally start them up in sequence.
---------------
Deployment info
---------------
Status: successful
Config files: /home/cfsupp/cloudfoundry/.deployments/rest/config
Deployment name: rest
Command to run cloudfoundry: /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n rest start
Sample configuration is at dev_setup/deployments/sample/multihost_mysql/dea.yml
Modified configuration is as below : (Please note that we had adjusted nats_server host)
---
# Deployment
# ----------
deployment:
name: "dea"
jobs:
install:
- dea
installed:
- nats_server:
host: "10.20.143.190"
port: "4222"
user: "nats"
password: "nats"
~/dev_setup$ bin/vcap_dev_setup -c deployments/sample/multihost_mysql/dea.yml
Checking web connectivity.
chef-solo is required, should I install it? [Y/n]
[sudo] password for cfsupp:
deb http://apt.opscode.com/ lucid-0.10 main
OK
Hit http://theonemirror.eng.vmware.com lucid Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-security Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-security/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-updates Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid Release
Hit http://theonemirror.eng.vmware.com lucid-security Release
Hit http://theonemirror.eng.vmware.com lucid-updates Release
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Hit http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Hit http://theonemirror.eng.vmware.com lucid-security/main Packages
Get:1 http://apt.opscode.com lucid-0.10 Release.gpg [198B]
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Hit http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://apt.opscode.com/ lucid-0.10/main Translation-en_US
Get:2 http://apt.opscode.com lucid-0.10 Release [4,477B]
Ign http://apt.opscode.com lucid-0.10/main Packages
Ign http://apt.opscode.com lucid-0.10/main Packages
Hit http://security.ubuntu.com lucid-security Release.gpg
Get:3 http://apt.opscode.com lucid-0.10/main Packages [14.6kB]
Ign http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-en_US
.. and more ..
At the end of installation, you will see messages similar to below. We will not start the installed components now, but will go ahead and install mysql node 1 and 2.
---------------
Deployment info
---------------
Status: successful
Config files: /home/cfsupp/cloudfoundry/.deployments/dea/config
Deployment name: dea
Command to run cloudfoundry: /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n dea start
Deployment configuration for mysql node 0 is in dev_setup/deployments/sample/multihost_mysql/mysql0.yml
Modified configuration is below, please note that we fill in the correct values for nats_server component
---
deployment:
name: "mysql0"
jobs:
install:
- mysql:
index: "0"
installed:
- nats_server:
host: "10.20.143.190"
port: "4222"
user: "nats"
password: "nats"
~/dev_setup$ bin/vcap_dev_setup -c deployments/sample/multihost_mysql/mysql0.yml
Checking web connectivity.
chef-solo is required, should I install it? [Y/n]
[sudo] password for cfsupp:
deb http://apt.opscode.com/ lucid-0.10 main
OK
Hit http://theonemirror.eng.vmware.com lucid Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-security Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-security/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-updates Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid Release
Hit http://theonemirror.eng.vmware.com lucid-security Release
Hit http://theonemirror.eng.vmware.com lucid-updates Release
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Hit http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Hit http://theonemirror.eng.vmware.com lucid-security/main Packages
Hit http://theonemirror.eng.vmware.com lucid-updates/main Packages
Get:1 http://apt.opscode.com lucid-0.10 Release.gpg [198B]
Ign http://apt.opscode.com/ lucid-0.10/main Translation-en_US
Get:2 http://apt.opscode.com lucid-0.10 Release [4,477B]
Ign http://apt.opscode.com lucid-0.10/main Packages
.. and more ..
---------------
Deployment info
---------------
Status: successful
Config files: /home/cfsupp/cloudfoundry/.deployments/mysql0/config
Deployment name: mysql0
Command to run cloudfoundry: /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n mysql0 start
Deployment configuration for mysql node 0 is in dev_setup/deployments/sample/multihost_mysql/mysql1.yml
Modified configuration is below, please note that we fill in the correct values for nats_server component
---
deployment:
name: "mysql1"
jobs:
install:
- mysql:
index: "1"
installed:
- nats_server:
host: "10.20.143.190"
port: "4222"
user: "nats"
password: "nats"
Install using vcap_dev_setup script with the mysql0.yml deployment configuration option
~/dev_setup$ bin/vcap_dev_setup -c deployments/sample/multihost_mysql/mysql1.yml
Checking web connectivity.
chef-solo is required, should I install it? [Y/n]
[sudo] password for cfsupp:
deb http://apt.opscode.com/ lucid-0.10 main
OK
Hit http://theonemirror.eng.vmware.com lucid Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-security Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-security/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid-updates Release.gpg
Ign http://theonemirror.eng.vmware.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://theonemirror.eng.vmware.com lucid Release
Hit http://theonemirror.eng.vmware.com lucid-security Release
Hit http://theonemirror.eng.vmware.com lucid-updates Release
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid/main Packages
Hit http://theonemirror.eng.vmware.com lucid/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-security/main Packages
Hit http://theonemirror.eng.vmware.com lucid-security/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://theonemirror.eng.vmware.com lucid-updates/main Packages
Get:1 http://apt.opscode.com lucid-0.10 Release.gpg [198B]
Hit http://theonemirror.eng.vmware.com lucid-updates/main Packages
Ign http://apt.opscode.com/ lucid-0.10/main Translation-en_US
Get:2 http://apt.opscode.com lucid-0.10 Release [4,477B]
Ign http://apt.opscode.com lucid-0.10/main Packages
Get:3 http://security.ubuntu.com lucid-security Release.gpg [198B]
Hit http://us.archive.ubuntu.com lucid Release.gpg
Ign http://apt.opscode.com lucid-0.10/main Packages
Get:4 http://apt.opscode.com lucid-0.10/main Packages [14.6kB]
Ign http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/main Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/universe Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-en_US
.. and more ..
At the end of install, you will messages similar to the following.
---------------
Deployment info
---------------
Status: successful
Config files: /home/cfsupp/cloudfoundry/.deployments/mysql1/config
Deployment name: mysql1
Command to run cloudfoundry: /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n mysql1 start
1. Start all the components installed thru the rest deployment configuration (10.20.143.190)
$ ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n rest start
Setting up cloud controller environment
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/rest/config
Executing /home/cfsupp/cloudfoundry/.deployments/rest/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start health_manager mongodb_gateway router redis_gateway mongodb_backup redis_node mongodb_node mysql_gateway redis_backup cloud_controller -c /home/cfsupp/cloudfoundry/.deployments/rest/config -v /home/cfsupp/cloudfoundry/vcap/bin
health_manager : RUNNING
mongodb_gateway : RUNNING
router : RUNNING
redis_gateway : RUNNING
redis_node : RUNNING
mongodb_node : RUNNING
mysql_gateway : RUNNING
cloud_controller : RUNNING
2. Start components installed thru the dea deployment configuration (10.20.143.187)
$ ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n dea start
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/dea/config
Executing /home/cfsupp/cloudfoundry/.deployments/dea/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start dea -c /home/cfsupp/cloudfoundry/.deployments/dea/config -v /home/cfsupp/cloudfoundry/vcap/bin
dea : RUNNING
3. Start components installed thru the mysql0 deployment configuration (10.20.143.188)
$ ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n mysql0 start
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/mysql0/config
Executing /home/cfsupp/cloudfoundry/.deployments/mysql0/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start mysql_backup mysql_node -c /home/cfsupp/cloudfoundry/.deployments/mysql0/config -v /home/cfsupp/cloudfoundry/vcap/bin
mysql_node : RUNNING
4. Start components installed thru the mysql1 deployment configuration (10.20.143.189)
$ ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev -n mysql1 start
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/mysql1/config
Executing /home/cfsupp/cloudfoundry/.deployments/mysql1/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start mysql_backup mysql_node -c /home/cfsupp/cloudfoundry/.deployments/mysql1/config -v /home/cfsupp/cloudfoundry/vcap/bin
mysql_node : RUNNING
Cloud controller listens on the api.vcap.me endpoint, which is bound to localhost 127.0.0.1
Install VMC client in the node where cloud_controller is running (10.20.143.190). Assuming vmc is in PATH
$ vmc target
[http://api.vcap.me]
$ vmc info
VMware's Cloud Application Platform
For support visit http://support.cloudfoundry.com
Target: http://api.vcap.me (v0.999)
Client: v0.3.12
$ vmc register
Email: user@vmware.com
Password: *******
Verify Password: *******
Creating New User: OK
Successfully logged into [http://api.vcap.me]
$ vmc info
VMware's Cloud Application Platform
For support visit http://support.cloudfoundry.com
Target: http://api.vcap.me (v0.999)
Client: v0.3.12
User: user@vmware.com
Usage: Memory (0B of 2.0G total)
Services (0 of 16 total)
Apps (0 of 20 total)
$ vmc services
============== System Services ==============
+---------+---------+-------------------------------+
| Service | Version | Description |
+---------+---------+-------------------------------+
| mongodb | 1.8 | MongoDB NoSQL store |
| mysql | 5.1 | MySQL database service |
| redis | 2.2 | Redis key-value store service |
+---------+---------+-------------------------------+
=========== Provisioned Services ============
$ vmc frameworks
+-----------+
| Name |
+-----------+
| sinatra |
| spring |
| node |
| grails |
| lift |
| rails3 |
| otp_rebar |
+-----------+
We will push a sample sinatra application sv-env, which prints out the envrionment available to the app in cloudfoundry. Please review the source in attached env.rb file.
$ vmc push sv-env -n
Creating Application: OK
Uploading Application:
Checking for available resources: OK
Packing application: OK
Uploading (1K): OK
Push Status: OK
Staging Application: OK
Starting Application: OK
$ curl -I sv-env.vcap.me
HTTP/1.1 200 OK
Server: nginx/0.7.65
Date: Wed, 07 Sep 2011 23:39:09 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=20
Vary: Accept-Encoding
Content-Length: 4239
We will create and bind a mysql service to the application
$ vmc create-service mysql mysql-sv-env sv-env
Creating Service: OK
Binding Service: OK
Stopping Application: OK
Staging Application: OK
Starting Application: OK
$ vmc apps
+-------------+----+---------+----------------+--------------+
| Application | # | Health | URLS | Services |
+-------------+----+---------+----------------+--------------+
| sv-env | 1 | RUNNING | sv-env.vcap.me | mysql-sv-env |
+-------------+----+---------+----------------+--------------+
1. During vcap_dev_setup, 'rack' install fails with ArgumentError. If you rerun the vcap_dev_setup script, the script continues successfully with installing rack.
[Wed, 31 Aug 2011 14:36:56 -0700] WARN: failed to find gem rack (>= 0, runtime) from [http://gems.rubyforge.org/]
[Wed, 31 Aug 2011 14:36:56 -0700] DEBUG: sh(/home/cfsupp/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.8.7-p334/bin/gem install rack -q --no-rdoc --no-ri -v "")
[Wed, 31 Aug 2011 14:36:56 -0700] ERROR: gem_package[rack] (ruby::default line 75) has had an error
[Wed, 31 Aug 2011 14:36:56 -0700] ERROR: gem_package[rack] (/home/cfsupp/cloudfoundry/vcap/dev_setup/cookbooks/ruby/recipes/default.rb:75:in `from_file') had an error:
gem_package[rack] (ruby::default line 75) had an error: Expected process to exit with [0], but received '1'
[Tue, 06 Sep 2011 15:16:44 -0700] FATAL: Chef::Exceptions::ShellCommandFailed: gem_package[rack] (ruby::default line 75) had an error: Expected process to exit with [0], but received '1'
---- Begin output of /home/cfsupp/cloudfoundry/.deployments/rest/deploy/rubies/ruby-1.8.7-p334/bin/gem install rack -q --no-rdoc --no-ri -v "" ----
STDOUT:
STDERR: ERROR: While executing gem ... (ArgumentError)
Illformed requirement [""]
---- End output of /home/cfsupp/cloudfoundry/.deployments/rest/deploy/rubies/ruby-1.8.7-p334/bin/gem install rack -q --no-rdoc --no-ri -v "" ----
Ran /home/cfsupp/cloudfoundry/.deployments/rest/deploy/rubies/ruby-1.8.7-p334/bin/gem install rack -q --no-rdoc --no-ri -v "" returned 1
2, After a local vcap_dev_setup (using devbox.yml), a bin/vcap_dev start shows Cloud Controlled as STOPPED, but a subsequent status shows it as RUNNING. Also a LOG: snippet is piped to stdout with a 'Rails Error' message, you can safely ignore this.
$ dev_setup/bin/vcap_dev start
Setting up cloud controller environment
Using cloudfoundry config from /home/cfsupp/cloudfoundry/.deployments/devbox/config
Executing /home/cfsupp/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /home/cfsupp/cloudfoundry/vcap/dev_setup/bin/vcap start mysql_backup dea mongodb_gateway health_manager redis_gateway mysql_node router mongodb_backup mongodb_node redis_node mysql_gateway redis_backup cloud_controller -c /home/cfsupp/cloudfoundry/.deployments/devbox/config -v /home/cfsupp/cloudfoundry/vcap/bin
dea : RUNNING
mongodb_gateway : RUNNING
health_manager : RUNNING
redis_gateway : RUNNING
mysql_node : RUNNING
router : RUNNING
mongodb_node : RUNNING
redis_node : RUNNING
mysql_gateway : RUNNING
cloud_controller : STOPPED
LOG:
Rails Error: Unable to access log file. Please ensure that exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
NOTICE: CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
NOTICE: CREATE TABLE will create implicit sequence "apps_id_seq" for serial column "apps.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "apps_pkey" for table "apps"
NOTICE: CREATE TABLE will create implicit sequence "routes_id_seq" for serial column "routes.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "routes_pkey" for table "routes" .. and more ..