FAQ
Hi,

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

Search Discussions

  • Jesse Zhang at Aug 1, 2012 at 7:31 pm
    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller configuration.
    Try to take your current deployed config as a starting point, parameterize
    your IP, and write a small script to fill in that one blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    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
  • Ankit Goel at Aug 1, 2012 at 9:32 pm
    *SOME ADDITIONAL DETAILS*
    *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)

    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
    `new'

    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'

    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
    `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:25:in
    `new'

    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
    `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/abstract/connection_pool.rb:229:in
    `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
    `checkout_new_connection'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in
    `checkout'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
    `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:317:in
    `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
    `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:89:in
    `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/base.rb:602:in
    `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/relation/query_methods.rb:275:in
    `build_select'

    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
    `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:149:in
    `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/calculations.rb:169:in
    `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:152:in
    `calculate'

    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
    `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.rb:92:in
    `empty?'

    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
    `any?'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in
    `<top (required)>'

    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/.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'

    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'

    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
    `<top (required)>'

    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/.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'

    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'

    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/environment.rb:17:in
    `<top (required)>'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `require'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `block in <main>'

    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
    `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
    `initialize'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `new'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `<main>'

    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
    `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
    `load'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
    `<main>'
    On Thursday, 2 August 2012 01:01:23 UTC+5:30, Jesse Zhang wrote:

    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller configuration.
    Try to take your current deployed config as a starting point, parameterize
    your IP, and write a small script to fill in that one blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    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
  • Jesse Zhang at Aug 1, 2012 at 10:30 pm
    What's the output of this:
    $ ruby -r socket -e 'puts UDPSocket.new.tap { |x| x.connect("8.8.8.8", 53)
    }.addr[-1]'
    ?

    Jesse
    On Wed, Aug 1, 2012 at 2:32 PM, Ankit Goel wrote:

    *SOME ADDITIONAL DETAILS*
    *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)***
    *

    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
    `new'****

    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'****

    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
    `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:25:in
    `new'****

    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
    `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/abstract/connection_pool.rb:229:in
    `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
    `checkout_new_connection'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in
    `checkout'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
    `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:317:in
    `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
    `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:89:in
    `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/base.rb:602:in
    `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/relation/query_methods.rb:275:in
    `build_select'****

    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
    `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:149:in
    `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/calculations.rb:169:in
    `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:152:in
    `calculate'****

    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
    `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.rb:92:in
    `empty?'****

    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
    `any?'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in
    `<top (required)>'****

    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/.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'****

    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'****

    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
    `<top (required)>'****

    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/.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'****

    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'****

    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/environment.rb:17:in
    `<top (required)>'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `require'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `block in <main>'****

    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
    `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
    `initialize'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `new'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `<main>'****

    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
    `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
    `load'****

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
    `<main>'****
    On Thursday, 2 August 2012 01:01:23 UTC+5:30, Jesse Zhang wrote:

    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller configuration.
    Try to take your current deployed config as a starting point, parameterize
    your IP, and write a small script to fill in that one blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    I installed VCAP on a 64 bit Ubuntu 10.04 server VM hosted on EC2. I
    followed the steps mentioned athttps://github.com/**
    cloudfoundry/oss-docs/tree/**master/vcap/single_and_multi_**
    node_deployments_with_dev_**setup<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<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
  • 磊张 at Aug 4, 2012 at 1:59 am
    Here's a way to fix it like this:
    1. Check all the files in ../dev_box/config to make sure that the IP
    addresses in that directory have been replaced to new one.
    2. Go to /etc/postgresql and open postgresql.conf, you can find there's a*listening address
    *in that file. Change it to your new IP address
    3. Do the same thing with postgresql-8.4

    在 2012年8月2日星期四UTC+8上午5时32分29秒,Ankit Goel写道:
    *SOME ADDITIONAL DETAILS*
    *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)

    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
    `new'

    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'

    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
    `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:25:in
    `new'

    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
    `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/abstract/connection_pool.rb:229:in
    `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
    `checkout_new_connection'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in
    `checkout'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
    `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:317:in
    `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
    `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:89:in
    `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/base.rb:602:in
    `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/relation/query_methods.rb:275:in
    `build_select'

    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
    `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:149:in
    `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/calculations.rb:169:in
    `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:152:in
    `calculate'

    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
    `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.rb:92:in
    `empty?'

    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
    `any?'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in
    `<top (required)>'

    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/.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'

    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'

    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
    `<top (required)>'

    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/.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'

    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'

    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/environment.rb:17:in
    `<top (required)>'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `require'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `block in <main>'

    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
    `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
    `initialize'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `new'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `<main>'

    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
    `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
    `load'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
    `<main>'
    On Thursday, 2 August 2012 01:01:23 UTC+5:30, Jesse Zhang wrote:

    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller configuration.
    Try to take your current deployed config as a starting point, parameterize
    your IP, and write a small script to fill in that one blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    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
  • Wang Yang at Aug 6, 2012 at 1:56 am
    Yes, the stacktrace shows the cloud controller can't connect to postgresql.
    And you can see health manager's log, it may be down as well. Because it
    use the prostgresql too.
    Now the cloud controller uses postgresql-8.4 and postgresql service use
    v9.0. So you should update ip in two versions as 张磊's step 2 tells. The dir
    is: /etc/postgresql/$version number/main/postgresql.confg
    On Saturday, August 4, 2012 9:59:35 AM UTC+8, 磊张 wrote:

    Here's a way to fix it like this:
    1. Check all the files in ../dev_box/config to make sure that the IP
    addresses in that directory have been replaced to new one.
    2. Go to /etc/postgresql and open postgresql.conf, you can find there's a*listening address
    *in that file. Change it to your new IP address
    3. Do the same thing with postgresql-8.4

    在 2012年8月2日星期四UTC+8上午5时32分29秒,Ankit Goel写道:
    *SOME ADDITIONAL DETAILS*
    *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)

    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
    `new'

    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'

    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
    `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:25:in
    `new'

    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
    `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/abstract/connection_pool.rb:229:in
    `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
    `checkout_new_connection'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in
    `checkout'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
    `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:317:in
    `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
    `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:89:in
    `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/base.rb:602:in
    `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/relation/query_methods.rb:275:in
    `build_select'

    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
    `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:149:in
    `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/calculations.rb:169:in
    `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:152:in
    `calculate'

    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
    `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.rb:92:in
    `empty?'

    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
    `any?'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in
    `<top (required)>'

    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/.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'

    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'

    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
    `<top (required)>'

    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/.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'

    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'

    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/environment.rb:17:in
    `<top (required)>'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `require'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `block in <main>'

    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
    `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
    `initialize'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `new'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `<main>'

    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
    `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
    `load'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
    `<main>'
    On Thursday, 2 August 2012 01:01:23 UTC+5:30, Jesse Zhang wrote:

    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller
    configuration. Try to take your current deployed config as a starting
    point, parameterize your IP, and write a small script to fill in that one
    blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    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
  • Ankit Goel at Aug 6, 2012 at 8:33 am
    Thank you all for the quick response. I am able to resolve the IP issue now.

    *FIX IN CASE OF IP CHANGE*


    - ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev stop
    - cd ~/cloudfoundry/.deployments/devbox/config/
    - sed -i 's/<OLDIP>/<NEWIP>/g' *.yml
    - vi /etc/postgresql/8.2/main/postgresql.conf # CHANGE THE IP ADDRESS AT THE END
    - vi /etc/postgresql/9.0/main/postgresql.conf # CHANGE THE IP ADDRESS AT THE END
    - sudo /etc/init.d/postgresql-8.4 restart
    - ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev start
    - ~/cloudfoundry/vcap/dev_setup/bin/vcap_dev status

    Refer:
    http://stackoverflow.com/questions/11763083/cloudcontroller-does-not-start-if-ip-of-the-vm-where-vcap-is-installed-is-change/11771458#11771458

    Regards,
    Ankit
    On Monday, 6 August 2012 07:26:14 UTC+5:30, Wang Yang wrote:

    Yes, the stacktrace shows the cloud controller can't connect to
    postgresql. And you can see health manager's log, it may be down as well.
    Because it use the prostgresql too.
    Now the cloud controller uses postgresql-8.4 and postgresql service use
    v9.0. So you should update ip in two versions as 张磊's step 2 tells. The dir
    is: /etc/postgresql/$version number/main/postgresql.confg
    On Saturday, August 4, 2012 9:59:35 AM UTC+8, 磊张 wrote:

    Here's a way to fix it like this:
    1. Check all the files in ../dev_box/config to make sure that the IP
    addresses in that directory have been replaced to new one.
    2. Go to /etc/postgresql and open postgresql.conf, you can find there's a
    * listening address *in that file. Change it to your new IP address
    3. Do the same thing with postgresql-8.4

    在 2012年8月2日星期四UTC+8上午5时32分29秒,Ankit Goel写道:
    *SOME ADDITIONAL DETAILS*
    *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)

    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
    `new'

    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'

    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
    `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:25:in
    `new'

    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
    `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/abstract/connection_pool.rb:229:in
    `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
    `checkout_new_connection'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:42:in
    `checkout'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/initializers/fiber_connection_pool.rb:26:in
    `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:317:in
    `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
    `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:89:in
    `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/base.rb:602:in
    `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/relation/query_methods.rb:275:in
    `build_select'

    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
    `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:149:in
    `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/calculations.rb:169:in
    `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:152:in
    `calculate'

    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
    `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.rb:92:in
    `empty?'

    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
    `any?'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config/final_stage/check_database.rb:3:in
    `<top (required)>'

    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/.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'

    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'

    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
    `<top (required)>'

    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/.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'

    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'

    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/environment.rb:17:in
    `<top (required)>'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `require'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:3:in
    `block in <main>'

    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
    `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
    `initialize'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `new'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/config.ru:1:in
    `<main>'

    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
    `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
    `load'

    from
    /home/ubuntu/cloudfoundry/cloud_controller/cloud_controller/bin/cloud_controller:79:in
    `<main>'
    On Thursday, 2 August 2012 01:01:23 UTC+5:30, Jesse Zhang wrote:

    For the lazy: re-run the setup
    For the rest: you need to re-generate the cloud controller
    configuration. Try to take your current deployed config as a starting
    point, parameterize your IP, and write a small script to fill in that one
    blank.

    Jesse
    On Wed, Aug 1, 2012 at 9:02 AM, Ankit Goel wrote:

    Hi,

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupvcap-dev @
postedAug 1, '12 at 4:02p
activeAug 6, '12 at 8:33a
posts7
users4

People

Translate

site design / logo © 2022 Grokbase