DB2 进程 db2fmcd, db2fmd, db2fcmd 区别, 故障监视器详解

db2fmcd: 故障监视器协调程序(Fault Monitor Coordinator)守护程序进程, 每个物理机器只有一个这样的进程。该进程只有在UNIX下存在。
db2fmd:  为每个故障监视器监控的db2实例而启动的故障监视器守护程序进程,该进程是由协调守护程序(db2fmcd)监控的,每个实例对应一个该进程(如果启动的话)。因此,如果杀死db2fmd经常,那么db2fmcd将使其重新运行。 该进程只有在UNIX下存在。
db2fcmd: FCM(Fast Communication Manager)快速通信管理器守护程序,用于处理分区间的通信。每个服务器,每个分区就有一个这样的进程。 该进程只存在于多分区的环境中。

db2fmcd与db2fmd之间有关系。 db2fcmd 与它们二者没有半毛钱的关系。 分别有两个对应的命令来启动db2fmcd和db2fmd, 即db2fmcu , db2fm.

-------------------------------------------------------------------------------------------------

 

db2fmcu - DB2 fault monitor controller command

 

DB2? Fault Monitor is the DB2 database facility that automatically starts an instance after a crash. It can also auto restart an instance on machine reboot. You can configure the DB2 fault monitor on Linux and UNIX operating systems using the DB2 fault monitor controller command. The command must be run as root because it accesses the system's inittab file.

Authorization

Root user authority

Required connection

None

Command syntax

>>-db2fmcu--+------------------------+--+--------------+-------><
            +- -u-- -p--db2fmcd_path-+  '- -f--inittab-'   
            '- -d--------------------'                     

Command parameters

-u -p db2fmcd_path

This option re-configures the inittab file to include the fault monitor controller (FMC) at system startup, where db2fmcd_path is the complete path to the FMC daemon (db2fmcd) object, for example /opt/IBM/db2/bin/db2fmcd.

-d

This option changes the inittab file configuration to prevent the FMC from being run at system startup.

-f inittab

This option specifies a path to the inittab file.

----------------------------------------------------------------------

 

db2fm - DB2 fault monitor command

Controls the DB2? fault monitor daemon. You can use db2fm to configure the fault monitor.

This command is only available on UNIX operating systems.

Authorization

Authorization over the instance against which you are running the command.

Required connection

None

Command syntax

>>-db2fm--+- -t--service--+-- -m--module path------------------->
          '- -i--instance-'                     

>--+--------------+--------------------------------------------><
   +- -u----------+   
   +- -d----------+   
   +- -s----------+   
   +- -k----------+   
   +- -U----------+   
   +- -D----------+   
   +- -S----------+   
   +- -K----------+   
   +- -f--+-on--+-+   
   |      '-off-' |   
   +- -a--+-on--+-+   
   |      '-off-' |   
   +- -T--T1/T2---+   
   +- -l--I1/I2---+   
   +- -R--R1/R2---+   
   +- -n--email---+   
   +- -h----------+   
   '- -?----------'   

Command parameters

-m module-path

Defines the full path of the fault monitor shared library for the product being monitored. The default is $INSTANCEHOME/sqllib/lib/libdb2gcf.

-t service

Gives the unique text descriptor for a service.

-i instance

Defines the instance of the service.

-u

Brings the service up.

-U

Brings the fault monitor daemon up.

-d

Brings the instance down.

-D

Brings the fault monitor daemon down.

-k

Kills the service.

-K

Kills the fault monitor daemon.

-s

Returns the status of the service.

-S

Returns the status of the fault monitor daemon. The status of the service or fault monitor can be one of the following

  • Not properly installed,
  • INSTALLED PROPERLY but NOT ALIVE,
  • ALIVE but NOT AVAILABLE (maintenance),
  • AVAILABLE, or
  • UNKNOWN

-f on | off

Turns fault monitor ON or OFF. If this option is set off, the fault monitor daemon will not be started, or the daemon will exit if it was running.

-a on | off

Activates or deactivates fault monitoring. If this option if set to OFF, the fault monitor will not be actively monitoring, which means if the service goes down it will not try to bring it back.

-T T1/T2

Overwrites the start and stop time-out.For example:

  • -T 15/10 updates the two time-outs respectively
  • -T 15 updates the start time-out to 15 secs
  • -T /10 updates the stop time-out to 10 secs

