Restarting a service in Openstack installed using Devstack

14,901

Solution 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.

Solution 2

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.

Solution 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.

Solution 4

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

Solution 5

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.

Share:
14,901
user3170122
Author by

user3170122

Updated on June 05, 2022

Comments

  • user3170122
    user3170122 almost 2 years

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