You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ace.apache.org by "Robert M. Mather" <ro...@gmail.com> on 2015/02/14 20:23:08 UTC
Can't connect from Agent on Karaf client
I'm new to Ace and considering it for a production deployment with a couple
hundred targets that might scale to thousands in the next few months. I'm
assuming it's production ready for that sort of scenario?
At the moment, I'm having trouble connecting from the Agent bundle running
on Karaf (installed via feature.xml generated by the maven-karaf-plugin,
see below). When installing the Agent feature, I get the startup
confirmation (below), and when I set the discovery+identification System
properties and restart the agent, I see the correct values filled in for
Target ID and Server, but the client never shows up as a registered target
on the server. I know the server is working and that I'm using the right
url, because I can connect and register from the standalone agent included
with the Ace binary distribution by running
java -Dagent.identification.agentid=<my-id>
-Dagent.discovery.serverurls=<my-url> -jar target.jar
The only differences I see are how the two properties get set and the
versions of the agents running on the two. For the Karaf feature, I'm using
the latest from Maven central
org.apache.ace:org.apache.ace.managementagent:0.8.1-incubator
and the target.jar is just the one included with Ace 2.0.1 binary
distribution.
I'd appreciate any guidance on how to debug this! Using Ace would be so
much nicer than rolling my own to do the same thing!
Robert
karaf@root()> feature:install ace.agent
Started management agent.
Target ID: configuredGatewayID
Server : http://localhost:8080
Sync interval: 2000 ms
Unaffected bundles will not be stopped during deployment.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1"
name="ace.agent">
<feature name="ace.agent" version="0.0.1-SNAPSHOT"
description="ace.agent">
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.managementagent/0.8.1-incubator</bundle>
<bundle start-level="50">mvn:org.osgi/org.osgi.core/4.2.0</bundle>
<bundle
start-level="50">mvn:org.osgi/org.osgi.compendium/4.2.0</bundle>
<bundle
start-level="50">wrap:mvn:javax.servlet/servlet-api/2.4</bundle>
<bundle
start-level="50">mvn:org.apache.felix/org.apache.felix.configadmin/1.2.8</bundle>
<bundle
start-level="50">mvn:org.apache.felix/org.apache.felix.eventadmin/1.2.8</bundle>
<bundle
start-level="50">wrap:mvn:concurrent/concurrent/1.3.4</bundle>
<bundle
start-level="50">mvn:org.apache.felix/org.apache.felix.dependencymanager/3.0.0</bundle>
<bundle
start-level="50">mvn:org.apache.felix/org.apache.felix.deploymentadmin/0.9.0</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.log.listener/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.gateway.log/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.scheduler.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.gateway.log.store/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.range.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.util/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.deployment.provider.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.log/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.discovery.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.discovery.property/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.identification.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.identification.property/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.scheduler/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.deployment.api/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.deployment.deploymentadmin/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.ace/org.apache.ace.deployment.task/0.8.1-incubator</bundle>
<bundle
start-level="50">mvn:org.apache.logging.log4j/log4j-api/2.1</bundle>
</feature>
</features>
Re: Can't connect from Agent on Karaf client
Posted by Marcel Offermans <ma...@luminis.nl>.
Hello Robert,
On 15 Feb 2015 at 03:21:01, Robert M. Mather (robert.mather.rmm@gmail.com) wrote:
Thanks for your guidance Marcel.
On Sat, Feb 14, 2015 at 3:43 PM, Marcel Offermans <ma...@luminis.nl> wrote:
Hello Robert,
On 14 Feb 2015 at 20:26:01 , Robert M. Mather (robert.mather.rmm@gmail.com) wrote:
I'm new to Ace and considering it for a production deployment with a couple
hundred targets that might scale to thousands in the next few months. I'm
assuming it's production ready for that sort of scenario?
Yes.
At the moment, I'm having trouble connecting from the Agent bundle running
on Karaf (installed via feature.xml generated by the maven-karaf-plugin,
see below).
It seems that plugin fetches artifacts from Maven Central, and our current releases are not published there anymore. That is why you end up with 0.8.1-incubator releases which are really old and should not be used. Instead, please use the artifacts from the latest binary release. I assume that a lot of the other problems you have come from the fact that you are working with these old versions.
The agent is now a single bundle, so there is no need to make a feature out of it (org.apache.ace.agent.jar).
I've tried loading that jar from the Karaf deploy folder, and the Agent bundle becomes active, but I can't figure out how to configure the discovery/identification properties so it will connect to my Ace server. Does the Agent bundle have a PID I can use with the Config Admin?
We deliberately wanted to make the agent as self-contained as we could, so we decided against using ConfigurationAdmin for the agent. You can use system properties instead: http://ace.apache.org/docs/user-guide.html#target-configuration
I would actually recommend you start with the launcher (org.apache.ace.launcher.felix.jar), which bootstraps the Felix framework and this agent and then install all of your other bundles via ACE.
I'd definitely prefer starting this way, but I've been using Karaf due to the service wrapper to bind startup to the client OS (critical for our deployment)
If you’re using some Linux based OS, we recently added a script to start and stop a launcher as a service. It’s not in the release yet, but in trunk, here:
https://svn.apache.org/repos/asf/ace/trunk/run-target/scripts/ace-agent.sh
and features, which are the easiest way I've found to include non-OSGi-bundle dependencies in the container. Just starting from Ace and Felix is there a straightforward way of resolving the dependency trees of 3rd party libraries and "wrapping" them into bundles? This is extremely easy with features and the karaf-maven-plugin, which searches the transitive dependencies of a library, includes what's needed in the feature descriptor xml, and handles "wrapping" any non-osgi dependencies it finds.
We usually do that with Bndtools and wrap such code as part of our build (so not run-time but build-time). In the end, you have a bundle that contains the code you need so if you can get at that, you can upload it to ACE and deploy it. That also goes for Karaf itself of course.
I'd appreciate any guidance on how to debug this! Using Ace would be so
much nicer than rolling my own to do the same thing!
The (new) agent has an option (-v) to start in verbose mode. That means it will output all internal logging to the console, which is usually a good starting point for diagnosis.
Greetings, Marcel
Thanks for helping along an OSGi/Ace/Karaf newbie!
You’re welcome, feel free to keep asking questions. :)
Greetings, Marcel
Re: Can't connect from Agent on Karaf client
Posted by "Robert M. Mather" <ro...@gmail.com>.
Thanks for your guidance Marcel.
On Sat, Feb 14, 2015 at 3:43 PM, Marcel Offermans <
marcel.offermans@luminis.nl> wrote:
> Hello Robert,
>
> On 14 Feb 2015 at 20:26:01 , Robert M. Mather (robert.mather.rmm@gmail.com)
> wrote:
>
> I'm new to Ace and considering it for a production deployment with a couple
>
> hundred targets that might scale to thousands in the next few months. I'm
> assuming it's production ready for that sort of scenario?
>
> Yes.
>
> At the moment, I'm having trouble connecting from the Agent bundle running
> on Karaf (installed via feature.xml generated by the maven-karaf-plugin,
> see below).
>
> It seems that plugin fetches artifacts from Maven Central, and our current
> releases are not published there anymore. That is why you end up with
> 0.8.1-incubator releases which are really old and should not be used.
> Instead, please use the artifacts from the latest binary release. I assume
> that a lot of the other problems you have come from the fact that you are
> working with these old versions.
>
> The agent is now a single bundle, so there is no need to make a feature
> out of it (org.apache.ace.agent.jar).
>
I've tried loading that jar from the Karaf deploy folder, and the Agent
bundle becomes active, but I can't figure out how to configure the
discovery/identification properties so it will connect to my Ace server.
Does the Agent bundle have a PID I can use with the Config Admin?
> I would actually recommend you start with the launcher
> (org.apache.ace.launcher.felix.jar), which bootstraps the Felix framework
> and this agent and then install all of your other bundles via ACE.
>
I'd definitely prefer starting this way, but I've been using Karaf due to
the service wrapper to bind startup to the client OS (critical for our
deployment) and features, which are the easiest way I've found to include
non-OSGi-bundle dependencies in the container. Just starting from Ace and
Felix is there a straightforward way of resolving the dependency trees of
3rd party libraries and "wrapping" them into bundles? This is extremely
easy with features and the karaf-maven-plugin, which searches the
transitive dependencies of a library, includes what's needed in the feature
descriptor xml, and handles "wrapping" any non-osgi dependencies it finds.
> I'd appreciate any guidance on how to debug this! Using Ace would be so
> much nicer than rolling my own to do the same thing!
>
> The (new) agent has an option (-v) to start in verbose mode. That means it
> will output all internal logging to the console, which is usually a good
> starting point for diagnosis.
>
> Greetings, Marcel
>
>
> Thanks for helping along an OSGi/Ace/Karaf newbie!
Best, Robert
Re: Can't connect from Agent on Karaf client
Posted by Marcel Offermans <ma...@luminis.nl>.
Hello Robert,
On 14 Feb 2015 at 20:26:01 , Robert M. Mather (robert.mather.rmm@gmail.com) wrote:
I'm new to Ace and considering it for a production deployment with a couple
hundred targets that might scale to thousands in the next few months. I'm
assuming it's production ready for that sort of scenario?
Yes.
At the moment, I'm having trouble connecting from the Agent bundle running
on Karaf (installed via feature.xml generated by the maven-karaf-plugin,
see below).
It seems that plugin fetches artifacts from Maven Central, and our current releases are not published there anymore. That is why you end up with 0.8.1-incubator releases which are really old and should not be used. Instead, please use the artifacts from the latest binary release. I assume that a lot of the other problems you have come from the fact that you are working with these old versions.
The agent is now a single bundle, so there is no need to make a feature out of it (org.apache.ace.agent.jar).
I would actually recommend you start with the launcher (org.apache.ace.launcher.felix.jar), which bootstraps the Felix framework and this agent and then install all of your other bundles via ACE.
I'd appreciate any guidance on how to debug this! Using Ace would be so
much nicer than rolling my own to do the same thing!
The (new) agent has an option (-v) to start in verbose mode. That means it will output all internal logging to the console, which is usually a good starting point for diagnosis.
Greetings, Marcel