CirrAS 1.0.0.Beta2

I'm pleased to announce availability of CirrAS 1.0.0.Beta2. This release includes several bug fixes and a bunch of new (or updated) technologies. You can find in CirrAS JIRA list of closed tickets.

RHQ

image

RHQ is the platform used for JBoss products (but not only!) management and monitoring. With Beta2 we're using latest RHQ 3.0.0.B03 version. Release notes for RHQ 3.0.0.B03 can be found here.

Beginning with CirrAS 1.0.0Beta2 you have now a working monitoring and managing suite. On management appliance we have deployed RHQ server. You can reach it on port 7080. Default username and password for RHQ Server is rhqadmin/rhqadmin. Every node in the cluster comes also with a preinstalled RHQ Agent.

How it works?

  1. On management appliance RHQ server is started and reconfigured for your environment,
  2. RHQ agent on every node is reconfigured so it will know where RHQ server is located.
  3. On every node RHQ agent starts and connects to RHQ server.
  4. Every discovered service by RHQ agent is submitted to RHQ server.
  5. Discovered services are hold in Auto-discovery queue.
  6. A script is importing every discovered Apache HTTPD server and JBoss AS into RHQ inventory.

Above steps are executed fully transparently to end user. End user only needs to wait a bit and use that stuff!

image

JBoss AS 6 Milestone 2

On 16 Feb 2010 JBoss ASteam released new milestone version of  JBoss AS 6. This release adds support for JPA2 and Servlet 3.0. You can now use those technologies in CirrAS! New version of JBoss Microcontainer is also included.

Full release notes for JBoss AS Milestone 2 are available here. Don't forget to check out new great-looking JBoss AS project site!

S3\_PING

We have a great news for Amazon EC2 users. In EC2 environment CirrAS doesn't require from now GossipRouter. Because on EC2 we don't have multicast available (which would greatly simplify cluster formation) we were forced to introduce GossipRouter - a service running on front-end appliance whose task was to coordinate back-end nodes. After a new cloud protocol S3_PING was added to JGroups - we could remove the unnecessary GossipRouter service on EC2.

With that change you need add bucket name to encoded credentials when you're starting management appliance. We updated our wiki page to cover that.

Fedora 12

In this Beta we're using Fedora 12 as our platform. Fedora 12 is the latest stable available version. Release notes can be found here.

Downloads and help

All appliances are available for immediately download (AMI list included). If you need help we're always for you on our forums or in our IRC channel: #stormgrind.

RHQ CLI – configuring and importing resources

RHQ is the underlying platform for all management projects from JBoss: commercial supported JBoss Operation Network and JOPR – a community based monitoring and managing suite.

Some time ago RHQ developers announced new RHQ build including all JOPR plugins. After that we decided to move from JOPR to RHQ and use latest developer build.

RHQ/JOPR in the Cloud

CirrAS goal is to deploy a cluster of JBoss AS without user interaction at all. Now, we're expanding the goal and adding a monitoring and management (still no user actions needed!).

On each node we're installing an RHQ Agent. To be honest it is installed automatically after the node (front-end, back-end) is started. Every node grabs plugin binary from RHQ Server. The binary is installed then and finally a RHQ Agent is launched.

An agent is responsible for gathering information about running services and reporting that to RHQ server which is located on management appliance. A discovered node is added to Discovery Queue in RHQ Server. This was a scratch on glass – earlier an administrator was forced to log in into RHQ console and import selected resources. This is now over!

Second thing we wanted to avoid is to configure any plugin to have a working monitoring suite. Unfortunately Apache HTTP Server plugin requires an URL to put into configuration. This URL is used for checking availability. We worked it out too using RHQ CLI.

RHQ CLI

RHQ has a powerful Command Line Interface included. Before you're able to use it, you need to install it properly (not a big deal). If you think RHQ CLI language looks familiar, yes, you're right – it's JavaScript, but extended to use also Java objects.

There are two ways you can use this CLI: interactive and non-interactive. In interactive mode you have a Bash-like command line where you execute commands. Greg Hinkle described it very well. In non interactive mode all commands located in a file are executed. Your choice.

Before we start I need to mention that JavaDocs for RHQ Remote API and domain are very helpful!

Let's begin! First of all we want to grab all discovered but not imported Apache HTTP servers.

var criteria = new ResourceCriteria();
criteria.addFilterResourceTypeName("Apache HTTP Server");
criteria.addFilterInventoryStatus(InventoryStatus.NEW);
var httpd_servers = ResourceManager.findResourcesByCriteria(criteria);

A list of resources is returned, we can print all elements:

if (httpd_servers != null && httpd_servers.size() > 0) {
    for (var i = 0; i < httpd_servers.size(); i++) {
        var resource = httpd_servers.get(i);
        println(" - " + resource.name);
    }
} else {
    println("No servers found.")
}

Making changes in plugin configuration

We want to get the configuration for agent connection which we want to modify. We need to grab a proxy object for selected resource. Proxy objects are simplifying interaction with RHQ resources.

var httpd = ProxyFactory.getResource(httpd_servers.get(0).id);

From that object we need to grab plugin configuration which we need mot alter:

var httpd_configuration = httpd.getPluginConfiguration();

Last step is to simply modify property we want:

httpd_configuration.getSimple("url").setStringValue("http://10.1.0.3");
httpd.updatePluginConfiguration(httpd_configuration);

Plugin configuration is now modified. Simple, huh?

Importing resources

Next we want to import resources we discovered earlier. It is as simple as executing importResources function:

DiscoveryBoss.importResources(httpdResourceIds);

Please be aware that this command takes one argument – an array of resource ids. You'll get also an error when you try to import a resource with a parent resource which is not imported. You need to import resources in the proper order, remember! You can use for that function like this:

httpdResourceIds = [];

for (i = 0; i < httpd_servers.size(); i++) {
    addDependencyIds(httpd_servers.get(i), httpdResourceIds);
}

function addDependencyIds(resource, array) {
    var parent = ResourceManager.getResource(resource.id).getParentResource();

    if (parent != null) {
        addDependencyIds(parent, array);
    }

    array.push(resource.id);
}

Conclusion

RHQ CLI is really great. Above example is only a tip of the iceberg what you can do with it. In CirrAS we're using a bigger script which solved our problem with auto importing and reconfiguring servers. You can take a look, maybe it'll help you with your problem too!