Transcript

Introduction to HA with 12c Flex Clusters

>> John:  Today I want to talk about using Grid Infrastructure to provide high availability services for your entire environment. Grid Infrastructure is a lot more than a platform for supporting RAC databases. Particularly in the 12c Flex Clusters implementation, Grid Infrastructure can provide availability services for your application servers, as well.

[pause]

We should all be familiar with high availability as regards to the database. Just very quickly in summary, we know that your database services can failover to one instance to another. GI makes sure that the requested cardinality of the services is kept constant. Your sessions can failover from one instance to another assuming you’ve configured either transparent application failure, failover or fast application notification.

If you’re using Policy Managed Databases, which I strongly advice all our clients to do, then your instances can also failover from one node in the cluster to another. That’s all pretty straightforward. But it isn’t really enough. If you’re going to provide HA for your database services, you will also need to provide HA for your application servers. If there’s a problem that causes an application server to fail, you don’t want to be in the position of having to relocate it manually. Start it up perhaps on a different machine. You want that to happen automatically. You need the Clusterware to take control and provide high availability for the application servers too.

We can do this with Grid Infrastructure. It’s actually been possible since release 10g, the first ever release of Oracle Clusterware. However, it was formalized and improved in Grid Infrastructure and in 12c Flex Clusters, high availability for application services is key functionality.

Note that it isn’t enough just to relocate the application. You’ll have to relocate all the objects on which the application relies. Typically, that will mean the virtual IP address and host name which end users use to connect to the application and the final system storing the data that the application server is using. This can be quite complex to set up. However, Oracle does provide Grid Infrastructure bundled agents that may make the implementation easier.

The end results is that you register your application services with Grid Infrastructure and in the event of any problem, restart the application and relocation of the application if necessary can be detected and will occur in seconds.

Copyright SkillBuilders.com 2017

×
Transcript

What is a Highly Available Application?

>> John:  A highly available application is an application that your end users will be able to get to, will have continuous service from even if the host which is running it fails. An application is typically going to be a set of interdependent resources. There will be a program and the program might be your Apache web listener. It might be your SMTP sendmail daemon. It might be your Tomcat Java servlet container. You’ve got the program that actually does the work.

[pause]

The program will usually require a listening address, a virtual hostname, and an address by which end users can connect to it. That clearly is going to have to move with the application. Also, most applications will require data. Your Apache web listener will require a file system with its library of HTML documents. Your e-mail server will require a file system for the e-mail storage.

An application is useless without its address and its data. So when registering a highly available application for GI, we have to build in dependencies so that these items will move together. Having done that, we configure Grid Infrastructure to start, stop, and monitor the application and if necessary relocate the application to a different machine in the cluster.

There are some complications, of course. Some applications may require multiple instances. For your web listener, you’ll probably want at least two Apache web listeners to do some low balancing and make sure that there is continuous service in the event of one occurrence of it having to be relocated.

Sometimes you’ll want resources to be co-located on the same machine. Sometimes you’ll deliberately want them to be dispersed. But most importantly, the dependent resources have to move with the application and the end users will have no idea where the application is actually running at any given moment. Their only point of access will be a virtual hostname resolving to a virtual IP address which could be anywhere on the cluster.

Copyright SkillBuilders.com 2017

×
Transcript

Simple Example of a Highly Available Application Using Oracle 12c Flex Clusters

>> John:  As a simple example to demonstrate using Grid Infrastructure to provide high availability for applications, I’m going to register the xwindows xclock as a Grid Infrastructure managed resource. So I’ll be able to start the clock and if it fails for some reason, GI will automatically restart it.

To do that, we register the resource using the crsctl utility that those of us who work with RAC are all too familiar with. So let’s break down the commands.

crsctl add resource

I’m going to register a new resource into the cluster registry. The resource is given an arbitrary name of myclock.

[pause]

Then we come to the arguments. First, -type. Every GI managed resource is either a local resource, meaning that it can run on only one nominated machine or cluster resource. Meaning that GI has freedom to start the resource on any machine in the cluster. Clearly, for high availability, it needs to be a cluster resource.

Then the second argument, -attr. This defines the attributes of the application. I’m using pretty much the absolute minimum that I can for the attribute string. Because believe me, getting the attribute string correct is not easy in a complex environment. The first attribute is the “action script.” This is a shell script that will be able to start the resource, stop the resource, and check whether it’s actually running.

[pause]

I’ll show you the shell script I wrote in just a moment.

Then we come on to placement restricted and hosting members berlin1, berlin2. These attributes define on what nodes of the cluster Grid Infrastructure is allowed to start the resource. The last two attributes, check interval 3, restart attempt 2, this is high availability. Check interval 3 instructs Grid Infrastructure to test whether the application is actually running every three seconds and if it is not running (and it should be), make two attempts to restart it on the same machine and if they both fail then relocate it to a different machine. 

Copyright SkillBuilders.com 2017

×
Transcript

Demonstration: Configure and Test Failover

