Adding a Resource to a Specified Server Pool

Use the crsctl add resource command to add a resource to a server pool.

To add the Apache Web server to a specific server pool as a resource using the policy-based deployment scheme, run the following command as the user that is supposed to run the Apache Server (for an Apache Server this is typically the root user):

$ crsctl add resource myApache -type cluster_resource -attr
  "ACTION_SCRIPT=/opt/cluster/scripts/myapache.scr,
   PLACEMENT=restricted,
   SERVER_POOLS=server_pool_list,
   CHECK_INTERVAL=30,
   RESTART_ATTEMPTS=2,
   START_DEPENDENCIES=hard(appsvip),
   STOP_DEPENDENCIES=hard(appsvip)"

In the preceding example, myApache is the name of the resource added to the cluster.

Note:

  • You must enclose comma or space-delimited attribute values in single quotation marks (' ') to avoid errors. If you enclose single attributes values in single quotation marks, they are ignored and no errors ensue.

  • A resource name cannot begin with a period nor with the character string ora.

The resource is configured, as follows:

  • The resource is a cluster_resource type.

  • ACTION_SCRIPT=/opt/cluster/scripts/myapache.scr: The path to the required action script.

  • PLACEMENT=restricted

    See Also:

    "Application Placement Policies" for more information about the PLACEMENT resource attribute

  • SERVER_POOLS=server_pool_list: This resource can only run in the server pools specified in a space-delimited list.

  • CHECK_INTERVAL=30: Oracle Clusterware checks this resource every 30 seconds to determine its status.

  • RESTART_ATTEMPTS=2: Oracle Clusterware attempts to restart this resource twice before failing it over to another node.

  • START_DEPENDENCIES=hard(appsvip): This resource has a hard START dependency on the appsvip resource. The appsvip resource must be online in order for myApache to start.

  • STOP_DEPENDENCIES=hard(appsvip): This resource has a hard STOP dependency on the appsvip resource. The myApache resource stops if the appsvip resource goes offline.