[AIX HP-UX Linux Solaris Windows]

Getting advice with Metric Server

Metric Server provides server load information to the Load Balancer in the form of system-specific metrics, reporting on the health of the servers.

Before you begin

The Metric Server agent must be installed and running on all servers that are being load balanced.

If you are using IPv6 protocol on your machine and want to use Metric Server, you must check to see if protocol 58 is defined to be ICMPv6 in the protocol file.

When using IPv6 protocols: If you are using IPv6 protocol on your machine and want to use advisors, you must modify the protocol file. To enable IPv6, insert the following line in the protocol file:
ipv6-icmp 58 IPv6-ICMP # IPv6 interface control message protocol
The protocol file is in the following directory:
  • [AIX] [HP-UX] [Linux] [Solaris]

    /etc/protocols

  • [Windows]

    C:\windows\system32\drivers\etc\

Metric Server Restriction: Like the Metric Server agent, the WLM agent reports on server systems as a whole, rather than on individual protocol-specific server daemons. Metric Server and WLM place their results into the system column of the manager report. As a consequence, running both the WLM advisor and Metric Server at the same time is not supported.

About this task

The Load Balancer manager queries the Metric Server agent residing on each of the servers, assigning weights to the load balancing process using the metrics gathered from the agents. The results are also placed into the manager report.
Note: When two or more metrics are gathered and normalized for each server into a single system load value, rounding errors may occur.

