CN105391790A - Database high-availability method similar to RAC One Node - Google Patents
Database high-availability method similar to RAC One Node Download PDFInfo
- Publication number
- CN105391790A CN105391790A CN201510837438.XA CN201510837438A CN105391790A CN 105391790 A CN105391790 A CN 105391790A CN 201510837438 A CN201510837438 A CN 201510837438A CN 105391790 A CN105391790 A CN 105391790A
- Authority
- CN
- China
- Prior art keywords
- resource
- sid
- database
- raconenode
- high availability
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0893—Assignment of logical groups to network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供一种类RAC?One?Node的数据库高可用方法,将各个物理机器的资源整合起来,成为一个大的集群;使得不同的物理主机中的每个数据库都连接共享存储。本发明克服了rac?one?node只支持oracle?11G的功能缺陷,完美支持ORACLE?10g和11g,实现了oracle非集群环境下单实例的高可用性。
The present invention provides a kind of RAC? One? Node's database high-availability method integrates the resources of each physical machine into a large cluster; makes each database in different physical hosts connect to shared storage. The present invention overcomes rac? one? node only supports oracle? 11G functional defects, the perfect support for ORACLE? 10g and 11g realize the high availability of a single instance in an oracle non-cluster environment.
Description
技术领域technical field
本发明涉及一种数据库高可用方法,具体涉及一种类RACOneNode的数据库高可用方法。The invention relates to a database high availability method, in particular to a RACOneNode-like database high availability method.
背景技术Background technique
高可用(HA):计算机系统的可靠性用平均无故障时间(MTTF)来度量,即计算机系统平均能够正常运行多长时间,才发生一次故障。系统的可靠性越高,平均无故障时间越长,高可用一般有3种实现方式:High Availability (HA): The reliability of a computer system is measured by the mean time to failure (MTTF), that is, how long the computer system can run normally before a failure occurs. The higher the reliability of the system, the longer the mean time between failures. There are generally three ways to achieve high availability:
主从方式(非对称方式),工作原理:主机工作,备机处于监控准备状况;当主机宕机时,备机接管主机的一切工作,待主机恢复正常后,按使用者的设定以自动或手动方式将服务切换到主机上运行,数据的一致性通过共享存储系统解决。Master-slave mode (asymmetric mode), working principle: the main machine is working, and the standby machine is in the monitoring preparation state; when the main machine is down, the standby machine takes over all the work of the main machine. Or manually switch the service to run on the host, and the data consistency is resolved through the shared storage system.
双机双工方式(互备互援),工作原理:两台主机同时运行各自的服务工作且相互监测情况,当任一台主机宕机时,另一台主机立即接管它的一切工作,保证工作实时,应用服务系统的关键数据存放在共享存储系统中。Two-machine duplex mode (mutual backup and mutual assistance), working principle: two hosts run their own services at the same time and monitor each other. When any host fails, the other host immediately takes over all its work to ensure The work is real-time, and the key data of the application service system is stored in the shared storage system.
集群工作方式(多服务器互备方式),工作原理:多台主机一起工作,各自运行一个或几个服务,各为服务定义一个或多个备用主机,当某个主机故障时,运行在其上的服务就可以被其它主机接管。Cluster working mode (multi-server mutual backup mode), working principle: multiple hosts work together, each running one or several services, each defining one or more standby hosts for the service, when a host fails, run on it The service can be taken over by other hosts.
OracleRAC:是OracleRealApplicationCluster的简写,官方中文文档一般翻译为“真正应用集群”,是Oracle9i数据库中采用的一项开始的一项技术,也是Oracle数据库支持网格计算环境的核心技术。它的出现解决了传统数据库应用中面临的一个重要问题:高性能、高可伸缩性与低价格之间的矛盾。OracleRAC: It is the abbreviation of OracleRealApplicationCluster. The official Chinese document is generally translated as "real application cluster". Its appearance solves an important problem faced by traditional database applications: the contradiction between high performance, high scalability and low price.
Oracle11G功能RON(RACOneNode)的原理与以前的HA数据库不同,RACOneNode是基于RAC数据库,并且通过Oracle集群软件(GRID)管理实现,只需启动RAC数据库的一个实例,当运行实例的节点需要维护停机的情况下,可以通过onlinedatabaserelocation的方式将数据库实例切换到集群中的其他节点上运行。The principle of the Oracle11G function RON (RACOneNode) is different from the previous HA database. RACOneNode is based on the RAC database and is managed through the Oracle cluster software (GRID). It only needs to start an instance of the RAC database. When the node running the instance needs to be maintained and shut down In this case, the database instance can be switched to run on other nodes in the cluster through onlinedatabaserelocation.
发明内容Contents of the invention
本发明针对上述现有技术存在的问题作出改进,即本发明要解决的技术问题是提供一种类RACOneNode的数据库高可用方法。The present invention makes improvements to the problems existing in the above-mentioned prior art, that is, the technical problem to be solved by the present invention is to provide a method for high availability of a database like RACOneNode.
为了解决上述技术问题,本发明提供了如下的技术方案:In order to solve the problems of the technologies described above, the present invention provides the following technical solutions:
一种类RACOneNode的数据库高可用方法,将各个物理机器的资源整合起来,成为一个大的集群;使得不同的物理主机中的每个数据库都连接共享存储。A high-availability method for databases like RACOneNode, which integrates the resources of each physical machine into a large cluster; makes each database in different physical hosts connect to shared storage.
利用GI的管理命令进行统一管理技术。Unified management technology using GI management commands.
整合起来的资源为资源项,资源项分别为:$SID资源、$SID.vip资源、$SID.lsnr资源、$SID.db资源和$SID.head资源。The integrated resources are resource items, and the resource items are: $SID resource, $SID.vip resource, $SID.lsnr resource, $SID.db resource and $SID.head resource.
$SID资源:是整个资源项的基础,通过定义这个资源,以使得资源项中的其他资源都依赖于它,实现了对资源项的统一管理,对$SID资源的停止,重置以及切换操作会影响到资源项中其他的所有资源。$SID resource: It is the basis of the entire resource item. By defining this resource, other resources in the resource item depend on it, realizing the unified management of the resource item, and the stop, reset and switching operations of the $SID resource. Affects all other resources in the resource item.
$SID.vip资源:是一个由OracleClusterware内部管理的VIP资源,$SID.vip资源依赖于网络资源和$SID资源。$SID.vip resource: It is a VIP resource managed internally by OracleClusterware. The $SID.vip resource depends on network resources and $SID resources.
$SID.lsnr资源:是资源项中的监听器资源,由shell脚本act_lsnr.ksh来进行保护,$SID.lsnr资源依赖于$SID.vip资源。$SID.lsnr resource: It is the listener resource in the resource item, which is protected by the shell script act_lsnr.ksh. The $SID.lsnr resource depends on the $SID.vip resource.
$SID.db资源:是资源项中的单实例数据资源,由shell脚本act_db.ksh来进行保护;$SID.db资源依赖于$SID资源。$SID.db resource: it is a single instance data resource in the resource item, which is protected by the shell script act_db.ksh; the $SID.db resource depends on the $SID resource.
$SID.head资源,与$SID资源首尾呼应,将整个资源项封装起来,作为一个整体来进行管理维护;SID.head资源由shell脚本act_rgh.ksh来保护。The $SID.head resource echoes the beginning and end of the $SID resource, encapsulates the entire resource item, and manages and maintains it as a whole; the SID.head resource is protected by the shell script act_rgh.ksh.
本发明的有益效果是本发明节省大量服务器资源,实现服务器集群,对中小型应用的数据库迁入集群可以大量的节约服务器数量。通过在国家电网多个数据中心统计显示:对于占用服务器资源不到10%的应用系统部署于集群,在保证集群每个节点资源使用率达70%,这样一个节点可以运行7个应用。对于一个四节点的集群,其中一台用作备机,还可以运行21个应用,相对于HA数据来说节省了38台服务器的资源。每增加一个节点,可以成倍提高资源利用率和减少服务器数量。The beneficial effect of the present invention is that the present invention saves a large amount of server resources, realizes server clusters, and can greatly save the number of servers when the databases of small and medium-sized applications are migrated into the clusters. Statistics from multiple data centers of the State Grid show that if an application system that occupies less than 10% of server resources is deployed in a cluster, and the resource utilization rate of each node of the cluster is guaranteed to reach 70%, such a node can run 7 applications. For a four-node cluster, one of which is used as a backup machine, it can also run 21 applications, which saves the resources of 38 servers compared to HA data. Each additional node can double the resource utilization and reduce the number of servers.
节省大量license费用,构建数据库资源池,现有的数据库可以直接迁移入池。不产生license费用.对于新上线的应用,只购买单库的license就可以,不必购买昂贵的RAC费用。Save a lot of license fees, build a database resource pool, and existing databases can be directly migrated into the pool. There is no license fee. For newly launched applications, you only need to purchase a license for a single library, and you do not need to purchase expensive RAC fees.
灵活的可拓展的集群结构,提升可用性由GI提供的集群,可以灵活的对集群节点进行添加和删除,不会影响业务正常进行。实现failover和在线迁移功能,有效的保证了计划外停机和计划内停机时间。Flexible and scalable cluster structure, improving availability The cluster provided by GI can flexibly add and delete cluster nodes without affecting the normal operation of the business. Realize failover and online migration functions, effectively guarantee unplanned downtime and planned downtime.
实现现存oracle10GRACONENODE,节约数据库升级费用和开发费用。目前很多数据库数据中心的数据库依然采用oracle10G的版本,基于ERON技术,可以实现11G才有的RACONENODE技术,并且不需要专门的停机升级,提升业务系统的可用性;数据库11G与10G之间具有较大的差异,数据库升级,需要重新设设定许多参数,以及数据库代码之间的开发。Realize the existing oracle10GRACONENODE, saving database upgrade costs and development costs. At present, the database of many database data centers still adopts the oracle10G version. Based on ERON technology, it can realize the RACONE NODE technology unique to 11G, and does not require special downtime upgrades to improve the availability of the business system; there is a large gap between the database 11G and 10G Differences, database upgrades, require resetting of many parameters, and development between database codes.
提升自动化运维水平,降低运维成本,数据库在宕机情况下,可以实现自动化迁移,提升自动化运维水平;通过ERON集群,减少服务器采购的数量,节约电费,机房设备费用,提高运维人员的技术。Improve the level of automated operation and maintenance and reduce the cost of operation and maintenance. When the database is down, it can realize automatic migration and improve the level of automatic operation and maintenance; through the ERON cluster, reduce the number of server purchases, save electricity and computer room equipment costs, and improve operation and maintenance personnel Technology.
附图说明Description of drawings
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the description, and are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention. In the attached picture:
图1是本发明数据库部署示意图;Fig. 1 is a schematic diagram of database deployment of the present invention;
图2是本发明数据库部署动态迁移示意图;Fig. 2 is a schematic diagram of dynamic migration of database deployment in the present invention;
图3是本发明资源调度图;Fig. 3 is a resource scheduling diagram of the present invention;
图4是本发明资源关联图;FIG. 4 is a resource association diagram of the present invention;
图5是本发明资源切换流程图;Fig. 5 is a flow chart of resource switching in the present invention;
图6是本发明GIagent例程工作流程图;Fig. 6 is the working flow diagram of the GIagent routine of the present invention;
图7是基于常规方法oracle数据库部署方案示意图;Fig. 7 is a schematic diagram of a deployment scheme based on a conventional method oracle database;
图8是基于ERON方法oracle数据库部署方案示意图;Figure 8 is a schematic diagram of the oracle database deployment scheme based on the ERON method;
图9是本发明成果示意图之一;Fig. 9 is one of the schematic diagrams of the achievements of the present invention;
图10是本发明成果示意图之二。Fig. 10 is the second schematic diagram of the achievement of the present invention.
具体实施方式detailed description
如图1-10所示,公开了本发明一个较佳的实施例。As shown in Figures 1-10, a preferred embodiment of the present invention is disclosed.
本发明,ERON(ExtendedRACONENODE),它是将各个物理机器的资源整合起来,成为一个大的集群(cluster)。它能整合服务器,提高failover能力,提供loadbalance能力,另外它能实现数据库存储的虚拟化,数据库环境的标准化和避免升级的停机维护时间。The present invention, ERON (Extended RACONE NODE), integrates the resources of each physical machine to form a large cluster (cluster). It can integrate servers, improve failover capabilities, and provide loadbalance capabilities. In addition, it can realize database storage virtualization, standardize database environments, and avoid upgrade downtime and maintenance time.
如图1所示,假定总共有3台物理主机,ServerA、ServerB、ServerC,这3台物理主机组成一个singlecluster,在3个物理主机上,可以有5个不同的singleinstance的database,DB1和DB2位于ServerA上,DB3位于ServerB上,DB4和DB5在ServerC上。每个数据库都连接共享存储。As shown in Figure 1, assume that there are a total of 3 physical hosts, ServerA, ServerB, and ServerC. These 3 physical hosts form a singlecluster. On the 3 physical hosts, there can be 5 different single instance databases. DB1 and DB2 are located in On ServerA, DB3 is on ServerB, and DB4 and DB5 are on ServerC. Each database is connected to shared storage.
如图2所示,当DB3所在节点ServerB出现故障无法提供服务时,由GI的agent进程检测到并调用OMotion例程负责把DB3上的数据库实例转到Server上,无需人工干预。As shown in Figure 2, when ServerB where DB3 is located fails and cannot provide services, the agent process of GI detects and calls the OMotion routine to transfer the database instance on DB3 to Server without manual intervention.
ERON技术是基于GridInfrastructure平台环境下的一种利用GI的管理命令进行统一管理技术。例如,把数据库和监听服务以“资源项”的形式注册到GI中,这样通过对资源项管理(启动和关闭)实现对数据库和监听服务的管理。ERON technology is a unified management technology based on the GridInfrastructure platform environment using GI management commands. For example, the database and monitoring service are registered in GI in the form of "resource item", so that the management of the database and monitoring service can be realized through resource item management (startup and shutdown).
ERON技术中资源项分别为:$SID资源、$SID.vip资源、$SID.lsnr资源、$SID.db资源、$SID.head资源五个资源项($SID是指数据库的实例名称),其中除$SID.vip外其他四个资源都为其编写各自的脚本用于资源项的状态功能实现和状态保护。其中,五个资源的关联性关系如图3所示。The resource items in ERON technology are: $SID resource, $SID.vip resource, $SID.lsnr resource, $SID.db resource, $SID.head resource five resource items ($SID refers to the instance name of the database), Among them, except $SID.vip, the other four resources have written their own scripts for the state function realization and state protection of resource items. Among them, the associative relationship of the five resources is shown in FIG. 3 .
如图4所示,GI保护的单实例数据库实际上是一个资源项,是一个相关资源的集合,通过各个资源之间的依赖关系而相互作用,完成对单实例数据库的保护。As shown in Figure 4, the single-instance database protected by GI is actually a resource item, which is a collection of related resources. Through the interaction between resources, the protection of the single-instance database is completed.
$SID资源:$SID resource:
这个资源是整个资源项的基础,通过定义这个资源,以使得资源项中的其他资源都依赖于它,实现了对资源项的统一管理。对这个资源的停止,重置以及切换操作会影响到资源项中其他的所有资源。This resource is the basis of the entire resource item. By defining this resource, other resources in the resource item depend on it, and the unified management of resource items is realized. Stopping, resetting, and switching operations on this resource will affect all other resources in the resource item.
$SID.vip资源:$SID.vip resource:
这是一个由OracleClusterware内部管理的VIP资源,因此无需编写shell脚本来进行保护。这个资源依赖于网络资源和前面描述的$SID资源。一般来说,网络资源是ora.net1.network。This is a VIP resource internally managed by OracleClusterware, so there is no need to write shell scripts to protect it. This resource depends on the network resource and the $SID resource described earlier. Typically, the network resource is ora.net1.network.
$SID.lsnr资源:$SID.lsnr resource:
这是资源项中的监听器资源,由shell脚本act_lsnr.ksh来进行保护。此资源依赖于前面的$SID.vip资源。除此之外,因为平安现时采用的是共享的OracleHOME,并且使用ACFS来提供这种共享机制,因此监听器资源还依赖于对应OracleHOME所在的ACFS资源。This is the listener resource in the resource item, which is protected by the shell script act_lsnr.ksh. This resource depends on the previous $SID.vip resource. In addition, because Ping An currently uses a shared OracleHOME and uses ACFS to provide this sharing mechanism, the listener resource also depends on the ACFS resource where the OracleHOME is located.
$SID.db资源:$SID.db resource:
这是资源项中的单实例数据资源,由shell脚本act_db.ksh来进行保护。此资源依赖于前面的$SID资源。因为平安现时采用的是共享的OracleHOME,并且使用ACFS来提供这种共享机制,因此数据库资源还依赖于对应OracleHOME所在的ACFS资源。此外,由于数据库的数据文件存放设计到DATA_DG和FRA_DG两个磁盘组,因此数据库资源来依赖于这两个资源。This is a single-instance data resource in the resource item, which is protected by the shell script act_db.ksh. This resource depends on the previous $SID resource. Because Ping An currently uses a shared Oracle HOME and uses ACFS to provide this sharing mechanism, the database resources also depend on the ACFS resources where the corresponding Oracle HOME is located. In addition, since the data files of the database are stored in two disk groups, DATA_DG and FRA_DG, the database resources depend on these two resources.
$SID.head资源:$SID.head resource:
这个资源和前面的$SID资源首尾呼应,将整个资源项封装起来,作为一个整体来进行管理维护。这个资源由shell脚本act_rgh.ksh来保护。这个脚本和用于保护$SID资源的脚本功能是相似的,都是通过创建一个本地的临时文件,根据临时文件的内容来检查资源的状态。This resource echoes the previous $SID resource from beginning to end, and encapsulates the entire resource item for management and maintenance as a whole. This resource is protected by the shell script act_rgh.ksh. This script is similar to the script used to protect the $SID resource. It creates a local temporary file and checks the status of the resource based on the content of the temporary file.
这个资源位于资源项中依赖关系的顶部,因此它的OFFLINE并不会使得资源项中的其他资源也被置为OFFLINE。但是,这个资源的切换却可以导致整个资源项发生切换。因此,对于这个资源的切换,也采用和监听器资源一样的切换策略,也就是不重启,不切换。避免出现由这个资源异常导致的切换出现。因为这个资源采用和$SID资源一样的机制,此资源如果出现问题,$SID资源也很有可能同时出现问题。将整个资源项的控制交由位于依赖关系底部的$SID来进行更加合适。This resource is at the top of the dependencies in the resource item, so its OFFLINE does not cause other resources in the resource item to also be set OFFLINE. However, switching of this resource can cause switching of the entire resource item. Therefore, for the switching of this resource, the same switching strategy as the listener resource is also adopted, that is, no restart or switching. Avoid handovers caused by this resource exception. Because this resource uses the same mechanism as the $SID resource, if there is a problem with this resource, the $SID resource may also have a problem at the same time. It would be more appropriate to leave control of the entire resource item to $SID at the bottom of the dependency.
如图5所示,由GI的agnet工作例程检查资源项的状态,通过资源状态的改变按照资源的参数定义资源项的重启或failvoer。As shown in Figure 5, the agnet work routine of GI checks the status of the resource item, and defines the restart or failvoer of the resource item according to the parameter of the resource through the change of the resource status.
图5只针对用户自定义的资源,并且只考虑了单一资源的作用。对于由于各个资源间的复杂依赖关系造成的切换并没有考虑在内。Figure 5 is only for user-defined resources, and only considers the role of a single resource. Switches due to complex dependencies between resources are not taken into account.
在OracleClusterware资源(以下简称资源)出现异常后,Clusterware对该资源的检查失败。这种情况下,Clusterware首先会根据资源中定义的RESTART_ATTEMPTS属性值来判断资源是否允许以及需要重启。判断是基于当前资源的动态属性值RESTART_COUNT和静态属性值RESTART_ATTEMPTS来进行的。例如当前RESTART_COUNT是2(说明该资源已经重启了2次),RESTART_ATTEMPTS的定义值为3,则Clusterware认为该资源仍然可以在本地节点进行重启,会尝试重启该资源,并将RESTART_COUNT值加1。After the OracleClusterware resource (hereinafter referred to as the resource) is abnormal, the Clusterware fails to check the resource. In this case, Clusterware will first determine whether the resource is allowed and needs to be restarted according to the RESTART_ATTEMPTS attribute value defined in the resource. The judgment is made based on the dynamic attribute value RESTART_COUNT and the static attribute value RESTART_ATTEMPTS of the current resource. For example, the current RESTART_COUNT is 2 (indicating that the resource has been restarted twice), and the defined value of RESTART_ATTEMPTS is 3, then Clusterware thinks that the resource can still be restarted on the local node, and will try to restart the resource and add 1 to the RESTART_COUNT value.
注意:无论资源在本地节点重启成功与否RESTART_COUNT都会增加,并且除非资源启动成功或者达到资源的UPTIME_THRESHOLD,否则RESTART_COUNT都不会被重置为0。Note: RESTART_COUNT will increase regardless of whether the resource restarts successfully on the local node, and RESTART_COUNT will not be reset to 0 unless the resource is successfully started or reaches the resource's UPTIME_THRESHOLD.
如果资源在本地节点的重启失败,根据资源的定义,如果该资源允许运行于Cluster中的多个节点上,那么Clusterware会按照在HOSTING_MEMBERS或者SERVER_POOLS中定义的节点次序切换该资源到其他的节点上运行。如果在其他节点上也无法成功启动该资源,Clusterware会继续尝试切换该资源直到HOSTING_MEMBERS或者SERVER_POOLS中定义的所有节点都已经尝试过。这种情况下,OracleClusterware便会将该资源的状态置为OFFLINE并且停止监控该资源。If the restart of the resource on the local node fails, according to the definition of the resource, if the resource is allowed to run on multiple nodes in the Cluster, then Clusterware will switch the resource to run on other nodes according to the order of nodes defined in HOSTING_MEMBERS or SERVER_POOLS . If the resource cannot be successfully started on other nodes, Clusterware will continue to try to switch the resource until all nodes defined in HOSTING_MEMBERS or SERVER_POOLS have been tried. In this case, OracleClusterware will set the status of the resource to OFFLINE and stop monitoring the resource.
如果在切换过程中,在任何一个节点上将资源成功重启,那么Clusterware会将资源的RESTART_COUNT重置为0。If the resource is successfully restarted on any node during the switchover, Clusterware will reset the resource's RESTART_COUNT to 0.
注意:由资源重启不成功导致的资源切换和FAILURE_COUNT这个动态资源属性没有任何联系。OracleClusterware并不会因为由此导致的资源切换而将FAILURE_COUNT值增加。Note: Resource switching caused by unsuccessful resource restart has nothing to do with the dynamic resource attribute FAILURE_COUNT. OracleClusterware will not increase the FAILURE_COUNT value because of the resulting resource switching.
在资源检查失败时,如果一个资源的重启次数已经达到了定义的RESTART_ATTEMPTS值或者该资源根本不运行在本地节点进行重启尝试(通过设置RESTART_ATTEMTPS=0),那么Clusterware会决定该资源是否可以进行切换。资源是否可以进行切换是由资源的动态属性FAILURE_COUNT和资源的静态属性FAILURE_THRESHOLD来共同作用的。如果一个资源的FAILURE_COUNT值已经达到了定义的FAILURE_THRESHOLD,则该资源不被允许发生切换。这种情况下,Clusterware会将资源的FAILURE_COUNT属性重置为0,将资源状态置为OFFLINE并停止监控该资源。如果资源的FAILURE_COUNT还没有达到定义的FAILURE_THRESHOLD值,Clusterware则按照在资源属性HOSTING_MEMBERS或者SERVER_POOLS中定义的节点次序进行资源的切换操作。如果切换成功,则重置资源的RESTART_COUNT为0;如果切换不成功,则按照第2点中的步骤继续尝试资源的切换。When the resource check fails, if the number of restarts of a resource has reached the defined RESTART_ATTEMPTS value or the resource is not running at all on the local node for restart attempts (by setting RESTART_ATTEMTPS=0), then Clusterware will determine whether the resource can be switched. Whether a resource can be switched is determined by the resource's dynamic attribute FAILURE_COUNT and the resource's static attribute FAILURE_THRESHOLD. If the FAILURE_COUNT value of a resource has reached the defined FAILURE_THRESHOLD, the resource is not allowed to switch. In this case, Clusterware will reset the resource's FAILURE_COUNT attribute to 0, set the resource status to OFFLINE and stop monitoring the resource. If the FAILURE_COUNT of the resource has not reached the defined FAILURE_THRESHOLD value, Clusterware will switch resources according to the order of nodes defined in the resource attribute HOSTING_MEMBERS or SERVER_POOLS. If the switch is successful, reset the RESTART_COUNT of the resource to 0; if the switch is unsuccessful, continue to try the resource switch according to the steps in point 2.
注意:资源的动态属性FAILURE_COUNT只在资源的RESTART_ATTEMPTS值被达到而进行切换的情况下才会增加。换句话说,OracleClusterware只有在这种情况下才认为资源在本地节点失败。Note: The resource's dynamic attribute FAILURE_COUNT will only be incremented when the resource's RESTART_ATTEMPTS value is reached to switch. In other words, OracleClusterware considers the resource failed on the local node only in this case.
资源的动态属性值FAILURE_COUNT并不像RESTART_COUNT可以在资源启动成功或者使用crsctlstartres命令成功启动资源后重置为0,FAILURE_COUNT只有在其达到了资源中定义的FAILURE_THRESHOLD或者超过了定义FAILURE_INTERVAL时限后才会被重置为0。在第一种情况下,也就是达到了FAILURE_THRESHOLD,Clusterware会将资源状态置为OFFLINE并且停止监控该资源;而第二种情况下,Clusterware仍然会监控该资源并且在需要时对资源进行切换操作。The dynamic property value FAILURE_COUNT of a resource is not like RESTART_COUNT, which can be reset to 0 after the resource is successfully started or the resource is successfully started using the crsctlstartres command. FAILURE_COUNT will only be reset after it reaches the FAILURE_THRESHOLD defined in the resource or exceeds the defined FAILURE_INTERVAL time limit. set to 0. In the first case, that is, when FAILURE_THRESHOLD is reached, Clusterware will set the resource status to OFFLINE and stop monitoring the resource; in the second case, Clusterware will still monitor the resource and switch the resource when needed.
如图6所示,GIagent例程工作流程。图6只针对用户自定义的资源,并且只考虑了单一资源的作用。对于由于各个资源间的复杂依赖关系造成的资源启停以及切换并没有考虑在内。图6描述了OracleClusterwareAgentFramework如何对资源进行管理,以及在哪些情况下调用哪些资源的切入点(EntryPoint)。As shown in Figure 6, the GIAgent routine workflow. Figure 6 is only for user-defined resources, and only considers the role of a single resource. It does not take into account the resource start-stop and switching caused by the complex dependencies among various resources. Figure 6 describes how OracleClusterwareAgentFramework manages resources, and under what circumstances call the entry point (EntryPoint) of which resources.
ClusterwareAgent会根据资源定义属性CHECK_INTERVAL定期调用资源的CHECK例程对资源进行检查。如果检查超时,(这是由SCRIPT_TIMEOUT来控制的),如果有ABORT例程,则调用ABORT例程;如果没有,则Agent进程退出。因为不能成功地检测资源的状态,从而判断资源是否健康,Clusterware会将资源状态置为INTERMEDIATE,而详细状态信息一栏为CHECKTIMEDOUT。ClusterwareAgent will periodically call the CHECK routine of the resource to check the resource according to the resource definition attribute CHECK_INTERVAL. If the check times out, (this is controlled by SCRIPT_TIMEOUT), if there is an ABORT routine, then call the ABORT routine; if not, the Agent process exits. Because the status of the resource cannot be detected successfully to determine whether the resource is healthy, Clusterware will set the status of the resource to INTERMEDIATE, and the column of detailed status information is CHECKTIMEDOUT.
如果调用资源的CHECK例程返回错误,则意味着对资源的检查失败,资源发生异常。这种情况下,Clusterware会按照前面所描述的资源切换流程对资源进行相应的操作。If the call to the resource's CHECK routine returns an error, it means that the check on the resource failed and an exception occurred on the resource. In this case, Clusterware will perform corresponding operations on resources according to the resource switching process described above.
在对资源重启的情况下,Agent通过调用资源的START例程来启动该资源。如果START例程超时,(这是由START_TIMEOUT或者SCRIPT_TIMEOUT来控制的),在有ABORT例程的情况下,Agent调用ABORT例程;如果没有,Agent进程退出。In the case of restarting a resource, the Agent starts the resource by calling the resource's START routine. If the START routine times out (this is controlled by START_TIMEOUT or SCRIPT_TIMEOUT), in the case of an ABORT routine, the Agent calls the ABORT routine; if not, the Agent process exits.
在调用START例程后,Agent会立即调用CHECK例程来检查资源的状态。如果检查成功,则资源成功启动并且运行良好;如果检查失败,则说明资源的启动失败,Agent会调用资源的CLEAN例程对本地节点的资源进行清理,之后会根据具体情况决定是否对该资源进行切换。After calling the START routine, the Agent will immediately call the CHECK routine to check the status of the resource. If the check succeeds, the resource starts successfully and runs well; if the check fails, it means that the start of the resource fails, and the Agent will call the CLEAN routine of the resource to clean up the resource on the local node, and then decide whether to clean the resource according to the specific situation. switch.
在调用STOP例程停止资源的过程中,如果STOP例程返回成功,Agent会调用CHECK例程检查资源情况,如果CHECK返回失败,说明资源已经被停止,这是一个正常情况,Clusterware会将资源状态置为OFFLINE。In the process of calling the STOP routine to stop the resource, if the STOP routine returns successfully, the Agent will call the CHECK routine to check the resource situation. If the CHECK return fails, it means that the resource has been stopped. This is a normal situation, and Clusterware will update the resource status set to OFFLINE.
在调用STOP例程停止资源过程中,如果发生超时(这是由STOP_TIMEOUT或者SCRIPT_TIMEOUT来控制的),在有ABORT例程情况下,Agent调用ABORT例程,否则Agent进程退出。无论STOP返回失败异或是超时,Agent都会调用CHECK例程检查资源状态,而无论CHECK例程返回成功或者失败,Agent都会调用CLEAN及CHECK例程对资源进行清理,并且将资源状态最终设置为OFFLINE。In the process of calling the STOP routine to stop resources, if a timeout occurs (this is controlled by STOP_TIMEOUT or SCRIPT_TIMEOUT), if there is an ABORT routine, the Agent calls the ABORT routine, otherwise the Agent process exits. Regardless of whether STOP returns failure or timeout, the Agent will call the CHECK routine to check the resource status, and regardless of whether the CHECK routine returns success or failure, the Agent will call the CLEAN and CHECK routines to clean up the resource, and finally set the resource status to OFFLINE .
如表1所示,对本发明的主机异常、应用异常、GI套件异常等9大功能测试验证,采用集群架构,实现了ERON技术的failover功能和在线迁移功能。As shown in Table 1, the nine functions of the present invention, such as host exception, application exception, and GI suite exception, are tested and verified, and the cluster architecture is adopted to realize the failover function and online migration function of ERON technology.
表1Table 1
普通5个不同的业务系统,oracle数据库部署如图7所示:Ordinary five different business systems, oracle database deployment as shown in Figure 7:
业务系统甲、乙因业务要求程度高,各使用2台服务器就行RAC集群;业务系统丙、丁、戊各使用1台服务器,共计需要使用7台服务器。Due to high business requirements, business systems A and B each use 2 servers and use RAC clusters; business systems C, D, and E each use 1 server, and a total of 7 servers are required.
如图8所示,采用本发明ERON,首先将服务器A、B、C做集群;再在服务器A上部署业务系统乙、丙;在服务器B上部署丁、戊;在服务器C上部署甲。共计使用服务器3台,可实现业务系统的高可用。不仅节省了软硬件费用,而且减少了服务器机房空间占用和能源的消耗。同时有利于集中部署和集中化管理。As shown in Figure 8, using the ERON of the present invention, first cluster servers A, B, and C; then deploy business systems B and C on server A; deploy D and E on server B; deploy A on server C. A total of 3 servers are used to achieve high availability of business systems. It not only saves the cost of software and hardware, but also reduces the space occupation and energy consumption of the server room. At the same time, it is conducive to centralized deployment and centralized management.
实际测试数据如图9和10所示:5套业务系统迁入资源池后,从CPU、I/O、内存等重要性能指标可以看出:The actual test data are shown in Figures 9 and 10: After the five business systems are moved into the resource pool, it can be seen from important performance indicators such as CPU, I/O, and memory:
CPU负载在10%以下,I/O的IOPS在200左右,资源池性能相当稳定;The CPU load is below 10%, the I/O IOPS is around 200, and the performance of the resource pool is quite stable;
资源池资源丰富,可迁入更多业务系统。The resource pool is rich in resources and can be migrated to more business systems.
数据库AWR部分指标如表2所示:Some indicators of the database AWR are shown in Table 2:
表2Table 2
数据从解析次数、逻辑读、物理读等维度展现数据库稳定运行指标:The data shows the stable operation indicators of the database from the dimensions of parsing times, logical reads, and physical reads:
实施过程中把5套不同版本的数据库统一升级到10.2.0.5,提升了数据库运行性能和稳定性。During the implementation process, five sets of databases of different versions were upgraded to 10.2.0.5, which improved the performance and stability of the database.
数据库在集群中有两个主节点一个备用节点,提高了原有单实例数据库的高可用性。The database has two primary nodes and one standby node in the cluster, which improves the high availability of the original single-instance database.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still understand the foregoing embodiments The recorded technical solutions are modified, or some of the technical features are equivalently replaced. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510837438.XA CN105391790A (en) | 2015-11-26 | 2015-11-26 | Database high-availability method similar to RAC One Node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510837438.XA CN105391790A (en) | 2015-11-26 | 2015-11-26 | Database high-availability method similar to RAC One Node |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105391790A true CN105391790A (en) | 2016-03-09 |
Family
ID=55423620
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510837438.XA Pending CN105391790A (en) | 2015-11-26 | 2015-11-26 | Database high-availability method similar to RAC One Node |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105391790A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106130763A (en) * | 2016-06-24 | 2016-11-16 | 平安科技(深圳)有限公司 | Server cluster and be applicable to the database resource group method for handover control of this cluster |
CN109543365A (en) * | 2018-11-26 | 2019-03-29 | 新华三技术有限公司 | A kind of authorization method and device |
CN111767175A (en) * | 2020-06-19 | 2020-10-13 | 北京思特奇信息技术股份有限公司 | A single instance running method and device based on the principle of active and standby |
CN113572862A (en) * | 2021-09-27 | 2021-10-29 | 武汉四通信息服务有限公司 | Cluster deployment method and device, electronic equipment and storage medium |
-
2015
- 2015-11-26 CN CN201510837438.XA patent/CN105391790A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106130763A (en) * | 2016-06-24 | 2016-11-16 | 平安科技(深圳)有限公司 | Server cluster and be applicable to the database resource group method for handover control of this cluster |
CN109543365A (en) * | 2018-11-26 | 2019-03-29 | 新华三技术有限公司 | A kind of authorization method and device |
CN109543365B (en) * | 2018-11-26 | 2020-11-06 | 新华三技术有限公司 | Authorization method and device |
CN111767175A (en) * | 2020-06-19 | 2020-10-13 | 北京思特奇信息技术股份有限公司 | A single instance running method and device based on the principle of active and standby |
CN113572862A (en) * | 2021-09-27 | 2021-10-29 | 武汉四通信息服务有限公司 | Cluster deployment method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9280430B2 (en) | Deferred replication of recovery information at site switchover | |
US9361192B2 (en) | Method and apparatus for restoring an instance of a storage server | |
CN102142008B (en) | Method and system for implementing distributed memory database, token controller and memory database | |
WO2016150050A1 (en) | Method and system for implementing high-availability, high-performance database cluster | |
CN101079896B (en) | A method for constructing a multi-availability mechanism coexistence architecture of a parallel storage system | |
CN107147540A (en) | Fault Handling Method and Fault Handling Cluster in High Availability System | |
Wang et al. | Replication-based fault-tolerance for large-scale graph processing | |
CN110912991A (en) | Super-fusion-based high-availability implementation method for double nodes | |
CN108259239A (en) | A kind of database high availability support method and system | |
CN109446169B (en) | Double-control disk array shared file system | |
CN102708027B (en) | A kind of method and system avoiding outage of communication device | |
CN101876926A (en) | A Fault Tolerant Method of Software Three-computer Hot Backup with Asymmetric Structure | |
CN105391790A (en) | Database high-availability method similar to RAC One Node | |
CN114064414A (en) | High-availability cluster state monitoring method and system | |
CN111935244B (en) | Service request processing system and super-integration all-in-one machine | |
CN102360324A (en) | Failure recovery method and equipment for failure recovery | |
CN112199178A (en) | Cloud service dynamic scheduling method and system based on lightweight container | |
US9342451B2 (en) | Processor management method | |
CN106612314A (en) | System for realizing software-defined storage based on virtual machine | |
Chen et al. | Replication-based fault-tolerance for large-scale graph processing | |
CN112612635B (en) | Multi-level protection method for application program | |
CN101686261A (en) | RAC-based redundant server system | |
CN103500126B (en) | A kind of automatization fault-tolerant configuration method of cloud computing platform | |
CN117215717A (en) | MySQL database containerized cluster management platform and electronic equipment | |
CN115499296B (en) | Cloud desktop hot standby management method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C41 | Transfer of patent application or patent right or utility model | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20170303 Address after: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing Applicant after: State Grid Corporation of China Applicant after: Nanjing Nari Co., Ltd. Applicant after: Integration of information system branch office of Nanjing NanRui Group Co.,Ltd Applicant after: INFORMATION COMMUNICATION BRANCH, STATE GRID JIANGSU ELECTRIC POWER COMPANY Address before: 100031 Xicheng District West Chang'an Avenue, No. 86, Beijing Applicant before: State Grid Corporation of China Applicant before: Nanjing Nari Co., Ltd. Applicant before: Integration of information system branch office of Nanjing NanRui Group Co.,Ltd |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160309 |