关于Cell的基本介绍,可以参考贤哥的一篇文章:

    【OpenStack】G版中关于Nova的Cell  http://blog.csdn.net/lynn_kong/article/details/8564558

详细的代码分析,可以参考gaoxingnengjisuan的blog:

     OpenStack Nova-cell服务的源码解析(编者注:G版)http://blog.csdn.net/gaoxingnengjisuan/article/details/14216977

Cell的服务部署:

Cell的消息路由:

按照官方的推荐部署方案部署:即API Cell只部署nova-api,nova-cells服务,在Child Cell中部署除nova-api之外的全部cell服务(在本人的实际部署中,nova-compute单独部署在另一个节点)

在部署完nova-cells的服务之后,API cell上输入nova-manage service list,输出正常,但只显示本机的nova服务:
 
Binary           Host                                   Zone             Status     State Updated_At
nova-cells       API-cell                             internal         enabled    :-)   2014-04-04 09:57:47
 
在Child Cell 或nova-Compute节点上,输入nova-manage service list,输出也正常,但也只显示本Cell的nova服务:
 
Binary                   Host                                 Zone             Status     State Updated_At
nova-cert                Cell                                 internal         enabled    :-)   2014-04-04 10:00:11
nova-conductor       Cell                                 internal         enabled    :-)   2014-04-04 10:00:19
nova-consoleauth     Cell                                internal         enabled    :-)   2014-04-04 10:00:12
nova-scheduler        Cell                                 internal         enabled    :-)   2014-04-04 10:00:12
nova-cells               Cell                                 internal         enabled    :-)   2014-04-04 10:00:11
nova-compute     Computer3                         nova             enabled    :-)   2014-04-04 10:00:13
但是,在任意节点 终端输入 nova service-list 和 nova   host-list 命令将报错:

命令报错:

ERROR: Theserver has either erred or is incapable of performing the requested operation.(HTTP 500) (Request-ID: req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b)

跟踪 API Cell 节点的 nova-api.log, 输出如下错误信息:

2014-04-04 15:17:25.151 3172 ERROR nova.api.openstack [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb6266a d965a
339b99a4d2da2be18bd0334b9ff] Caught error: invalid literal for int() with base 10: 'api!cell@1'
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack Traceback (most recent call last):
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 1
19, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return req.get_response(self.application)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack application, catch_exc_info=False)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_a
pplication
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py
", line 539, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return self.app(env, start_response) [26/1914]
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __c
all__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack response = self.app(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 938,
in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack content_type, body, accept)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 997,
in _process_stack
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 1078,
in dispatch
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return method(req=request, **action_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 139, in index
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services = self._get_services_list(req, detailed)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 117, in _get_services_list
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services = self._get_services(req)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 86, in _get_services
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack context, set_zones=True)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/compute/cells_api.py", line 469, in service_get_all
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 606, in obj
_make_list
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack **extra_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/service.py", line 67, in _
from_db_object
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack service[key] = db_service[key]
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 405, in __s
etitem__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack setattr(self, name, value)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 66, in sett
er
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return setattr(self, get_attrname(name), typefn(value))
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack ValueError: invalid literal for int() with base 10: 'api!cell@1'
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack
2014-04-04 15:17:25.154 3172 INFO nova.api.openstack [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb6266a d965a3
39b99a4d2da2be18bd0334b9ff] http://192.168.122.12:8774/v2/d965a339b99a4d2da2be18bd0334b9ff/os-services returned with HTTP 500
2014-04-04 15:17:25.155 3172 INFO nova.osapi_compute.wsgi.server [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb
6266a d965a339b99a4d2da2be18bd0334b9ff] 192.168.122.14 "GET /v2/d965a339b99a4d2da2be18bd0334b9ff/os-services HTTP/1.1" status: 500 len
: 335 time: 0.1216350

后来查询了N久,发现社区已有人提出Bugs:https://bugs.launchpad.net/nova/+bug/1251043

并已解决:

  Reviewed: https://review.openstack.org/81282
  Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0df94733f7283cbc1e9ae7d27f5cd443158cae8e

因为在Cell中,主机名的ID 前面加了一个前缀:cell routing path,所以格式为<cell routing path>@ID,而nova object模块里,会用一个int()的方法来将id的字符串变为整数,而int('api!cell@1')显然会报一个ValueError!

Patch 中给出的办法就是用一个代理类ServiceProxy,来处理附加在id前面的cell_paths,如下:

class ServiceProxy(object):
def __init__(self, obj, cell_path):
self._obj = obj
self._cell_path = cell_path @property
def id(self):
return cells_utils.cell_with_item(self._cell_path, self._obj.id) def __getitem__(self, key):
if key == 'id':
return self.id return getattr(self._obj, key) def __getattr__(self, key):
return getattr(self._obj, key)