Procedure

  1. Configure Metric Server on the Load Balancer machine.
    1. Start dsserver. Start the executor, and add clusters, ports and servers to your configuration.
    2. Start the manager. Issue the command:
      dscontrol manager start manager.log port
      where port is the RMI port chosen for all the Metric Server agents to run on. The default RMI port that is set in the metricserver.cmd file is 10004.
    3. Add the system metric script to the cluster. Issue the command:
      dscontrol metric add cluster@systemMetric

      systemMetric is the name of the script (residing on the back-end server) which should run on each of the servers in the configuration under the specified cluster. Two scripts are provided for the customer - cpuload and memload - or you can create custom system metric scripts.

      The script contains a command which should return a numeric value in the range of 0-100 or a value of -1 if the server is down. This numeric value should represent a load measurement, not an availability value.
      Avoid trouble [Windows] Avoid trouble: If the name of your System Metric script has an extension other than ″.exe″, you must specify the full name of the file (for example, ″mysystemscript.bat″). This is due to a Java limitation.gotcha
    4. Add to the configuration only servers that contain a Metric Server agent running on the port specified in the metricserver.cmd file. The port should match the port value specified in the manager start command.
      Note: To ensure security:
      • On the Load Balancer machine, create a key file (using the lbkeys create command).
      • On the back-end server machine, copy the resulting key file, for the component you are using, to the install_root/admin/keys directory. Verify that the key file’s permissions enable the file to be readable by the root.
  2. Configure Metric Server on the server machines.
    1. Install the Metric Server package from the Load Balancer installation files.
    2. Check the metric server script in the install_root/ms/bin directory to verify that the desired RMI port is being used. The default RMI port is 10004.
      Note: The RMI port value specified must be the same value as the RMI port value that was specified in the manager start command in Step 1b.
    3. Optional: You can write their own customized metric script files which define the command that the Metric Server will issue on the server machines. Ensure that any custom scripts are executable and located in the install_root/ms/script directory. Custom scripts must return a numeric load value in the range of 0-100.
      Note: A custom metric script must be a valid program or script with a ″.bat″ or ″.cmd″ extension.

      [AIX] [HP-UX] [Linux] [Solaris] Specifically, for Linux and other UNIX-based systems, scripts must begin with the shell declaration, otherwise they may not properly run.

      The following two scripts are provided for the customer in the install_root/ms/script directory:
      • cpuload: returns the percentage of cpu in use ranging from 0-100
      • memload: returns the percentage of memory in use ranging from 0-100.
    4. Start the metric server agent. On a command line of each server machine where Metric Server resides, type
      metricserver start

      [Windows] Click Start > Control Panel > Administrative Tools > Services. Right-click IBM Metric Server (ULB) and select Start.

    5. Optional: Stop the metric server agent.
      [Linux] [AIX HP-UX Solaris] To stop the Metric Server agent, issue this command on every server machine where Metric Server resides:
      metricserver stop

      [Windows] Click Start > Control Panel > Administrative Tools > Services. Right-click IBM Metric Server (ULB) and select Stop.

  3. Optional: Change the log level in the Metric Server startup script. You can specify a log level range of 0 through 5, similar to the log level range in Load Balancer logs. This will generate an agent log in the install_root/ms/logs directory.
  4. Optional: To have Metric Server run on an address other than the local host, you need to edit the metricserver file on the load balanced server machine.
    Note: When gathering metrics across different domains, you must explicitly set the java.rmi.server.hostname in the server script (dsserver, etc) to the fully qualified domain name (FQDN) of the machine that is requesting the metrics. This is necessary because InetAddress.getLocalHost.getHostName() might not return the FQDN.
    1. After the occurrence of ″java″ in the metricserver file, insert the following:
      -Djava.rmi.server.hostname=OTHER_ADDRESS
    2. Before the ″if″ statements in the metricserver file, add the following line:
      hostname OTHER_ADDRESS
    3. [Windows] You will also need to alias the OTHER_ADDRESS on the Microsoft stack of the Metric Server machine. For example:
      call netsh interface ip add address "Local Area Connection"
        addr=9.37.51.28 mask=255.255.240.0
  5. Optional: Configure Metric Server for IPv4 only or IPv6 only. In a Load Balancer configuration that supports both IPv4 and IPv6 clusters, servers that run the Metric Server function can be configured as an IPv4 server only or as an IPv6 server only, but not both. To force Metric Server to use a particular IP protocol, specify the Java property java.rmi.server.hostname in the metricserver script.
    Note: The host name specified in the Java property must be the physical IP address of the Metric Server.
    • [AIX] [Linux] [Solaris] [AIX HP-UX Solaris] For Metric Server to communicate over the IPv6 address 2002:92a:8f7a:162:9:42:92:67, specify the Java property after $LB_CLASSPATH in the metricserver startup script, in the install_root/bin directory, as follows:
       install_root/java/jre/bin/java ..... $ULB_CLASSPATH 
      -Djava.rmi.server.hostname=2002:92a:8f7a:162:9:42:92:67 
      com.ibm.internet.nd.sma.SMA_Agent $LB_RMIPORT $LOG_LEVEL $LOG_SIZE $LOG_DIRECTORY $KEYS_DIRECTORY 
      $SCRIPT_DIRECTORY & 
    • [Windows] For Metric Server to communicate over the IPv6 address 2002:92a:8f7a:162:9:42:92:67, you must edit the metricserver.cmd file, in the install_root/bin directory, as follows:
      start 
      /min /wait %IBMULBPATH%\java\jre\bin\java 
      -Djava.rmi.server.hostname=2002:92a:8f7a:162:9:42:92:67 
      -Djava.net.preferIPv4Stack=false 
      -Djava.net.preferIPv6Stack=true -Xrs -cp 
      %LB_CLASSPATH% com.ibm.internet.nd.sma.SMA_Agent 
      %RMI_PORT% %LOG_LEVEL% %LOG_SIZE% %LOG_DIRECTORY% %KEYS_DIRECTORY% 
      %SCRIPT_DIRECTORY% 
      goto done 
      
      :stop 
      %IBMLBPATH%\java\jre\bin\java 
      -Djava.rmi.server.hostname=2002:92a:8f7a:162:9:42:92:67 
      -Djava.net.preferIPv4Stack=false 
      -Djava.net.preferIPv6Stack=true -cp %LB_CLASSPATH% com.ibm.internet.nd.sma.SMA_AgentStop %RMI_PORT% 
      :done



Related tasks
Tuning
Enabling advisors to manage load balancing
Task topic Task topic    

Terms of Use | Feedback

Last updatedLast updated: Jun 20, 2011 4:04:37 PM EDT
File name: tprf_metricserv.html