简体   繁体   English

在 Devstack 中重启 Nova 服务

[英]Restart of Nova services in Devstack

I have tried restarting the Nova services after some modifications in nova.conf file.在 nova.conf 文件中进行了一些修改后,我尝试重新启动 Nova 服务。

While trying to restart I am getting the error that unrecognized service.在尝试重新启动时,我收到无法识别服务的错误。

I know that way to restart nova services in devstack was different.我知道在 devstack 中重启 nova 服务的方式是不同的。

Someone provide me the clear way for doing the same.有人为我提供了明确的方法来做同样的事情。

Another way: screen -x to list available screen sessions.另一种方法: screen -x列出可用的屏幕会话。 ctrl+a , " to get list of available windows. Go to n-cpu and stop it with ctrl+c, than press arrow up to get last command in terminal and press enter to run it. Depends on you conf changes you will be need to restart other services (the start with 'n-', for example, n-api, n-cond and so one). ctrl+a , "获取可用窗口列表。转到 n-cpu 并使用 ctrl+c 停止它,然后按arrow up以获取终端中的最后一个命令,然后按 Enter 运行它。取决于您的 conf 更改,您将需要重启其他服务(以'n-'开头,例如n-api、n-cond等)。

I'm not sure if it is ok to recommend URC channel on the StackOverflow, but also there is #openstack-nova channel in IRC (on freenode server).我不确定是否可以在 StackOverflow 上推荐 URC 频道,但在 IRC(在 freenode 服务器上)也有 #openstack-nova 频道。 It could be useful (and faster way to get answer) to ask there, if you have problems with something nova-related.如果您遇到与 nova 相关的问题,在那里询问可能会很有用(并且可以更快地获得答案)。

I found the way for same:我找到了相同的方法:

   * First cd to folder devstack

   * You can find the file ./rejoin_stack.sh

   * Execute the same.

   * It will be executed and screen will be opened for access.

   * press ctrl + a + shift + '

   * Then it will be listing the running services

   * can move to service which needs to be stopped by scrolling towards it.

   * on the service which is needs to be stopped press enter

   * then press ctrl + c , it will stop the service

   * then press up arrow key to run the service again

   * service will be restarted successfully.

Not exactly a way of restarting Nova, but could help, too.不完全是重新启动 Nova 的方法,但也有帮助。 It's a hack, though.不过,这是一个黑客。

The ./rejoin_stack.sh has been removed from DevStack , and even screen does not seem to work for me; ./rejoin_stack.sh 已从./rejoin_stack.sh 中删除,甚至screen似乎对我不起作用; it does not show the menu and does not accept the CTRL sequences (I blame my running DevStack in Docker for it, but not important).它不显示菜单,也不接受 CTRL 序列(我责怪我在 Docker 中运行 DevStack,但这并不重要)。

So this is where the hack comes handy.所以这就是黑客派上用场的地方。 All DevStack services are restarted by running ./unstack.sh and ./stack.sh , but during that time, nova.conf modifications are dropped.所有./unstack.sh服务都通过运行./unstack.sh./stack.sh重新启动,但在此期间, nova.conf修改被删除。 The hack is to modify /devstack/lib/nova which works as a template for nova.conf , so that after rerunning ./stack.sh the nova.conf contains the intended values. hack 是修改/devstack/lib/nova作为nova.conf的模板,以便在重新运行./stack.shnova.conf包含预期的值。

Newer versions of DevStack runs it's services as systemd unit files so, you can use systemctl to manage them.较新版本的 DevStack 将其服务作为systemd单元文件运行,因此您可以使用systemctl来管理它们。

List all services:列出所有服务:

sudo systemctl list-units devstack@*

Restart any individual service (replace n-cpu.service with the service name):重新启动任何单个服务(将n-cpu.service替换为服务名称):

sudo systemctl restart devstack@n-cpu.service

Restart all services.重启所有服务。

sudo systemctl restart devstack@*

Refer OpenStack Documentation for more details.有关更多详细信息,请参阅OpenStack 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM