Need advice about agent plugin design
by Steven North
I am trying to design an RHQ/JON agent plugin to manage a software
resource with the following characteristics:
- there is the software itself (the installation);
- there are a variable number of "bundles" of configuration information
about 250KB in size each which need to be read from and written to the
agent; and
- there are "log" files which can 10-50MB in size each which need to be
read from the agent.
I think I am pretty clear on how to handle the software itself--just
like any number of other agents.
I am not sure how to handle the configuration bundles and the large log
files.
We might want to have the RHQ/JON server manage different versions of
these configuration files and distribute them to multiple remote agents.
Is there some existing domain object that would handle the read/write
aspect of the configuration bundles (zip files)? Could the "package"
concept be used for these? Would we need to create a new domain object
on the server side for these bundles? If so, is there an example of
this kind of thing?
For the log files, I see some mention of the SupportFacet. Would this
be appropriate for retrieving large log files? Is there an example of this?
We expect to access the configuration bundles and the log files using
remote client operations because we have a separate GUI tool to
build/edit the configuration bundles and to correlate and analyze the
log files. Is there an example of using a remote client to pull files
from and push files to remote agents?
Thanks in advance for any advice you can give or examples you can point to.
Steve
10 years, 1 month
MeasurementUnits (EPOCH_MILLISECONDS, EPOCH_SECONDS)
by Jiri Kremser
Hi,
in plugin descriptor, there can be a metric definition with unit type "epoch_milliseconds" or "epoch_seconds" (rhq-configuration.xsd allows it). What kind of metric should could be represented by epoch_milliseconds? Shouldn't the exact time moments (what values epoch_milliseconds represent) be addressed rather by traits?
I am asking because the values of this type are not formatted (https://bugzilla.redhat.com/show_bug.cgi?id=857144).
I think these two unit types should be removed from MeasurementUnits and xml schema, however there might be some plugins out there using it, so what about deprecation? Are there any edge cases, when these unit types do make sense?
JK
10 years, 2 months
Configuration instance builder
by Lukas Krejci
Hi all,
on a tangent to my current work on the provisioning subsystem I created a fluent builder for Configuration instances.
In my opinion, this will greatly simplify the task of creating the complex configuration objects, mainly while writing the tests.
I placed the builder directly in the Configuration class so that it is more easily discoverable, so this has an impact on our remote API, because we'll start exposing this class.
I don't see anything wrong with it though, it should help people in the CLI, too.
The code along with tests (that cover the builder code by 100%) is in this commit:
https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=lkrejci/configura...
If you have any ideas for improvements of the API, its usage or are opposed to this going to master, please speak up.
I am going to merge this into master in a couple of days.
Thanks,
Lukas
10 years, 9 months
BZ966777 and interruptible component invocation
by Thomas Segismont
Hi everyone,
I'm working on BZ966777 [1]: "EAP 6 plug-in is using a hard-coded
operation timeout for start and stop instead of using the operation
timeout or agent's default operation timeout of 10 minutes"
The reason why the start operation of this plugin is failing after 15
seconds is that the implementation of BaseServerComponent#startServer
creates a ProcessExecution and then calls
"processExecution.setWaitForCompletion(15000L);"
Removing this call is necessary as part of the fix but it won't be
enough. After the SystemInfo instance has been asked to execute the
process, it is checked if the AS7 server has started in
BaseServerComponent#waitForServerToStart. This method tries up to 20
times to read an attribute of the root node of the server management
tree. The invocation thread sleeps one second between tries.
Consequently, with slow starting servers the operation would still be
marked as failed after just over 20 seconds.
So I read the OperationFacet contract. Here's an extract of the
OperationFacet#invokeOperation Javadoc:
"Plugin developers must write implementations of this method with the
awareness that operations are cancelable and should prepare for such a
possibility in the code. For example, a user may request that an
operation be canceled, or an operation may be taking too long and it
should be canceled due to a timeout expiration. When an operation
invocation is canceled, the thread that is invoking this method will be
interrupted. [...] When an operation invocation is canceled, the thread
that is invoking this method will be interrupted. [...] Plugin writers
are encouraged to check the current thread's Thread.isInterrupted()
method periodically to catch cancellation requests, as well as catching
and processing InterruptedException appropriately."
My understanding is that canceled and timed out operations should result
in the invocation thread being interrupted. Neither is happening.
OperationInvocation#markAsCanceled actually interrupts a thread from the
"OperationManager.invoker" pool. But it's not this one which executes
the operation, it's a thread from the
"ResourceContainer.invoker.nonDaemon" pool, because the resource
component is invoked through a proxy. And in
ResourceComponentInvocationHandler#invokeInNewThreadWithLock, only
daemon threads are interrupted when the caller thread is interrupted.
So far, there's a couple of questions I wasn't able to answer:
* why do we have two different pools in ResourceComponentInvocationHandler?
These pools appeared in commit fb3a048 [2] and before that, every
ComponentInvocationThread was a daemon thread.
* why do we transfer the "interrupt" to daemon threads only?
Any ideas?
In addition, I think that calling interrupt to tell a component that an
operation was canceled is not a strong enough design. Plugins developers
use libraries to implement operations (so do we). The interrupted status
of the thread could be cleared by a library. I would like to introduce a
new method to the ResourceContext class:
ComponentInvocationContext getComponentInvocationContext();
And the ComponentInvocationContext interface:
public interface ComponentInvocationContext {
boolean isCanceled();
}
Then plugin developers would only have to check.
What's you opinion?
Thanks and regards,
Thomas
[1] https://bugzilla.redhat.com/show_bug.cgi?id=966777
[2]
https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=fb3a0489469062ba...
10 years, 10 months
Bug 957689 - Unable to complete tasks when server is shutdown
by Thomas Segismont
Hi everyone,
I just push the fix for Bug 957689 - Unable to complete tasks when
server is shutdown [1].
Every point discussed in the wiki page [2] is implemented.
Please reply if you still see any weird exception when shutting down RHQ
server.
With this commit, the services-sar module is still part of the build
although it no longer deploys any service bean.
If you all agree we can get rid of it.
Cheers,
Thomas
-------
[1]
Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=957689
Fedora hosted Git view
https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=adedcb46e352d6fb...
Commit details
commit adedcb46e352d6fb08a43352447b748b9459c899
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jun 6 22:56:11 2013 +0200
Bug 957689 - Unable to complete tasks when server is shutdown
Inject the NoTxRHQDS as a @Resource in the ShutdownListener
Convert SAR services into @Singleton beans
Tweak RHQ EAR deployment with a set of DeploymentUnitProcessor classes
EAR modules now deployed in order
RHQ Startup Subsystem installs a DUP which make the
ShutdownListener bean automatically depend on all other session beans.
-------
[2] https://docs.jboss.org/author/display/RHQ/Shutdown+process+on+AS7
10 years, 10 months
Master Is Open
by Stefan Negrea
Hello Everybody,
Following RHQ 4.8.0 release, the master branch is open again for regular commits.
Thank you,
Stefan Negrea
Software Engineer
10 years, 10 months
RHQ 4.8 released
by Heiko W.Rupp
Hi,
I am very happy to be able to announce the release of RHQ 4.8
Major new features are
* cassandra based storage backend for metrics
* improvements in the new graphs
* better installation process
Please have a look at this blog post for a more detailed description
http://pilhuhn.blogspot.com/2013/06/rhq-48-released.html
and the release notes for details
https://docs.jboss.org/author/display/RHQ/Release+Notes+4.8.0
I want to thank everyone that has contributed to this release
Heiko, on behalf of the RHQ team
--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera
10 years, 10 months
Determining "top-level importsl" using the REST interface
by Joseph McIsaac
Hello all:
Using the RHQ administration service, a list of Top Level Imports --
Servers can be selected for a given platform. The question that I have is,
using the REST interface to RHQ, and selecting JSON as the response format,
how can I either request the top level imports for a given platform, or
interrogate the properties of the child resources of a platform to filter
out the top level imports?
For example, here is the JSON response for MySQL, which is a top level
import:
[
{
"resourceName":"MySql [mysql]",
"resourceId":"10007",
"typeName":"MySql Server",
"typeId":10621,
"pluginName":"MySql",
"parentId":10001,
"links":[
{
"operationDefinitions":{
"href":"
http://localhost:7080/rest/operation/definitions?resourceId=10007"
}
},
{
"self":{
"href":"http://localhost:7080/rest/resource/10007"
}
},
{
"schedules":{
"href":"http://localhost:7080/rest/resource/10007/schedules"
}
},
{
"availability":{
"href":"
http://localhost:7080/rest/resource/10007/availability"
}
},
{
"alerts":{
"href":"http://localhost:7080/rest/resource/10007/alerts"
}
},
{
"parent":{
"href":"http://localhost:7080/rest/resource/10001/"
}
},
{
"coregui":{
"href":"http://localhost:7080/coregui/#Resource/10007"
}
}
],
"ancestry":"10007_:_10001_:_joe-pc"
}
]
If there is something in the payload that I can use to isolate the top
level import child resources from the non-top levels, or a parameter that
I'm missing that will do the same on the REST call, any assistance is
greatly appreciated.
Thanks,
Joe McIsaac
10 years, 10 months
configuring storage installation with rhqctl
by John Sanda
If you want to use non-default values for any of the storage installer options, you need to create a properties file and specify the --storage-config option with the install command. I have always found this to be a bit awkward particularly if I just want to override one option like the heap or hostname. Instead of having the user specify an arbitrary properties file, we could provide <rhq-server-basedir>/bin/rhq-storage.properties with all of the options commented out. If you want to use a non-default value for one of the storage installer options, simply uncomment and edit the corresponding property. I don't think we need the --storage-config option any more.
Thoughts?
10 years, 10 months