- 论坛徽章:
- 0
|
这周需要建立一台netdump服务器用来存储memory dump,所以写了个小结以备以后需要的候查看。
NetDump是客户端-服务器端的结果,如果需要使用的话,需要同时在服务器,客户端进行配置。
配置也比较简单,可能是因为使用不多的原因,所以比较少有这方面的文档。Linux的Netdump实际跟
Windows的Dump差不多,就是在内核发生崩溃的时候把内存里面的内容存放在一个文件供所后Troubleshooting
分析。windows是存在系统分区下windows目录,名字是以Memory.dmp 命令的。而在Unix一般在kernel crash发生
的时候存放在SWAP分区,所以在我的另一个讨论内存的贴子中,关于SWAP方面问题,一位仁兄认为SWAP一定要比内存大(在UNIX下)。
而Linux一般情况下是一台由中心服务器提供给企业所有的服务器做netdump,就像syslog server一样。Netdump有两个功能,一个是在Kernel Crash的时候Client会通过UDP把他的MEMORY DUMP到服务器这个叫netdump.
另一个是把控制台上的信息发送到syslog服务器,这个叫netsole,因为kernel出问题的时候会在屏幕上显示一些信处,如果管理员不能接触到服务器的话,可以看syslog服务器来看当时console上显示的信息,这个功能叫netsole,这个功能的服务依赖于syslogd的功能。
下面是小结的内容。
1. RPM
Client netdump-x-x-x.rpm
Server netdump-server-x-x-x.rpm
2. Configuration
Server:
For netdump
(1) Verify enough free space in /var/crash for memory dump.
(2) Set the password for user netdump.
(3) Enable sshd service.
#service sshd start
(4) Enable netdump-server service.
#service netdump-server start
#chkconfig --level 345 netdump-server on
For Netconsole need a remote syslog server.
Add the -r option to SYSLOGD_OPTIONS in /etc/sysconfig/syslog
Client:
(1)configure file
The main client-side configuration file is /etc/sysconfig/netdump
-SYSLOGADDR for netconsole
-NETDUMPADDR for netdump
For example:
NETDUMPADDR=192.168.0.3
SYSLOGMACADDR=192.168.0.3
(2)copy DSA public key to server netdump user, for dump the memory to the server by sshd without prompt password.
Run the comand "#service netdump propagate" on the client, This will copy the 64-session key /etc/sysconfig/netdump_id_dsa.pub to the server /var/crash/.ssh/authorized_key2.
(3) Start netdump service.
#service netdump start
#chkconfig --level 345 netdump on
Examine the log file /var/log/message to verify theat network card is supported.
3. The netdump Protocol
On client startup:
copy the 64-bit session cookie to netdump server by ssh.
send netdump start message to server.
On client crash:
Client send kernel crash message to server.
Server get the memory dump and crash signature from clietn.
When the transfer compleses, the client send a "netdump reboot" message to server and reboot.
BTW, a 4 GB memroy over 100M ethernet should take about five minutes.
The crash file in /var/crash/Clietn_IP_address$Date$time.
5. Testing
Compile the crash.c program in the /usr/share/doc/netdump-0.*.*
gcc-DKERNEL -DMODULE -I /lib/modules/$(uname -r)/build/include -c crash.c
insmod ./crash.o
If everythink is working, the client should crash, pause for a short delay to dump memory, and then reboot.
See the folder /var/crash on the server. |
|