gpt4 book ai didi

python - 重新启动管理服务后,Nova 计算和网络无法联系 nova 服务

转载 作者:太空宇宙 更新时间:2023-11-03 19:07:06 26 4
gpt4 key购买 nike

我为 openstack 设置了 2 个节点。

第一个节点包含管理服务,例如 nova-apinova-scheduler、'glance` ...第二个节点包含网络和计算服务。

当我检查nova-manage service list时,所有服务都会显示。

当我重新启动管理节点(节点 1)时,计算已断开连接。

当计算尝试连接管理节点时,它在计算日志中显示错误。

2013-01-21 20:49:28 TRACE nova.manager Traceback (most recent call last):
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib/python2.6/site-packages/nova/manager.py", line 155, in periodic_tasks
2013-01-21 20:49:28 TRACE nova.manager task(self, context)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2244, in _heal_instance_info_cache
2013-01-21 20:49:28 TRACE nova.manager context, self.host)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib/python2.6/site-packages/nova/db/api.py", line 594, in instance_get_all_by_host
2013-01-21 20:49:28 TRACE nova.manager return IMPL.instance_get_all_by_host(context, host)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 103, in wrapper
2013-01-21 20:49:28 TRACE nova.manager return f(*args, **kwargs)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/api.py", line 1582, in instance_get_all_by_host
2013-01-21 20:49:28 TRACE nova.manager return _instance_get_all_query(context).filter_by(host=host).all()
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 1922, in all
2013-01-21 20:49:28 TRACE nova.manager return list(self)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2032, in __iter__
2013-01-21 20:49:28 TRACE nova.manager return self._execute_and_instances(context)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2047, in _execute_and_instances
2013-01-21 20:49:28 TRACE nova.manager result = conn.execute(querycontext.statement, self._params)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1399, in execute
2013-01-21 20:49:28 TRACE nova.manager params)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1532, in _execute_clauseelement
2013-01-21 20:49:28 TRACE nova.manager compiled_sql, distilled_params
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1640, in _execute_context
2013-01-21 20:49:28 TRACE nova.manager context)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1633, in _execute_context
2013-01-21 20:49:28 TRACE nova.manager context)
2013-01-21 20:49:28 TRACE nova.manager File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.3-py2.6-linux-x86_64.egg/sqlalchemy/engine/default.py", line 330, in do_execute
2013-01-21 20:49:28 TRACE nova.manager cursor.execute(statement, parameters)
2013-01-21 20:49:28 TRACE nova.manager OperationalError: (OperationalError) socket not open

当我重新启动计算和网络服务时,问题就解决了。但直到我重新启动计算或网络才会出现错误。

当我检查为 Controller 打开的套接字的计算时。

[root@compute ~]# ps -ef | grep compute
nova 30859 1 27 18:51 ? 00:00:03 /usr/bin/python /usr/bin/nova-compute --config-file /etc/nova/nova.conf --logfile /var/log/nova/compute.log
root 30996 30807 0 18:51 pts/0 00:00:00 grep compute

[root@compute ~]# netstat -p | grep 30859
tcp 0 0 compute:56988 controller:postgres ESTABLISHED 30859/python
tcp 0 0 compute:37869 controller:amqps ESTABLISHED 30859/python
tcp 0 0 compute:37871 controller:amqps ESTABLISHED 30859/python
unix 3 [ ] STREAM CONNECTED 3588759 30859/python

有 2 个 socket 可供 Controller 打开。 postgresamqps。当我在 Controller 上运行reboot now并检查 Controller 可用的套接字数量时。

[root@compute ~]# netstat -p | grep 30859
tcp 208 0 compute:56988 controller:postgres CLOSE_WAIT 30859/python
unix 3 [ ] STREAM CONNECTED 3590103 30859/python
unix 3 [ ] STREAM CONNECTED 3588759 30859/python

在此 postgres 套接字已关闭。

当 Controller 中出现所有服务时。我运行相同的命令来检查连接到 Controller 的套接字。我得到了同样的结果。

为什么计算不为 postgres 创建新的套接字?

最佳答案

您收到的套接字错误来自 nova-compute 尝试联系您在 nova.conf 中配置的数据库,正如 Matt Joyce 上面指出的那样。在日志的前面,您可以看到服务配置的所有值。查找字符串“Full set of FLAGS” - 这至少会提示其中配置的内容 - 它从日志输出中隐藏了“sql_connection”的实际值(因为它通常嵌入了密码),但它可能有助于解释那里发生的事情。

根据我读到的您的问题,nova-compute 日志文件显示此错误直到您重新启动服务。我是否正确地理解它之后就可以工作了?

假设这是正确的,安装基础包后是否有一些东西正在配置 nova?在服务启动后添加配置详细信息的 Chef、Puppet 或类似操作可能会使用错误的配置?

关于python - 重新启动管理服务后,Nova 计算和网络无法联系 nova 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14442005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com