Creating Resources

Now that the cluster is up and running, you have to add resources to it. The best way to do that is with the graphical HA Management Client utility; as an alternative, you can use the command-line CIBAdmin tool. The next procedure describes how to add resources using the HA Management Client utility:

1. The graphical client needs the credentials of the user hacluster who has been created automatically when you installed the cluster. As root, use passwd hacluster to give this user a password.

2. By using the hb_gui command from a console, start the HA Management Utility. This opens the interface shown in Figure 29-10.

Figure 29-10. Initially, the HA Management Client shows an empty interface.

3. To do anything in the graphical utility, you need to authenticate first. Click Connection, select Login, and then enter the password of the user hacluster. The graphical utility will now connect to the cluster and show a graphical overview of it (see Figure 29-11).

Figure 29-11. After authenticating, you see an overview of the current status of the cluster.

4. Now you need to add some resources. To keep it simple, click Resources > Add, and then select the resource type Native. This opens the Add Native Resource screen shown in Figure 29-12. Other resource types are available as well, but it goes beyond the scope of this chapter to discuss how they work.

5. The native resource type allows you to select any service start-up script from the /etc/ init.d directory, as well as some native Heartbeat resources. From the list, select the resource you want to configure. To give a simple example, if you want to create a Heartbeat resource for an IP address, which is useful to migrate a virtual IP address across the cluster, select the resource IPaddr, which has Heartbeat as its provider and the description OCF Resource Agent Compliant IPaddr script. In Figure 29-13 you can see what the properties of this resource are.

6. In the parameters part of the Add Native Resource screen (see Figure 29-13), you can see that one of the parameters has the name ip. On this line, click under the Value column, and there, add the IP address you want to assign to the resource. When done, click Add to add the resource.

7. Now open the Resources item in the Heartbeat management utility. This shows the resource with the current status not running. Right-click the resource, and from the quick menu, click the Start button to start it. You will see that the resource starts running immediately on the node that was started first in the cluster. Check this node to see that the resource is really there indeed. For example, in the case of an IP address, you can use the ip address show command to see that the IP address was really added.

Figure 29-12. On the Add Native Resource screen, you can specify what resource you want to configure.
Figure 29-13. To make sure that the resource starts successfully, you need to modify its properties.

In this section, you read about how to create a resource in a Heartbeat environment. Adding an IP address as a resource is a rather simple but efficient example that helps you understand how to configure resources in a Heartbeat environment. However, the IP address resource is only the foundation of other resources in a Heartbeat environment. The IP address resource is only the foundation of other resources in a Heartbeat environment. For example, you can create a DRBD resource for your DRBD-based shared storage as well, and once these two are in place, you can add an NFS server or a Samba server that use these two resources. If you are creating resource dependencies this way, you must make sure the resources are loaded in the right order. To do this, right-click the resource, and use the Move Up and Move Down buttons to determine the order that the resource is loaded in.

In addition to configuring the resources as described here, managing Heartbeat involves much more than that. It goes far beyond the scope of this chapter to discuss all the options, which would require a book on its own.

Was this article helpful?

0 0

Post a comment