I installed VCAP on a 64 bit Ubuntu 10.04 server VM hosted on EC2. I followed the steps mentioned at https://github.com/cloudfoundry/oss-docs/tree/master/vcap/single_and_multi_node_deployments_with_dev_setup. Please note this is a single node deployment where all CloudFoundry components are deployed on a single instance.
I started and stopped the VCAP and all components were running just as expected including the CloudController.
ISSUE
I stopped the EC2 instance and then started it again. I then executed the command to start the VCAP. But the status showed as – CloudController stopped and all other components running.
SOME ADDITIONAL INFO – Whenever a EC2 instance is restarted both its public and private IP changed. I did some googling and realized that the devsetup script (refere https://github.com/cloudfoundry/oss-docs/tree/master/vcap/single_and_multi_node_deployments_with_dev_setup) hardcodes the IP at various places. Hence when I restart the EC2 instance the IP address changes and VCAP does not start.
I am looking for some info on how I can correct the cached IP?
Thanks,
Ankit
ADDING MORE INFO TO THE ORIGINAL POST
ORIGINAL IP 10.142.81.107
NEW IP AFTER EC2 INSTANCE RESTART 10.142.159.0
Executed following commands to point VCAP to the new IP:
cd ~/cloudfoundry/.deployments/devbox/config/
sed -i ‘s/10.142.81.107/10.142.159.0/g’ *.yml
RESULT Cloud Controller not started. All other components started.
CONTENTS OF ~/cloudfoundry/.deployments/devbox/log/cloud_controller.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.
rake aborted!
could not connect to server: Connection refused
Is the server running on host “10.142.159.0” and accepting
TCP/IP connections on port 5432?
Tasks: TOP => db:migrate
(See full trace by running task with –trace)
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.
/home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:950:in initialize': could not connect to server: Connection refused (PGError)new’
Is the server running on host "10.142.159.0" and accepting
TCP/IP connections on port 5432?
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:950:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:950:in connect'initialize’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:246:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:25:in new'postgresql_connection’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/postgresql_adapter.rb:25:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in new_connection'checkout_new_connection’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in checkout'connection’
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in retrieve_connection'retrieve_connection’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in connection'quoted_table_name’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/base.rb:602:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/query_methods.rb:275:in build_select'build_arel’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/query_methods.rb:189:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/query_methods.rb:149:in arel'perform_calculation’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/calculations.rb:169:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/calculations.rb:152:in calculate'count’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation/calculations.rb:58:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation.rb:92:in empty?'any?’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.14/lib/active_record/relation.rb:100:in
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in <top (required)>'require’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in block in require'load_dependency’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:227:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in require'‘
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/activate.rb:6:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in require'block in require’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:227:in load_dependency'require’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.14/lib/active_support/dependencies.rb:242:in
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/environment.rb:17:in <top (required)>'require’
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in block in <main>'instance_eval’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/rack-1.2.5/lib/rack/builder.rb:46:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/rack-1.2.5/lib/rack/builder.rb:46:in initialize'new’
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in <main>'eval’
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in
from /home/ubuntu/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in load'‘
from /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
Well the problem is with the PostgreSQL. The config file for PostgreSQL should be changed and then PostgreSQL should be restarted. Detailed steps are mentioned below:
FIX IN CASE OF IP CHANGE