|
发表于 2006-12-29 17:07:26
|
显示全部楼层
原文:http://boinc.berkeley.edu/server_debug.php
Debugging Server Components
为伺服器组件除错
A grab-bag of techniques for debugging BOINC server software :
下列是为BOINC伺服器软件除错的技巧:
Log files
日志档案
Most error conditions are reported in the log files. Make sure you know where these are. If you're interested in the history of a particular WU or result, grep for WU#12345 or RESULT#12345 (12345 represents the ID) in the log files. The html/ops pages also provide an interface for this.
多数的错误情况将会被记录在日志档案中。确定你知道它们在哪里。如果你对某个WU或者计算结果的历史有兴趣,请在日志文件中搜索WU#12345或RESULT#12345 (12345代表编号)。网上管理界面也为此提供了接口。
Database query tracing
数据库查询追踪
If you uncomment the symbol SHOW_QUERIES in db/db_base.C, and recompile everything, all database queries will be written to stderr (for daemons, this goes to log files; for command-line apps it's written to your terminal). This is verbose but extremely useful for tracking down database-level problems.
如果你在db/db_base.C中去掉符号SHOW_QUERIES的注释,并重新编译所有源代码,所有的数据库查询语句将会被写入stderr (对于系统服务,这将记录在日志档案;对于命令行程序它将记录在你的终端)。虽然这非常麻烦但是对于追踪数据库级别的问题非常有用。
Getting core dumps from the scheduler
从调度器中获取核心的调试信息 (不确定dump是否可以翻译成调试信息)
In sched/main.C put:
在sched/main.C中插入:
#define DUMP_CORE_ON_SEGV 1
and recompile.
并重新编译。
Running the scheduler under a debugger
在除错器下运行调度器
The scheduler is a CGI program. It reads from stdin and writes to stdout, so you can also run it with a command-line debugger like gdb:
调度器是一个CGI程序,它从stdin读取资料并从stdout输出资料,所以你也可以通过一个命令行除错器来执行它。
Copy the "scheduler_request_X.xml" file from a client to the machine running the scheduler. (X = project URL)
从一个客户端中拷贝 "scheduler_request_X.xml" 到运行调度器的机器中。(X = 项目URL)
Run the scheduler under the debugger, giving it this file as stdin, i.e.:
在除错器下运行调度器,将这个档案作为stdin,即:
gdb cgi
(set a breakpoint)
r < scheduler_request_X.xml
You may have to doctor the database as follows :
你也必须根据下列来(doctor)数据库
update host set rpc_seqno=0, rpc_time=0 where hostid=N
to keep the scheduler from rejecting the request.
以避免调度器拒绝请求。
This is useful for figuring out why your project is generating 'no work available' messages. As an alternative to this, edit handle_request.C, and put a call to debug_sched(sreq, sreply, "../debug_sched") just before sreply.write(fout). Then, after recompiling, touch a file called 'debug_sched' in the project root directory. This will cause transcripts of all subsequent scheduler requests and replies to be written to the cgi-bin/ directory with separate small files for each request. The file names are sched_request_H_R where H=hostid and R=rpc sequence number. This can be turned off by deleting the 'debug_sched' file.
这对于摸清你的项目产生 'no_work_available' 的原因很有帮助。您也可以编辑handle_request.C,然后置入一个在sreply.write(fout)之前的对debug_sched(sreq, sreply, "../debug_sched")函数的呼叫。在重新编译过后,在项目的根目录中将会出现 'debug_sched'。这将把之后所有的调度器请求和回复记录在 cgi-bin/ 目录。每个请求都会被分割成各小档案。档名为sched_request_H_R,其中H=hostid(主机编号),R=rpc sequence number (RPC序号)。这项功能可以通过删除'debug_sched'这个档案来关闭。
MySQL interfaces
MySQL接口
You should become familiar with MySQL tools such as
你应该已经熟悉下列的MySQL工具:
mytop : like 'top' for MySQL
mytop : 对于MySQL的类似'top'的工具
the mysql interpreter ('mysql') and in particular the 'show processlist;' query.
MySQL的直译器('mysql'),特别是'show processlist;'(显示进程列表)这项查询。
MySQLadmin : general-purpose web interface to MySQL
MySQLadmin : 常用的MySQL网上管理界面
general-purpose不知道是通用还是常用的,好像两个都通用。。。还是这里指的是常用的功能?
[ Last edited by 静思夜 on 2006-12-29 at 17:11 ] |
评分
-
查看全部评分
|