Restarting a service in Openstack installed using Devstack
Asked Answered
P

7

8

How to restart a specific openstack-service installed using devstack?

Puncture answered 11/5, 2014 at 13:58 Comment(0)
B
1

When ./stack.sh completes, openstack is ostensibly running.

as your stack user, you can then issue this command:

screen -dr

this should open up a screen session with windows for each of the services. the services are running from those screen terminal sessions or ptys.

you can simply kill the process and restart it from those ptys.

of course standard logical order of operations apply. if mysql is dead, nova-api won't start up very well. same goes for keystone being off. so, pay attention to dependencies.

if you are unsure of how to execute the services in the terminals, first do a ps auxww | grep service or something to that affect. That should provide some insight on how to run the binaries again.

Good luck.

Bellicose answered 12/5, 2014 at 3:46 Comment(2)
is there a way to do this through a command similar to service xxxxx restart? I want to automate this. Not able to do it currently.Rrhoea
I wrote this years ago... there may be service definitions in devstack now, but I doubt it. it's not what devstack is intended to be used for.Bellicose
S
4

Rejoin stack screen as

./rejoin-stack.sh

and move to the specified service page using ctrl+a+", then type the number of the screen you need to go.

Hit 9 and then ctrl+C. The service would be stopped now. Re-run the following devstack command to start the service: (e.g for nova-network) cd /opt/stack/nova && /usr/bin/nova-network --config /etc/nova/nova.conf || echo "n-net failed to start" | tee "/opt/stack/stack/n-net.failure"

Hit Ctrl+d to detach from the stack screen.

Skylight answered 6/8, 2014 at 18:39 Comment(1)
But how to start it after I kill the process with the kill -9 command. I dont see the n-cpu screen after I do kill -9 <pid>Rrhoea
P
3

To run screen command

 screen -r 

Now, you will be in screen window and you can see the list of Openstack services; Like "q-svc", "horizon", "key-access" in the bottom of the screen; The current active screen will be marked with * like "horizon*"

To move to specific Openstack service press

         "Ctrl + a" and "0-9" 
         Example: "Ctrl + a" 5

to jump to actual service; You can also move to next or previous screen using the below commands

         "Ctrl + a" and n  --- > for next
         "Ctrl + a" and p  --- > for previous

Now to stop and start the service; Go the respective screen window and press

         "Ctrl + c" 

To stop the service; This will now show the bash screen in the respective screen window; and to start the service, press UP arrow mark to see the last executed command in the screen window and press enter to start the same.

Life is easier with screen to start and stop the Openstack services configured to run with Devstack.

Prominence answered 23/4, 2015 at 6:19 Comment(2)
But how to start it after I kill the process with the kill -9 command. I dont see the n-cpu screen after I do kill -9 <pid>Rrhoea
You should know the path of the binary and the arguments that were passed to the binary; kill -9 outside screen is not advisable; Go to screen to stop and start the service; That would be right choice.Prominence
B
1

When ./stack.sh completes, openstack is ostensibly running.

as your stack user, you can then issue this command:

screen -dr

this should open up a screen session with windows for each of the services. the services are running from those screen terminal sessions or ptys.

you can simply kill the process and restart it from those ptys.

of course standard logical order of operations apply. if mysql is dead, nova-api won't start up very well. same goes for keystone being off. so, pay attention to dependencies.

if you are unsure of how to execute the services in the terminals, first do a ps auxww | grep service or something to that affect. That should provide some insight on how to run the binaries again.

Good luck.

Bellicose answered 12/5, 2014 at 3:46 Comment(2)
is there a way to do this through a command similar to service xxxxx restart? I want to automate this. Not able to do it currently.Rrhoea
I wrote this years ago... there may be service definitions in devstack now, but I doubt it. it's not what devstack is intended to be used for.Bellicose
H
1

rejoin-stack.sh was remove according this git commit, you need to do screen -c /path/to/devstack_install/stack-screenrc

Hedelman answered 25/10, 2016 at 17:30 Comment(0)
Q
1

Run this command as root (for example: to start keystone service)

$ systemctl start [email protected]

You can use restart, stop, status, etc. in place of start as your need.

you can use wildcard as well. Like as below.

$ systemctl start devstack@*

=> it will start all devstack services.

Quinate answered 11/5, 2017 at 3:39 Comment(0)
M
0

Things has changed in new version devstack.

By default DevStack is run with all the services as systemd unit files. Systemd is now the default init system for nearly every Linux distro, and systemd encodes and solves many of the problems related to poorly running processes.

Assuming the unit n-cpu to make the examples more clear.

Enable a unit (allows it to be started):
sudo systemctl enable [email protected]

For more information, visit https://docs.openstack.org/devstack/latest/systemd.html

Mozza answered 30/8, 2020 at 13:37 Comment(0)
G
0

you can use systemctl start devstack@* to restart every devstack service

Gondi answered 23/6, 2021 at 19:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.