Introduction to Hawkular
- Published: 02 February 2016
This tutorial is an introduction to Hawkular monitoring solution. We will learn the core features of it and how to install its Agent on a WildFly 10 Server.
First of all what is Hawkular? in a nutshell it is a an opensource monitoring solution sponsored by Red Hat. It is a successor of the RHQ Project and of its supported solution JON. Hawkular is gaining relevance as it's already adopted by several middleware projects: in terms of application server, it is not meant to be a replacement for the Admin Console, yet as you will see some administrative functions (like deploying applications, configuring a Datasource) can be performed as well from Hawkular. So there will be no surprise if Hawkular will be also the core management solution for the application server.
Services provided by Hawkular
Hawkular provides different services to manage common monitoring tasks such as
- Storing Metrics
- Inventory of resources
- Alert for metrics
- Metric visualization
Where is data stored by Hawkular?
Hawkular uses Cassandra as single source of storage. By using Cassandra, Hawkular can guarantee replication and horizontal scalability for the most demanding needs.
Additionally Hawkular provides a set of REST services that can be used to store and display metrics, define and trigger alerts. Behind the hoods the Drools rule engine handles the Alerts and Metrics dynamics
Download the current version of Hawkular from http://www.hawkular.org/downloads.html
Next unzip it:
Hawkular, as most middleware projects, is structured as a WildFly application server with some extra features. In this case, the hawkular and keycloak-server subsystem have been included to provide its core functionalities and handle security. Additionally, the Cassandra Driver has been installed to handle persistence of data collected.
You can start Hawkular just like any WildFly/JBoss instance:
cd hawkular-1.0.0.Alpha9/bin bin/standalone.sh # use standalone.bat on Windows
Once that the server started, connect to the Welcome page:
You will be propted to login. As we haven't yet defined an user click on Register:
Complete the registration form. We will now install the Hawkular agent on a WildFly 10 instance: head to the "Install Agent" tab. From there complete the information related to the Server, enter the User details that you will use to connect to Hawkular and click on Download Installer:
Now you can install the required modules on the target WildFly server. If you haven't entered the server details previously you can still pass them on the command line as follows:
java -jar hawkular-wildfly-agent-installer.jar --target-location=/home/jboss/wildfly-10.0.0.CR4 --username admin --password Password1!
Great, now start the WildFly server with an offset to avoid port clash with hawkular:
You should be able to see that the connection between the Agent and the Hawkular server completed:
Enjoy a tour of its features by going through the Application Servers tab:
Clicking on the Server link, you can get into the Server Details: as you can see from the following picture, some of the Runtime attributes available on the WildFly Admin Console can be traced also here; however Hawkular includes also Runtime graphs about the attributes along with Alerts triggered. Some common tasks as Datasource creation or Deployments are available from here:
In the next tutorial we will learn how to collect and promote metrics using the Hawkular REST API. Stay tuned!!