18.6. 用串行控制台进行故障解除
串行控制台在解决有难度的问题时很有用。如果虚拟化内核崩溃了,且监控程序(hypervisor)产生了一个错误,你没有办法在本机上来跟踪这个错误。然而,串行控制台允许你在远程主机上捕获它。你必须配置 Xen 主机把数据输出到串行控制台。然后你必须配置远程主机来捕获这些数据。要实现这种方法,你必须修改
grub.conf
文件里的这些选项来在 com1 /dev/ttyS0
上启用一个速率为 38400-bps 的串行控制台:
title Red Hat Enterprise Linix (2.6.18-8.2080_RHEL5xen0) root (hd0,2) kernel /xen.gz-2.6.18-8.el5 com1=38400,8n1 module /vmlinuz-2.618-8.el5xen ro root=LABEL=/rhgb quiet console=xvc console=tty xencons=xvc module /initrd-2.6.18-8.el5xen.img
The
sync_console
can help determine a problem that causes hangs with asynchronous hypervisor console output, and the "pnpacpi=off"
works around a problem that breaks input on the serial console. The parameters "console=ttyS0"
and "console=tty"
means that kernel errors get logged with on both the normal VGA console and on the serial console. Then you can install and set up ttywatch
to capture the data on a remote host connected by a standard null-modem cable. For example, on the remote host you could type:
ttywatch --name myhost --port /dev/ttyS0
这把
/dev/ttyS0
的输出导出至 /var/log/ttywatch/myhost.log
文件。