目前,输入nova service-list,得到正常输出,返回各个节点的nova服务,问题解决:

在Openstack H版部署Nova Cell 时 ,终端输入nova service-list 和 nova host-list 命令将报错的更多相关文章

  1. docker 部署mysql tomcat时 在root@localhost~下——-——docker exec -it 容器名 /bin/bash 报错

    在docker部署mysql时 报错 找不到 容器不自动启动  , docker start 容器名  也没有效果 多次尝试发现 原因是创建容器时在 下面创建的 更改为下创建 问题解决

  2. openstack Q版部署-----nova服务配置-控制节点(5)

    一.创建数据库(控制节点) 创建数据库以及用户: CREATE DATABASE nova_api; CREATE DATABASE nova; CREATE DATABASE nova_cell0; ...

  3. OpenStack H版与 Ceph 整合的现状

    转自:https://www.ustack.com/blog/openstack_and_ceph/ Contents 1 Ceph与Nova整合 2 Ceph与Cinder整合 3 相关Patch ...

  4. openstack Q版部署-----Cinder云存储服务(10)

    一.cinder介绍 一般 cinder-api 和 cinder-scheduler 安装在控制节点上, cinder-volume 安装在存储节点上. 二.数据库配置 # 在任意控制节点创建数据库 ...

  5. openstack Q版部署-----网络服务(neutron)安装部署(7)

    一.数据库配置(控制节点) 控制节点创建数据库: CREATE DATABASE neutron; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'lo ...

  6. openstack Q版部署-----安装报错问题

    1.实例开机提示找不到磁盘Booting from Hard Disk... GRUB. 开启 CPU 虚拟化支持. 将计算节点 nova.conf 配置修改如下即可: [libvirt] cpu_m ...

  7. docker-compose exec时 出现"fork/exec /proc/self/exe: no such file or directory" 报错

    问题:跟往常一样执行docker-compos exec redis sh时出现如下错误,而容器是运行状态中. # docker-compose exec redis sh rpc error: co ...

  8. Dubbo+zookeeper部署到tomcat上注意事项,遇到的问题,闪退,运行报错等

    需要下载工具zookeeper-3.4.14.tar.gz,dubbo-2.5.x.zip,apache-tomcat-8.5.47-windows-x64.zip这些官网都可以先下载到 1.最新的z ...

  9. openstack Q版部署-----nova服务配置-计算节点(6)

    一.服务安装(计算节点) 安装软件: yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容: [DEFAULT] e ...

随机推荐

  1. Oracle 11g 新特性(一)-- 虚拟列

    数据库版本: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Oracle11g 增加了虚拟列的新特性, 具体说明如 ...

  2. 使用bind()扩充作用域

    window.color = "blue"; var o = {color :"red"}; function sayColor(){ alert(this.c ...

  3. struts2 测试错题解析

    解析:$.parseJSON()方法是将字符串转换成Json类型数据,$.getJSON()方法是获取JSON数据,两者不用联合使用. 解析: A:ActionContext接口没有getReques ...

  4. 24种设计模式--适配器模式【Adapter Pattern】

    今天讲适配器模式,这个模式也很简单,你笔记本上的那个拖在外面的黑盒子就是个适配器,一般你在中国能用,在日本也能用,虽然两个国家的的电源电压不同,中国是 220V,日本是 110V,但是这个适配器能够把 ...

  5. PowerDesigner 的几个使用技巧

    1.  生成sql脚本 Database→Generate Database 选择要输出的文件路径,即文件存储路径,并根据需要修改文件名,单击确定后便会生成sql脚本.   在Options选项卡里, ...

  6. iOS: AFNetworking手动配置(iOS7.1, AF2.2.4)

    一.下载AFNetworking. 二.将AFNetworking-master下的AFNetworking目录拖入到项目中 三.为项目添加Linking to a Library or Framew ...

  7. MyEclips:Struts 2 + Hibernate 4 + SQL Server2008

    步骤一:准备 1.下载 sqlJDBC.jar的下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=21599 Hibernate ...

  8. 解决delphi使用sqlite时中文最后一个字是乱码的问题

    给部门同事写了个自动生成测试用例执行情况图表的工具,使用的sqlite3,遇到中文分别使用UTF8Encode和UTF8Decode进行处理,可还是出现了某些字段从数据库中读出时,最后一个汉字是乱码的 ...

  9. Hbase对hive的支持没有hdfs的好的原因 及hbase什么时候使用 及rowkey设计技巧

    hive-=mareduce 的  split  在 hbase就是  region了,,,,,,,访问region必须通过hregionserver 会造成regionser负担过大, 另外 reg ...

  10. hadoo namenode format 异常 java.net.UnknownHostException: localhost.localdomain: localhost.localdomain

    /etc/sysconfig/network换成你在hosts里设置的值 /etc/rc.d/init.d/network restart 重启网络 hostname后就会发现hostname变了,也 ...