Editing Remote console setup
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | In case you are experiencing a kernel crash ( | + | In case you are experiencing a kernel crash (oops) and have already [[Troubleshooting:Hardware|checked your hardware]], you should report what kernel says to the console to [http://bugzilla.openvz.org/ Bugzilla]. Sometimes kernel crashes so badly that syslogd is not working and what kernel says it never written to a file. If this is the case, you have to catch what kernel says. There are several ways possible. |
− | |||
− | |||
− | |||
− | |||
== Manual/Photo == | == Manual/Photo == | ||
Line 9: | Line 5: | ||
== Serial console == | == Serial console == | ||
− | Here is a description of a common routine that is necessary to set up a serial console | + | Here is a description of a common routine, that is necessary to set up a serial console. |
− | |||
− | |||
− | |||
− | |||
− | Then you need to find | + | First of all you should make sure that your node has a serial port. If there is no such port then |
− | This | + | unfortunately this way is not for you. Then you need to find second node with a serial port on it. |
− | so-called | + | This node will be used to collect logs from your primary mashine. Further you need to acquire |
+ | so-called null modem cable and it must be long enough to connect two mashines in question. | ||
− | + | Ok, suppose, that preliminary operations above are performed and you connect two machines. | |
− | |||
− | |||
In your boot loader add the following kernel parameters: | In your boot loader add the following kernel parameters: | ||
<pre> | <pre> | ||
− | console=ttyS0, | + | console=ttyS0,11500 console=tty0 |
</pre> | </pre> | ||
− | + | For example in GRUB boot loader it looks like such strings in /boot/grub/grub.conf: | |
− | |||
− | |||
− | |||
− | |||
− | For example | ||
<pre> | <pre> | ||
title Fedora Core (2.6.16-026test014.1-smp) | title Fedora Core (2.6.16-026test014.1-smp) | ||
Line 38: | Line 24: | ||
initrd /initrd-2.6.16-026test014.1-smp.img | initrd /initrd-2.6.16-026test014.1-smp.img | ||
</pre> | </pre> | ||
+ | Kernel loaded with such parameters will send all kernel messages to /dev/ttyS0 (serial port). | ||
+ | Also be sure that your null modem cable is connected to appropriate port, if you have several ports. | ||
− | + | On the second node you should turn on any software that can log from /dev/ttyS0. | |
− | |||
− | |||
− | On the second node you should | ||
− | |||
− | |||
It can be usual | It can be usual | ||
<pre> | <pre> | ||
Line 51: | Line 34: | ||
or something more sophisticated: syslogd, watchtty etc. | or something more sophisticated: syslogd, watchtty etc. | ||
− | + | One more important thing. 115200 in the example above is the rate of emiting port. Also recieving port must work at equal rate. | |
− | One more important thing. 115200 in the example above is the rate of | + | To tune ttyS0 rate use stty program: |
<pre> | <pre> | ||
stty 115200 < /dev/ttyS0 | stty 115200 < /dev/ttyS0 | ||
</pre> | </pre> | ||
− | |||
− | |||
== Netconsole == | == Netconsole == | ||
Line 78: | Line 59: | ||
Save the file, then recompile the kernel: | Save the file, then recompile the kernel: | ||
− | + | <pre> | |
− | + | # make bzImage && make modules && make modules_install | |
+ | </pre> | ||
Update your bootloader for the new updated kernel. In my case I use LILO so I just type lilo at the prompt. | Update your bootloader for the new updated kernel. In my case I use LILO so I just type lilo at the prompt. | ||
Line 88: | Line 70: | ||
Next you want your netconsole to send the request to somewhere. Load netconsole module, specifying the remote server parameters: | Next you want your netconsole to send the request to somewhere. Load netconsole module, specifying the remote server parameters: | ||
− | + | <pre># modprobe netconsole netconsole=4444@10.0.2.1/eth0,6666@10.0.2.2/00:05:5D:34:11:AF</pre> | |
This will load the module with your settings. Replace your local IP address with where <tt>10.0.2.1</tt> is, <tt>eth0</tt> with your network interface card device, <tt>6666</tt> with the remote netconsole port (UDP), and <tt>10.0.2.2</tt> with your remote netconsole server IP. Also add in the mac address of your remote netconsole server, which in my case was 00:05:5D:34:11:AF. You can get the MAC address using arp utility: | This will load the module with your settings. Replace your local IP address with where <tt>10.0.2.1</tt> is, <tt>eth0</tt> with your network interface card device, <tt>6666</tt> with the remote netconsole port (UDP), and <tt>10.0.2.2</tt> with your remote netconsole server IP. Also add in the mac address of your remote netconsole server, which in my case was 00:05:5D:34:11:AF. You can get the MAC address using arp utility: | ||
Line 94: | Line 76: | ||
<pre> | <pre> | ||
# ping -c 1 10.0.2.2 | # ping -c 1 10.0.2.2 | ||
− | # /sbin/arp - | + | # /sbin/arp -i 10.0.2.2 |
− | + | ? (10.0.2.2) at 00:05:5D:34:11:AF [ether] on eth2 | |
− | 10.0.2.2 | ||
</pre> | </pre> | ||
− | |||
− | |||
Netconsole documentation is available from <tt>Documentation/networking/netconsole.txt</tt> file under your kernel source directory. | Netconsole documentation is available from <tt>Documentation/networking/netconsole.txt</tt> file under your kernel source directory. | ||
− | === Setting | + | === Setting up remote side === |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Setup netcat on your console server to listen on port 6666 UDP: | |
− | |||
− | |||
− | + | <pre>netcat -u -l -p6666</pre> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
When your kernel prints something on the console, the text will be also captured on this netconsole server. | When your kernel prints something on the console, the text will be also captured on this netconsole server. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:HOWTO]] | [[Category:HOWTO]] | ||
[[Category:Kernel]] | [[Category:Kernel]] | ||
[[Category:Troubleshooting]] | [[Category:Troubleshooting]] |