Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. The Web Grid Manager presents a Web interface that shows information of the whole Grid and present simple buttons to operate the Tomcat instances.
  2. The managing logic must be clearly separated from the Web interface logic, since later on, a Command-Line Grid Manager will be included, and will use the same managing logic.
  3. The available commands for each instance are:
    • status: retrieves the status of a Tomcat instance throught through the corresponding Grid Agent
    • trigger-start: sends a start request to the Tomcat instance using the corresponding Grid Agent
    • trigger-stop: sends a stop request to the Tomcat instance using the corresponding Grid Agent
    • trigger-kill: sends a kill request to the Tomcat instance using the corresponding Grid Agent
  4. Wiki Markup
    A simple configuration file lists all the machines and their instances so the Grid knows where each instance resides. \[This configuration file is probably in XML format\]
    \\
  5. Grid Agents are installed on each machine and manage all instances in that machine pertaining to the Grid. Grid Agents receive commands from any manager and act accordingly. To manage the instances the Agents use:
    • Shell calls: start an instance, kill an instance.
    • JMX calls to retrieve instance live information.
    • JMX calls to change instance live values, and to request instance shutdown.
    • OS calls for any OS related need.
  6. It's assumed that a port will be accessible from each Grid Manager to each machine where the Grid Agents are serving. The firewall, if present must allow active server-type sockets on that port.
  7. Multiple Grids (and Grid Agents) can be running on the same set (or subset) of machines. If that's the case, Tomcat instances, and Grid Agents run on different ports for each grid. When multiple grids use the same machines they don't interfere with each other and can be operated simultaneously.
  8. The status command shows the following information for each instance:
    • Machine
    • Service (a unique grid-wide name for each instance)
    • State
  9. The state of an instance can be:
    • Wiki Markup
      *Active*: the instance OS process exists, the instance is serving requests, and it looks healthy \[enough\].
      \\
    • Wiki Markup
      *Zoetic* \[for lack of a better word\]: the instance OS process exists, but the instance is unresponsive and it doesn't respond to requests for state. It's probably not serving any HTTP requests, does not look healthy, it may be starting, it may be shutting down, it may be overwhelmed. Who knows.
      \\
    • Stopped: the instance OS process does not exist, and therefore the instance is not operating at all.
    • If possible it would be great to discern different sub cases of the Zoetic state, so to help the user to determine what's going on and tackle the case accordingly:
      • Starting: The Tomcat instance process exists, and the instance is starting. It's not yet serving HTTP requests.
      • Stopping: The Tomcat instance process exists, and the instance is stopping. It's no longer serving HTTP requests.
      • Unresponsive: The Tomcat instance process exists, but the instance health isn't good, it's not responding to HTTP requests, or it's overwhelmed. It's not even responding to requests for status.
  10. Grid Agents communicate over unsecured TCP sockets, and assume communication security is enforced by the network architecture (segregated segments/VLans).
  11. The "trigger"-type commands just deliver the corresponding signal to the instance's Grid Agent and returns right away, without waiting for the full operation to complete. It's kind of "fire and forget". The web user can keep on refreshing the the web interface to find out about the progress of the status of the Tomcat instances.
  12. Wiki Markup
    Simple user name/password authentication is implemented to secure the Web interface. \[Maybe we'll need to provide more options\]
    \\

...

  1. The status command now adds more information for each service (Tomcat instances and Grid Agents):
    • CPU usage (if possible)
    • CPU load (if possible)
    • Head Heap usage (if possible)
    • Threads (if possible)
    • Started on (if possible)
    • Any other information deemed useful for managing purposes.
  2. Wiki Markup
    \[Optional\] Machine information (same page, or maybe an extra tab) shows per machine:
    • CPU usage
    • CPU load (1 min, 5, min, 15 min)
    • Memory usage
    • File system space usage for the mount where the "webapps" dir is (can this be different per instance?).

...

  1. In addition to the Web Grid Manager interface, the Command-Line Grid Manager interface is suitable when the web interface cannot be used. Typical cases are, when no web port is available on the servers (probably fire-walled), when the security policies do not allow remote server operations, etc. This maybe the case on some secured/fire-walled production environments where only text sessions are accessibleacceptable.
  2. The Command-Line Grid Manager is also suitable for automation (e. g. the weekly full/partial site restart) when unattended operations are scheduled, using cron or equivalent utilities.
  3. The Command-Line Grid Manager always leaves a log file per command execution on a directory created for this purpose. Each log file's name includes the time stamp, the command name, and (if possible) the arguments.
  4. The implemented commands are:
    • status
    • trigger-start
    • trigger-stop
    • trigger-kill
  5. The trigger commands are only executed when necessary. If an instance is already running a trigger-start command will be ignored. Conversely trigger-stop and trigger-kill commands are ignored when the instance is stopped.
  6. Return codes must be strategically defined to allow automation. Well defined return codes can provide useful information to the caller program/process (especially for automation), so it can clearly identify the problem and act accordingly.

...

Included features are:

  1. Hooks are integration points to include extra activities we want to be performed when some events occur on each instanceTomcat Instance or Grid Agent. A hook program is linked to a hook and may be implemented as a shell scripts (script or other) and is linked to one of any other kind of executable program. Hooks can be defined for the following events:
    • pre-trigger-start
    • post-trigger-start
    • pre-trigger-stop
    • post-trigger-stop
    • pre-trigger-kill
    • post-trigger-kill
  2. The hooks are only executed when the corresponding signal is not ignored. For example, if a trigger-start is issued and the instance is stopped, the corresponding pre-trigger-start and post-trigger-start hooks are executed. If the instance was running, then the command would be ignored and its hooks would also be skipped.
  3. Hooks can be useful for many purposes. For example, typical uses are:
    • Prepare an instance configuration.
    • Record instance events.
    • Send emails or other notifications upon restarts.
    • Clear caches & temp dirs before starting an instance.
    • Delay the start of an instance to allow the OS to reclaim resources.
    • Generate thread dump dumps on specific events.
  4. Hooks scripts programs run on the machine where the affected instance runs. Therefore, the hooks script are programs need to be copied and are ready prepared (manually or automagically) to be executed on all machines of the grid.
  5. When hooks programs are registered (maybe uploaded) on the Grid they are automatically distributed behind the scenes to all instances/machines before they are ready to usebe used.

Phase 7 - Enhanced Grid Operation

Beyond the basic trigger operations, there's usually need for more complex ones , that provide very common needs but are seldom formally implemented..

Included features are:

  1. Non-trigger commands are added to both the Command-Line and Web interfacesGrid Managers:
    • start: triggers a start and waits until the operation succeeds or fail
    • stop: triggers a stop and waits until the operation succeeds or fail
    • kill: triggers a kill and waits until the operation succeeds or fail
    • restart: triggers a stop, waits until it stops, triggers a start, wait until it starts
    • killstart: triggers a kill, waits until it stops, triggers a start, wait until it starts waits until the operation succeeds or fail; with configurable restart delaykillstart: waits until the operation succeeds or fail; with configurable restart delay
  2. The new commands operate on both types of services (instances and agents).
  3. New hooks are added for the new commands:
    • pre-start
    • post-start
    • pre-stop
    • post-stop
    • pre-kill
    • post-kill
    • pre-restart
    • post-restart
    • pre-killstart
    • post-killstart
  4. All these new commands use the "trigger commands " primitives behind the scenes.
  5. The hooks for the non-trigger events are never ignored, so they the hook programs are executed even if the related trigger commands are ignored.
  6. Automatic trigger-kill operations are now be automatically issued for stop and restart operations if configured, when a trigger-stop fails to succeed in the pre-configured time limit of time. The time limit is now optionally specified in the configuration file on a per-service basis.
  7. A restart delay (now optionally specified on a per-service bases on the configuration file) is used when restarting services: it's applied to the restart and killstart commands.
  8. The non-trigger commands show an update of the service state periodically (defaults to every 10s, and can be specified on the configuration file), and they keep working until the full operation completes.

...