Hi Tim,
completely at the bottom of the documentation page, you can see:
cloneInstance(instanceName, cloneName, sshPort, rmiRegistryPort,
rmiServerPort, location, javaOpts): clone an existing instance.
You are right, the createInstance operation allows you to tune the
features: actually, it just updated the org.apache.karaf.features.cfg
file of the instance.
So, you can do the same after cloning an existing instance: you can
update the org.apache.karaf.features.cfg.
Regards
JB
On 04/22/2014 02:39 PM, Tim Moloney wrote:
Perhaps I misunderstood the bottom of the Instances page of the User
Guide (http://karaf.apache.org/manual/latest/users-guide/instances.html),
but it listed a set of methods for controlling instances. The only
method that controls features is createInstance().
Thanks,
Tim
On Mon, Apr 21, 2014 at 1:00 PM, Jean-Baptiste Onofré <[email protected]> wrote:
Hi Tim,
what do you mean by "programmatically" start a feature ?
You can clone an instance, and change etc/org.apache.karaf.feature.cfg to
add your feature as boot feature only for the instance.
Regards
JB
On 04/17/2014 08:46 PM, Tim Moloney wrote:
The files created using instance:create are hard-coded as resources in
org.apache.karaf.instance.core-3.0.1.jar and there doesn't appear to
be any way to override this.
So it appears that I can either use instance:create and I'm stuck with
the default configuration files, or I can use instance:clone but can't
programatically start a feature.
I hope that I'm wrong.
Thanks,
Tim
On Thu, Apr 17, 2014 at 2:28 PM, Achim Nierbeck <[email protected]>
wrote:
Hi,
I think it's best to take a look at the sources :)
You'll find the create at [1] and the clone at [2].
regards, Achim
[1] -
https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=blob;f=instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java;h=535c2a00b1c533537676b95065ebf0a86fbba20c;hb=HEAD#l247
[2] -
https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=blob;f=instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java;h=535c2a00b1c533537676b95065ebf0a86fbba20c;hb=HEAD#l582
2014-04-17 20:20 GMT+02:00 Tim Moloney <[email protected]>:
So all 37 files in the etc directory and the 6 files in the bin
directory are hard-coded into Karaf somewhere?
I can create a new instance using instance:clone, but then there
doesn't appear to be a way to start a feature programatically.
On Thu, Apr 17, 2014 at 1:57 PM, Achim Nierbeck
<[email protected]>
wrote:
No,
it's creating a clean installation of a Karaf setup, without any
previous
knowledge, if you need a new instance that is almost the same as the
one
you
already have, use clone, it copies also all configurations.
regards, Achim
2014-04-17 18:37 GMT+02:00 Tim Moloney <[email protected]>:
So what is create actually doing? Can I control the configuration
files that it creates?
Thanks,
Tim
On Thu, Apr 17, 2014 at 12:31 PM, Achim Nierbeck
<[email protected]> wrote:
No it's the other way round. If you use clone the root instance is
cloned.
If you use create it is literally like unzipping but its not actually
doing
so.
Regards, Achim
sent from mobile device
Am 17.04.2014 17:48 schrieb "Tim Moloney" <[email protected]>:
You said that using instance:clone is "like" unzipping the Karaf zip
artifact. Does is actually unzip the Karaf zip artifact? If I'm
running Karaf on a machine without an Internet connection, will I
have
to have the Karaf zip artifact in one of my repositories? Can I
override which artifact it unzips? Is there a way to specify a
feature to start when using instance:clone?
If I use instance:create, where does Karaf get the files for the etc
directory, since it is not simply copying them from the root
instance?
Thanks,
Tim
On Thu, Apr 17, 2014 at 11:21 AM, Tim Moloney
<[email protected]>
wrote:
Thanks for pointing me in the right direction.
Tim
On Thu, Apr 17, 2014 at 11:19 AM, Achim Nierbeck
<[email protected]> wrote:
If you clone the root instance your modifications are transferred
to
the
cloned instances too. If you create a new instance it's like
unzipping
the
karaf zip artifact.
Regards, Achim
sent from mobile device
Am 17.04.2014 16:55 schrieb "Tim Moloney"
<[email protected]>:
I just started experimenting with instances in Karaf. I've
noticed
that the child instances aren't getting the changes I've made to
etc/org.apache.karaf.features.cfg. I did the following:
- modified the featuresRepositories property in
etc/org.apache.karaf.features.cfg (added a custom features
repository)
- started Karaf
- created an instance (instance:create foo)
- compared the configuration files (diff -u
{etc,instances/foo}/org.apache.karaf.features.cfg
The child instance does not have my custom features repository.
If
the child instances aren't getting org.apache.karaf.features.cfg
from
the root etc directory, where are they getting them from? Can I
modify this location? I know that I can use the --furl option,
but
all of the my child instances will need my custom features
repository
and it would be simpler to configure that in one spot.
BTW, both Karaf 3.0.0 and 3.0.1 act this way. I haven't tried
any
other versions.
Thanks,
Tim
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
&
Project Lead
blog <http://notizblog.nierbeck.de/>
Software Architect / Project Manager / Scrum Master
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Software Architect / Project Manager / Scrum Master
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com