Devstack-screen Use of Debugging Tools

Source: Internet
Author: User
Catalogue

Why does the catalog use the screen tool to start the switch for screen screens? Frequently exiting and reconnecting the screen Restart OpenStack Service screen Directive options Overview OpenStack Restart instructions Glance-a Pi glance-registry nova-api nova-conduter nova-crt nova-network nova-scheduter nova-novnc nova-cauth nova-cpu c-api C-sch C-vol

Why use the screen tool.

When Devstack compiles and installs OpenStack, we cannot interact with the various OpenStack Services through INIT scripts or service directives.
This means that we cannot restart the NOVA-API service with the Systemctl restart Openstack-nova-api.serice as with the RDO installation.
Because Devstack is designed to facilitate OpenStack developers to develop and debug OpenStack code, Devstack can only start the service through screen, and each Openstack services is a child Screen. Devstack deployed Openstack believes that everyone will encounter a problem, when the physical machine restarts after the Services how to restart, in fact, only need to execute./rejoin-stack.sh, the principle is the same as the start screen, will not start the Services is started and will not be overwritten, and automatically enters screen when the boot is complete. In screen we can not only start services, we also have a very clear and easy way to switch between the logs of each services. This article mainly introduces the use of screen, it should be more than Openstack developers must have the necessary skills. Start Screen

Screen-x Stack

Note : If the startup fails, you can try to start again after executing the following instruction:

Script/dev/null

You can see a string of white strings at the bottom of the Terminal, each of which corresponds to a sub screen, which is an Openstack services.
We can switch to the corresponding sub screen by a combination of shortcut keys + numbers. The location where the ' * ' is located indicates that the current screen is the screen of the Service. EXAMPLE:

14$ (l) C-api  15-$ (l) C-sch   16$ (l) c-vol*
Screen Switching (common)

Ctrl + A + number: Switch to the sub-screen in which the digital numbers correspond (# = = 0⇒shell)

CTRL + A + ' ⇒ Enternumber: When number > 10 o'clock, you can use this method to switch, of course number < 10 o'clock, can also be used. Recommended *

CTRL + A + N : Switch to the next screen

CTRL + A + P: Switch to previous screen

CTRL + A + a: Return to the previous screen

CRTL + A + wait a second + SHIFT + ': show a list of all screens

CTRL + [: Start scrolling mode, then use the up and down keys to scroll the screen

CTRL +] : Exiting scrolling mode

CTRL + A + H : Save screen to log file and press stop to save

CTRL + A +? : Get help information to exit and reconnect screen

exit : CRTL + A + ' ⇒ Enter 0 , then enter screen-d CRTL + A + D

Reconnect :

#查看当前用户启动的 screen
fanguiju@jmilkfan:~$ screen-ls   
There are a screen on:
    20569.stack (08/02/16 11:36:47) ( Detached)
1 Socket in/var/run/screen/s-fanguiju.

#上一条指令的Output
fanguiju@jmilkfan:~$ screen-r 20569  
Restart Openstack Services

CTRL + C: Terminates a screen, stop the services

Enter the screen of the Openstack Services you want to Restart, and then enter CTRL + C to end the process, enter ↑ and re-execute the previous instruction.
screen Directive options Overview

fanguiju@fanguiju:~/devstack$ screen--help use:screen [-opts] [cmd [args]] or:screen-r [Host.tty] Options: 4
Resolve hostnames only to IPV4 addresses.
-6 Resolve hostnames only to IPV6 addresses.
-a force all capabilities to each window ' s termcap. -A-[r|
R] Adapt All windows to the new display width & height.
-C file Read configuration file instead of '. SCREENRC '.
-D (-R) Detach the elsewhere running screens (and reattach here).
-dms name Start as Daemon:screen session in detached mode.
-D (-R) Detach and logout remote (and reattach here).
-D-RR do whatever are needed to get a screen session.
-e XY change command characters.
-F Flow control on,-FN = off,-fa = Auto.
-H lines Set the size of the Scrollback history buffer.
-I Interrupt output sooner when flow control was on.
-L Login mode on (update/var/run/utmp),-ln = off. -ls [Match] or-list. Do nothing, JuSt List our Sockdir [on possible matches].
-l Turn on output logging.
-M Ignore $STY variable, do create a new-screen session.
-O Choose optimal output rather than exact VT100 emulation.
-P window preselect the named window if it exists. -Q Quiet startup.
Exits with Non-zero return code if unsuccessful.
-R [Session] reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-S shell shell to execute rather than $SHELL.
-S Sockname Name this session <pid>.sockname instead of <pid>.<tty>. 
Openstack Restart Command 