-I I1/I2

Sets the status interval and time-out respectively.

-R R1/R2

Sets the number of retries for the status method and action before giving up.

-n email

Sets the email address for notification of events.

-h | -?

Displays command usage help.

--------------------------------------------------------------------------

 

 

DB2 故障监视器注册表文件

 

在启动故障监视器守护程序时,会为每台物理机器上的每个 DB2? 数据库管理器实例创建故障监视器注册表文件。此文件中的关键字和值指定故障监视器的行为。

可在 /sqllib/ 目录中找到故障监视器注册表文件,文件名为 fm.<machine_name>.reg。通过使用 db2fm 命令可以改变此文件。

如果故障监视器注册表文件不存在,那么将使用缺省值。

以下是故障监视器注册表文件的内容示例:

   FM_ON = no
   FM_ACTIVE = yes
   START_TIMEOUT = 600
   STOP_TIMEOUT = 600
   STATUS_TIMEOUT = 20
   STATUS_INTERVAL = 20
   RESTART_RETRIES = 3 
   ACTION_RETRIES = 3 
   NOTIFY_ADDRESS = <instance_name>@<machine_name>

故障监视器注册表文件关键字

FM_ON

指定是否应启动故障监视器。如果该值设置为 NO,那么将不启动故障监视器守护程序,或者如果已经启动,那么将关闭该程序。缺省值是 NO。

FM_ACTIVE

指定故障监视器是否处于活动状态。仅当 FM_ON 和 FM_ACTIVE 都设置为 YES 时,故障监视器才执行操作。如果 FM_ON 设置为 YES 并且 FM_ACTIVE 设置为 NO,那么将启动故障监视器守护程序,但故障监视器不活动。这意味着如果 DB2 关闭,那么不会尝试将它重新联机。缺省值为 YES。

START_TIMEOUT

指定故障监视器必须在其内启动它监视的服务的时间长短。缺省值为 600 秒。

STOP_TIMEOUT

请指定一个时间段,故障监视器必须在该时间段内关闭它所监视的服务。缺省值为 600 秒。

STATUS_TIMEOUT

指定故障监视器必须在其内获取它监视的服务的状态的时间长短。缺省值为 20 秒。

STATUS_INTERVAL

指定用来获取受监视的服务的状态的两次连续调用之间的最小时间。缺省值为 20 秒。

RESTART_RETRIES

指定在尝试失败之后故障监视器将尝试获取受监视的服务的状态的次数。一旦达到此数字,故障监视器将执行操作以使服务回到联机状态。缺省值为 3。

ACTION_RETRIES

指定故障监视器将尝试使服务回到联机状态的次数。缺省值为 3。

NOTIFY_ADDRESS

指定故障监视器将通知消息发送至的电子邮件地址。缺省值为 <instance_name>@<machine_name>。

 

------------------------------------------------------------------------

 

DB2 故障监视器工具 Linux 版和 UNIX 版

 

DB2? 故障监视器工具仅在基于 UNIX 的系统上可用,该工具通过监视 DB2 数据库管理器实例并重新启动任何过早退出的实例来使 DB2 数据库正常运行。

故障监视器协调程序(FMC)是在 UNIX 引导序列中启动的“故障监视器工具”的进程。init 守护程序启动 FMC,并在 FMC 异常终止时重新启动 FMC。FMC 对每个 DB2 实例启动一个故障监视器。每个故障监视器都作为一个守护进程来运行,并且具有与 DB2 实例相同的用户特权。

一旦启动了故障监视器,就会监视 DB2 实例以确保它不会过早退出。如果故障监视器发生故障,那么将通过 FMC 将它重新启动。每个故障监视器将依次负责监视一个 DB2 实例。如果 DB2 实例过早退出,那么故障监视器会将其重新启动。仅当发出 db2stop 命令时,故障监视器才变为不活动状态。如果 DB2 实例以任何其他方式关闭,故障监视器都会将其再次启动。

DB2 故障监视器限制

由于实例的启动和关闭是由集群产品控制的,所以,如果正在使用高可用性集群产品(例如,HACMP?、MSCS 或 IBM? Tivoli? System Automation for titolatforms),那么必须关闭故障监视器工具。

DB2 故障监视器与 DB2 运行状况监视器之间的差别