>> John:  Now let’s create my xclock as a highly available application. This is just a little cluster of two nodes, berlin1 and berlin2.

[pause]

I’ve already written a simple shell script to use as the action script for my clock resource. Here it is. Script is clock_action.sh. Begin by launching a bin shell. Set my display variable to my xserver which is here. And then set the variable XPID to the process ID of the clock if it’s actually running. I’m just using PS to extract the PLED and save it into XPID.

Now, a resource action script must take one argument, $1 and that argument can have one of three values. If I run this script with the argument set to start, I’ll launch a digital X clock. If I run the script with the argument set to stop, I’ll kill the process of the clock which is to calculate it there. If I run the script with the argument CHECK, we’ll see if the process ID actually exists and if it does not equal an empty string, it will return zero and if it does equal, return an empty string then we’ll assume that the clock is not running and return 1. That’s my action script.

Then I have to deploy the script to the Grid Infrastructure home on each node and there’s a particular directory where the script should go, the cp clock_action.sh to that directory on this node.

[pause]

I need to deploy it to the other node, as well. So SCP across the network to the other node in the cluster.

[pause]

Does this script actually work? I’ll run it with the START argument. There it is. Try the STOP argument. It stops. So the script looks good. But that was running the script from a UNIX prompt. I need to register this as a Grid Infrastructure managed resource. This is the command I showed you on the previous slide.

crsctl add resource myclock

As a cluster resource, the attributes being the action script then the nodes on which we are allowed to start it and what to do in the event of failure. Let’s get it registered. If we take a look at the registration in the Oracle Cluster Registry, there it is. Named resources myclock is cluster resource. It’s currently offline because we want it to be offline.

So let’s start it up. Just using the normal crsctl utility, crsctl start resource myclock. And it started, there it is. Notice running on berlin1 – I didn’t actually know on which node it would start and of course my users don’t care. Because in a more sophisticated example, the virtual IP address would’ve also been started on that same node.

Now, let’s demonstrate the full tolerance by killing the process a few times. The text is PID, ps -eflgrep xclock and kill -9. There it is, -8843. Now try to kill it within three seconds. Because of the way it was registered to the check interval of 3, within three seconds it should start up again. One, two, there it is. Restarted. And it will now be on a different PID. So let’s kill it again.

[pause]

Restart virtually instantaneously. Kill it a third time.

[pause]

And look at that. It restarted but it’s bounced over to the other node. And the proof of that – is it running on this node berlin1? No, it isn’t. But if I go to my node berlin2, there it is.

That’s pretty cool. Every time it dies, it gets restarted and after a certain number of failures or attempted restarts, it moved to a different machine. And I could repeat the exercise by killing it a couple of times on the machine where it is now and we’d see it bounce back to the other node.

But now I’ll just stop it in orderly fashion using crsctl stop resource myclock.

Copyright SkillBuilders.com 2017

×
Transcript

12c Flex Clusters: Architecture, Supported Environments and Applications

>> John:  That example we’ve just seen was pretty straightforward. But, believe me, it’s more complicated for a real application. And for that reason, Oracle supplies what they call the Grid Infrastructure bundled agents and these may make configuration much easier. They will generate action scripts and also include the ability to generate dependencies on virtual IP addresses, file systems, and other facilities.

The GI bundled agents supplied for 11.2 Clusterware and also 12.1 Clusterware and all the mainstream operating systems are now supported. The agents are preconfigured to allow you to register an Apache web listener, Apache Tomcat Java servlet container. You can also register MySQL databases as long as you bought Oracle Enterprise Edition MySQL licenses. In addition to that, the Golden Gate processes can be supported. The WebLogic administration server and some of the supporting processes were Siebel, PeopleSoft and JD Edwards.

Now, the GI bundled agents are not perfect but they will certainly make configuration of high availability for the supported products much, much easier.

Copyright SkillBuilders.com 2017

×
Transcript

Summary

6. Summary High Availability with Oracle 12c Flex Clusters

>> John:  To wrap up this session, Grid Infrastructure can now be positioned as fully functional Clusterware. It’s a lot more than just the infrastructure running RAC databases. It competes with third party products such as HACMP from IBM or Veritas Cluster Server from Symantec or HP Serviceguard. It can relocate your applications together with their associated resources such as virtual host names and the file systems they use.

[pause]

It’s been possible to use GI to provide HA for applications for several years now. But in 12c Flex Clusters, it’s an integral part of the product and is designed to provide high availability for your entire environment. In your Flex Cluster, you have hub nodes that run in databases, leaf nodes that run the application servers that connect to those databases, and Grid Infrastructure provides high availability for all the components.

Configuring high availability in a Flex Cluster is not necessarily easy but the end results are really, really powerful. And remember, it’s all free.

Copyright SkillBuilders.com 2017

×
Free Online Registration Required

The tutorial session you want to view requires your registering with us.

It’s fast and easy, and totally FREE.

And best of all, once you are registered, you’ll also have access to all the other 100’s of FREE Video Tutorials we offer!

 

×