One of the most inconvenient things about screen is that some computers can't scroll through the CTRL + [|] , which is not a good way to observe Log, so it is recommended that the start command Copy another Terminal execute.
Note : The/opt/stack/parameters of the following directives vary depending on the installation path of each individual.
Restart glance: glance-api

/usr/local/bin/glance-api--config-file=/etc/glance/glance-api.conf & Echo $! >/opt/stack/status/stack/g-api.pid; FG | | echo "G-api failed to start" | Tee "/opt/stack/status/stack/g-api.failure"
Glance-registry
/usr/local/bin/glance-registry--config-file=/etc/glance/glance-registry.conf & Echo $! >/opt/stack/status/stack/g-reg.pid; FG | | echo "G-reg failed to start" | Tee "/opt/stack/status/stack/g-reg.failure"
Nova-api
Sudo/usr/local/bin/nova-api & Echo $! >/opt/stack/status/stack/n-api.pid; FG | | echo "N-api failed to start" | Tee "/opt/stack/status/stack/n-api.failure"
Nova-conduter
/usr/local/bin/nova-conductor--config-file/etc/nova/nova.conf & Echo $! >/opt/stack/status/stack/n-cond.pid; FG | | echo "N-cond failed to start" | Tee "/opt/stack/status/stack/n-cond.failure"
NOVA-CRT
/usr/local/bin/nova-cert--config-file/etc/nova/nova.conf & Echo $! >/opt/stack/status/stack/n-crt.pid; FG | | echo "N-crt failed to start" | Tee "/opt/stack/status/stack/n-crt.failure"
nova-network
/usr/local/bin/nova-network--config-file/etc/nova/nova.conf & Echo $! >/opt/stack/status/stack/n-net.pid; FG | | echo "N-net failed to start" | Tee "/opt/stack/status/stack/n-net.failure"
Nova-scheduter
/usr/local/bin/nova-scheduler--config-file/etc/nova/nova.conf & Echo $! >/opt/stack/status/stack/n-sch.pid; FG | | echo "N-sch failed to start" | Tee "/opt/stack/status/stack/n-sch.failure"
Nova-novnc
/usr/local/bin/nova-novncproxy--config-file/etc/nova/nova.conf--web/opt/stack/novnc & Echo $! >/opt/stack/status/stack/n-novnc.pid; FG | | echo "N-novnc failed to start" | Tee "/opt/stack/status/stack/n-novnc.failure"
Nova-cauth
/usr/local/bin/nova-consoleauth--config-file/etc/nova/nova.conf & Echo $! >/opt/stack/status/stack/n-cauth.pid; FG | | echo "N-cauth failed to start" | Tee "/opt/stack/status/stack/n-cauth.failure"
nova-cpu
SG libvirtd '/usr/local/bin/nova-compute--config-file/etc/nova/nova.conf ' & Echo $! >/opt/stack/status/stack/n-cpu.pid; FG | | echo "N-cpu failed to start" | Tee "/opt/stack/status/stack/n-cpu.failure"

Restart Cinder: c-api

/usr/local/bin/cinder-api--config-file/etc/cinder/cinder.conf & Echo $! >/opt/stack/status/stack/c-api.pid; FG | | echo "C-api failed to start" | Tee "/opt/stack/status/stack/c-api.failure"
C-sch
/usr/local/bin/cinder-scheduler--config-file/etc/cinder/cinder.conf & Echo $! >/opt/stack/status/stack/c-sch.pid; FG | | echo "C-sch failed to start" | Tee "/opt/stack/status/stack/c-sch.failure"
C-vol
/usr/local/bin/cinder-volume--config-file/etc/cinder/cinder.conf & Echo $! >/opt/stack/status/stack/c-vol.pid; FG | | echo "C-vol failed to start" | Tee "/opt/stack/status/stack/c-vol.failure"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.