运行状况监视器和故障监视器是作用于单个数据库实例的工具。运行状况监视器使用运行状况指示器来 评估数据库管理器性能或数据库性能特定方面的运行状况。运行状况指示器测量特定种类数据库对象(例如表空间)某些方面的运行状况。可以针对特定条件评估运 行状况指示器以确定该类数据库对象的运行状况。此外,当某个运行状况指示器超出阈值或指示某个数据库对象处于非正常状态时,运行状况指示器可以生成警报以 通知您。

与之对比,故障监视器仅仅负责保持它所监视的实例正常运行。如果它所监视的 DB2 实例意外终止,那么故障监视器就会重新启动该实例。故障监视器在 Windows 上不可用。

How to use fault monitors to automatically restart DB2 UDB instances

http://www-01.ibm.com/support/docview.wss?uid=swg21209001


停止所有 DB2 进程(Linux 和 UNIX)

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.admin.dbobj.doc/doc/c0004961.html

本文摘抄自db2 info center, developerworks. 纯属鸟哥的私房菜 ^_^

 

 

 

 

 

----http://yuanjl2006.blog.163.com/blog/static/352663312011744241445/

-----http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.1.0/com.ibm.db2.udb.admin.doc/doc/c0008221.htm?lang=en

-------------------------------------------------------------------------------------

Question
 

How can I automatically restart my DB2 UDB instances? This document lists step by step instructions for setting up the Fault Monitor Facility to automatically restart DB2 UDB instances.

Cause
 

The db2iauto command enables and disables the auto-start of an instance after each system restart. With Fault Monitor facility, if the DB2® Universal Database™ (DB2 UDB) instance exits prematurely, the fault monitor will restart it.

 

Answer

1、Log in as Root

2、Determine whether there are any db2fmcd entries in the /etc/inittab file:
cat /etc/inittab | grep db2fmcd
If there are, remove them or comment them out before proceeding. To remove the entry, use the command: db2fmcu -d
3、Make sure there are no db2fmcd (Fault Monitor Coordinator Daemon (FMCD)), db2fmd (Fault Monitor Daemon) or db2fm (Fault Monitor) processes running:
ps -ef | grep db2fm
If there are, remove (kill) the process before proceeding.
4、Go to the DB2DIR/bin directory, where DB2DIR represents /usr/opt/db2_08_01 on AIX®, and /opt/IBM/db2/V8.1 on Solaris, HP-UX and Linux®. If you are using Solaris, the path may be slightly different, since you can override the default installation path at the time of installation.

5、Enable the Fault Monitor Coordinator:
./db2fmcu -u -p /opt/IBM/db2/V8.1/bin/db2fmcd

This step adds an entry to the /etc/inittab so that the FMCD process will be started each time you reboot. The entry will be similar to the following:
fmc:2345:respawn:/opt/IBM/db2/V8.1/bin/db2fmcd #DB2 Fault Monitor Coordinator

 

6、Start up the fault monitor daemon:
./db2fm -i instance_name -U

7、Start up the fault monitor service:
./db2fm -i instance_name-u

8、Turn on the fault monitor for the instance:
./db2fm -i instance_name -f on

9、Verify the fault monitor state. Log in as the instance owner, then perform the command: 
db2fm -s -S
You should see output similar to the following:
Gcf module 'fault monitor' is NOT operable
Gcf module '/home/instance_name/sqllib/lib/libdb2gcf.so' state is AVAILABLE

10、Reboot the server. The fault monitor service should be available once the server has been rebooted. 

11、Verify the fault monitor state. Login as the instance owner, then perform the command:
db2fm -s -S
You should see output similar to the following:
Gcf module 'fault monitor' state is AVAILABLE
Gcf module '/home/test/sqllib/lib/libdb2gcf.so' state is AVAILABLE

12、Log in as Root. 

13、Go to the DB2DIR/bin directory (per step 4). 

14、Verify the FMC Daemon state using the command:
db2fmcu
FMC: up: PID = 3415

15、At this point, if the instance is shut down in any way other than via the db2stop command, the fault monitor will start it up again. If you want to test the fault monitor's functionality, bring down the DB2 UDB instance. For example, issue the command: 
db2_kill

16、The instance will be automatically restarted. 

 

 

Related information


Fault monitor facility for UNIX-based systems
IY73822: ADD DB2FMCU COMMAND TO DOCUMENTATION

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值