oracle11g 磁盘心跳_Oracle 集群心跳及其参数misscount/disktimeout/reboottime

在Oracle RAC中,可以从多个层次,多个不同的机制来检测RAC的健康状况,即可以通过心跳机制以及一定的投票算法来隔离故障。如果检测到某节点失败,则存在故障的节点将会被逐出集群以避免故障节点破坏数据。本文主要描述了Oracle RAC下的几种心跳机制以及心跳参数的调整。

一、OCSSD与CSS    OCSSD是一个管理及提供Cluster Synchronization Services (CSS)服务的Linux或者Unix进程。使用Oracle用户来运行该进程并提供节点成员管理功能,一旦该进程失败,将导致节点重启。CSS服务提供2种心跳机制,一种为网络心跳,一种为磁盘心跳。两种心跳都有最大延时,网络心跳的延时叫MC(Misscount), 磁盘心跳延时叫作IOT (I/O Timeout)。 这2个参数都以秒为单位,缺省时情况下Misscount < Disktimeout。下面分别描述这2种心跳机制。

二、网络心跳    故名思义即是通过私有网络来检测节点的状态。如果私有网络硬件、软件导致集群节点间私有网络在一定时间内无法进行正常通信,由此而导致脑裂。由于集群环境中的存储为共享存储,因此此时必须要将故障节点从 集群隔离出来,以避免数据灾难。关于这个网络心跳的具体动作描述如下:

Every one second, a sending thread in the cssd sends a network tcp heartbeat to itself and all nodes. The receiving thread of the ocssd.bin receives the heartbeat.

If the package network is dropped or has error, the error correction mechanism on tcp would retransmit t

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是基于提供的代码框架,完成LRU算法的完整代码: ```c++ #include <iostream> #include <cstring> using namespace std; void OutputPageNumofRef(int *PageNumofRef, int PageNumRefCount) { cout << "页面引用串号为:"; for (int i = 0; i < PageNumRefCount; i++) { cout << PageNumofRef[i] << " "; } cout << endl; } void OutputBlockofMemory(int *BlockofMemory, int BlockCount, int pos, int val) { if (pos != -1) { cout << "页面" << BlockofMemory[pos] << "被页面" << val << "替换" << endl; } cout << "内存块状态为:"; for (int i = 0; i < BlockCount; i++) { cout << BlockofMemory[i] << " "; } cout << endl; } bool PageInBlockofMemory(int pageNum, int *BlockofMemory, int BlockCount) { for (int i = 0; i < BlockCount; i++) { if (BlockofMemory[i] == pageNum) { return true; } } return false; } void Lru(int *BlockofMemory, int *PageNumofRef, int BlockCount, int PageNumRefCount) { int i; int MissCount = 0; int *lastUsedTime = new int[BlockCount]; memset(lastUsedTime, -1, sizeof(int) * BlockCount); // 初始化为-1,表示从未使用过 cout << "************最近最久未使用页面置换算法:************" << endl; OutputPageNumofRef(PageNumofRef, PageNumRefCount); for (i = 0; i < PageNumRefCount; i++) { if (!PageInBlockofMemory(PageNumofRef[i], BlockofMemory, BlockCount)) { // 页不在内存中 MissCount++; int minTime = 0x3f3f3f3f; // 初始化为一个很大的数 int pos = -1; for (int j = 0; j < BlockCount; j++) { if (lastUsedTime[j] < minTime) { minTime = lastUsedTime[j]; pos = j; } } BlockofMemory[pos] = PageNumofRef[i]; // 将页面替换到空闲块中 lastUsedTime[pos] = i; // 更新该页面的使用时间 OutputBlockofMemory(BlockofMemory, BlockCount, pos, PageNumofRef[i]); } else { for (int j = 0; j < BlockCount; j++) { if (BlockofMemory[j] == PageNumofRef[i]) { lastUsedTime[j] = i; // 更新该页面的使用时间 break; } } OutputBlockofMemory(BlockofMemory, BlockCount, -1, PageNumofRef[i]); } } delete[] lastUsedTime; cout << "缺页次数为:" << MissCount << endl; cout << "LRU缺页率为:" << (float)MissCount / PageNumRefCount << endl; } int main() { int BlockCount = 3; int PageNumRefCount = 20; int BlockofMemory[3] = {-1, -1, -1}; int PageNumofRef[20] = {1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, 4, 2, 3, 1, 4, 3, 2, 5}; Lru(BlockofMemory, PageNumofRef, BlockCount, PageNumRefCount); return 0; } ``` LRU算法的核心思想是,选择最近最久未使用的页面进行淘汰。以上代码实现了一个LRU页面置换算法。在每次缺页时,遍历内存块中的所有页面,找到最久未使用的页面,将其替换为当前需要访问的页面。为了实现该算法,需要记录每个页面最近一次被访问的时间,可以使用一个数组来存储。在每次访问页面时,更新该页面的时间戳。当需要替换页面时,遍历所有页面的时间戳,选择最小的一个页面进行淘汰。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值