使用Bosh在OpenStack上部署CloudFoundry碰到的问题(4)

2.3、部署Bosh时碰到的director通信错误

执行bosh deploy发布bosh任务的时候,执行到update director的时候,会因为与虚拟机的通信错误造成失败,错误显示如下:

Updating job director
director/0 (canary) (00:01:58)
Done 1/1 00:01:58

Error 400007: `director/0' is not running after update

Task 3 error

命令行执行bosh vms显示如下:

Deployment `bosh-openstack'

Director task 5

Task 5 done

+----------------------+---------+---------------+--------------------------+
| Job/index | State | Resource Pool | IPs |
+----------------------+---------+---------------+--------------------------+
| blobstore/0 | running | small | 50.50.0.23 |
| director/0 | failing | small | 50.50.0.20, 10.68.19.132 |
| health_monitor/0 | running | small | 50.50.0.21 |
| nats/0 | running | small | 50.50.0.19 |
| openstack_registry/0 | running | small | 50.50.0.22, 10.68.19.133 |
| postgres/0 | running | small | 50.50.0.17 |
| powerdns/0 | running | small | 50.50.0.14, 10.68.19.131 |
| redis/0 | running | small | 50.50.0.18 |
+----------------------+---------+---------------+--------------------------+

VMs total: 8

可以看出director任务的状态是failing,连接到director的虚拟机上查看日志可以看到:

/var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/connection/ruby.rb:26:in `initialize': getaddrinfo: Name or service not known (SocketError)
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/connection/ruby.rb:26:in `new'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/connection/ruby.rb:26:in `block in connect'
from /var/vcap/data/packages/ruby/2.1/lib/ruby/1.9.1/timeout.rb:57:in `timeout'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/connection/ruby.rb:124:in `with_timeout'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/connection/ruby.rb:25:in `connect'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:204:in `establish_connection'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:23:in `connect'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:224:in `ensure_connected'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:114:in `block in process'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:191:in `logging'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:113:in `process'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis/client.rb:38:in `call'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis.rb:150:in `block in get'
from /var/vcap/data/packages/ruby/2.1/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/redis-2.2.0/lib/redis.rb:149:in `get'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/resque-1.15.0/lib/resque/worker.rb:425:in `job'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/resque-1.15.0/lib/resque/worker.rb:357:in `unregister_worker'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/resque-1.15.0/lib/resque/worker.rb:145:in `ensure in work'
from /var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/resque-1.15.0/lib/resque/worker.rb:145:in `work'
from /var/vcap/packages/director/bosh/director/bin/worker:77:in `<main>'

解决办法(命令行执行):

monit stop director
monit start director

执行后没有任何反馈,稍等片刻后回到Bosh Cli的机器上查看虚拟机状态如下:

Deployment `bosh-openstack'
Director task 6

Task 6 done

+----------------------+---------+---------------+--------------------------+
| Job/index | State | Resource Pool | IPs |
+----------------------+---------+---------------+--------------------------+
| blobstore/0 | running | small | 50.50.0.23 |
| director/0 | running | small | 50.50.0.20, 10.68.19.132 |
| health_monitor/0 | running | small | 50.50.0.21 |
| nats/0 | running | small | 50.50.0.19 |
| openstack_registry/0 | running | small | 50.50.0.22, 10.68.19.133 |
| postgres/0 | running | small | 50.50.0.17 |
| powerdns/0 | running | small | 50.50.0.14, 10.68.19.131 |
| redis/0 | running | small | 50.50.0.18 |
+----------------------+---------+---------------+--------------------------+

VMs total: 8

可以看出,director任务已经正常启动,此时,再重新部署下bosh即可正常,注意,不用删除原来的deployements,直接命令行执行bosh deploy即可。

root@bosh-cli:/var/vcap/deployments# bosh deploy
Getting deployment properties from director...
Compiling deployment manifest...
Please review all changes carefully
Deploying `bosh.yml' to `microbosh-openstack' (type 'yes' to continue): yes

Director task 9

Preparing deployment
  binding deployment (00:00:00)
  binding releases (00:00:00)
  binding existing deployment (00:00:00)
  binding resource pools (00:00:00)
  binding stemcells (00:00:00)
  binding templates (00:00:00)
  binding properties (00:00:00)
  binding unallocated VMs (00:00:00)
  binding instance networks (00:00:00)
Done            9/9 00:00:00

Preparing package compilation
  finding packages to compile (00:00:00)
Done            1/1 00:00:00

Preparing DNS
  binding DNS (00:00:00)
Done            1/1 00:00:00

Preparing configuration
  binding configuration (00:00:01)
Done            1/1 00:00:01

Updating job blobstore
  blobstore/0 (canary) (00:02:31)
Done            1/1 00:02:31

Updating job openstack_registry
  openstack_registry/0 (canary) (00:01:44)
Done            1/1 00:01:44

Updating job health_monitor
  health_monitor/0 (canary) (00:01:43)
Done            1/1 00:01:43

Task 9 done
Started        2013-05-21 05:17:01 UTC
Finished        2013-05-21 05:23:00 UTC
Duration        00:05:59

Deployed `bosh.yml' to `microbosh-openstack'

问题解决!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/08f6edbdb24f0628539dadae1d2eefc5.html