You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Ronny Bräunlich <r....@gmail.com> on 2014/12/11 19:40:58 UTC
Cellar: sharing services
Hi everyone,
I have a general question about services in Cellar.
I am running two instances and both are in the same group (default) and so synchronize their state.
Both contain a bundle with a ManagedServiceFactory. The config file is in the etc directory of the first Karaf. All of the configuration arrives at the second Karaf, too.
But the service the engine should created is only visible in the first Karaf. The second one doesn’t seem to bother.
I am not sure about the behavior. Should both Karafs create the service or do they share the service or am I totally wrong? ;-)
Cheers,
Ronny
Re: Cellar: sharing services
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Ronny,
nope, if you want to "share" a service you need to use the dosgi feature.
But this will only work with ons service in shared between different
cluster groups. All other services are local to each node, so the second
node should create the same services you have on the first node.
If this isn't the case there might be an issue of the transfer of your
configuration to the second node.
regards, Achim
2014-12-16 16:36 GMT+01:00 Ronny Bräunlich <r....@gmail.com>:
>
> Hey guys,
>
> I am sorry but I am not sure what my configuration is missing.
> I never changed it so it looks like this:
>
> groups = default
>
> default.config.whitelist.inbound = *
> default.config.whitelist.outbound = *
> default.config.blacklist.inbound = org.apache.felix.fileinstall*, \
> org.apache.karaf.cellar*, \
> org.apache.karaf.management, \
> org.apache.karaf.shell, \
> org.ops4j.pax.logging, \
> org.ops4j.pax.web
> default.config.blacklist.outbound = org.apache.felix.fileinstall*, \
> org.apache.karaf.cellar*, \
> org.apache.karaf.management, \
> org.apache.karaf.shell, \
> org.ops4j.pax.logging, \
> org.ops4j.pax.web
> default.config.sync = true
>
> default.feature.whitelist.inbound = *
> default.feature.whitelist.outbound = *
> default.feature.blacklist.inbound = config,management,hazelcast,cellar*
> default.feature.blacklist.outbound = config,management,hazelcast,cellar*
> default.feature.sync = true
> default.feature.repositories.sync = true
>
> default.bundle.whitelist.inbound = *
> default.bundle.whitelist.outbound = *
> default.bundle.blacklist.inbound = none
> default.bundle.blacklist.outbound = none
> default.bundle.sync = true
>
> default.obr.urls.sync = true
> default.obr.bundles.sync = true
>
> Do I have to add something like "default.service.whitelist.inbound = *“ ?
>
> Cheers,
> Ronny
>
> Am 11.12.2014 um 20:44 schrieb Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
> etc/org.apache.karaf.cellar.groups.cfg
>
> On 12/11/2014 08:41 PM, Ronny Bräunlich wrote:
>
> Hi Achim,
>
> how did I blacklist the service? Or better, how do I whitelist it?
>
> Cheers,
> Ronny
>
> Am 11.12.2014 um 20:36 schrieb Achim Nierbeck <bcanhome@googlemail.com
> <mailto:bcanhome@googlemail.com <bc...@googlemail.com>>>:
>
> Hi Ronny,
> since you seemed to have blacklisted the service on the second node it's
> not being managed even though the configuration is available to the node
> because of configuration synchronization. Actually both nodes of the
> same group should be equivalent therefore the second node should have
> the same services running.
> If you want to have a distributed service you need to separate both
> nodes into different groups. With that running you're able to have one
> service only running on one node which is consumable from the other
>
> regards, Achim
>
>
>
> 2014-12-11 19:40 GMT+01:00 Ronny Bräunlich <r.braeunlich@gmail.com
> <mailto:r.braeunlich@gmail.com <r....@gmail.com>>>:
>
> Hi everyone,
>
> I have a general question about services in Cellar.
> I am running two instances and both are in the same group (default)
> and so synchronize their state.
> Both contain a bundle with a ManagedServiceFactory. The config file
> is in the etc directory of the first Karaf. All of the configuration
> arrives at the second Karaf, too.
> But the service the engine should created is only visible in the
> first Karaf. The second one doesn’t seem to bother.
> I am not sure about the behavior. Should both Karafs create the
> service or do they share the service or am I totally wrong? ;-)
>
> Cheers,
> Ronny
>
>
>
>
> --
>
> Apache Member
> 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/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
--
Apache Member
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/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Cellar: sharing services
Posted by Ronny Bräunlich <r....@gmail.com>.
Hey guys,
I am sorry but I am not sure what my configuration is missing.
I never changed it so it looks like this:
groups = default
default.config.whitelist.inbound = *
default.config.whitelist.outbound = *
default.config.blacklist.inbound = org.apache.felix.fileinstall*, \
org.apache.karaf.cellar*, \
org.apache.karaf.management, \
org.apache.karaf.shell, \
org.ops4j.pax.logging, \
org.ops4j.pax.web
default.config.blacklist.outbound = org.apache.felix.fileinstall*, \
org.apache.karaf.cellar*, \
org.apache.karaf.management, \
org.apache.karaf.shell, \
org.ops4j.pax.logging, \
org.ops4j.pax.web
default.config.sync = true
default.feature.whitelist.inbound = *
default.feature.whitelist.outbound = *
default.feature.blacklist.inbound = config,management,hazelcast,cellar*
default.feature.blacklist.outbound = config,management,hazelcast,cellar*
default.feature.sync = true
default.feature.repositories.sync = true
default.bundle.whitelist.inbound = *
default.bundle.whitelist.outbound = *
default.bundle.blacklist.inbound = none
default.bundle.blacklist.outbound = none
default.bundle.sync = true
default.obr.urls.sync = true
default.obr.bundles.sync = true
Do I have to add something like "default.service.whitelist.inbound = *“ ?
Cheers,
Ronny
Am 11.12.2014 um 20:44 schrieb Jean-Baptiste Onofré <jb...@nanthrax.net>:
etc/org.apache.karaf.cellar.groups.cfg
On 12/11/2014 08:41 PM, Ronny Bräunlich wrote:
> Hi Achim,
>
> how did I blacklist the service? Or better, how do I whitelist it?
>
> Cheers,
> Ronny
>
> Am 11.12.2014 um 20:36 schrieb Achim Nierbeck <bcanhome@googlemail.com
> <ma...@googlemail.com>>:
>
> Hi Ronny,
> since you seemed to have blacklisted the service on the second node it's
> not being managed even though the configuration is available to the node
> because of configuration synchronization. Actually both nodes of the
> same group should be equivalent therefore the second node should have
> the same services running.
> If you want to have a distributed service you need to separate both
> nodes into different groups. With that running you're able to have one
> service only running on one node which is consumable from the other
>
> regards, Achim
>
>
>
> 2014-12-11 19:40 GMT+01:00 Ronny Bräunlich <r.braeunlich@gmail.com
> <ma...@gmail.com>>:
>
> Hi everyone,
>
> I have a general question about services in Cellar.
> I am running two instances and both are in the same group (default)
> and so synchronize their state.
> Both contain a bundle with a ManagedServiceFactory. The config file
> is in the etc directory of the first Karaf. All of the configuration
> arrives at the second Karaf, too.
> But the service the engine should created is only visible in the
> first Karaf. The second one doesn’t seem to bother.
> I am not sure about the behavior. Should both Karafs create the
> service or do they share the service or am I totally wrong? ;-)
>
> Cheers,
> Ronny
>
>
>
>
> --
>
> Apache Member
> 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/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Cellar: sharing services
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
etc/org.apache.karaf.cellar.groups.cfg
On 12/11/2014 08:41 PM, Ronny Bräunlich wrote:
> Hi Achim,
>
> how did I blacklist the service? Or better, how do I whitelist it?
>
> Cheers,
> Ronny
>
> Am 11.12.2014 um 20:36 schrieb Achim Nierbeck <bcanhome@googlemail.com
> <ma...@googlemail.com>>:
>
> Hi Ronny,
> since you seemed to have blacklisted the service on the second node it's
> not being managed even though the configuration is available to the node
> because of configuration synchronization. Actually both nodes of the
> same group should be equivalent therefore the second node should have
> the same services running.
> If you want to have a distributed service you need to separate both
> nodes into different groups. With that running you're able to have one
> service only running on one node which is consumable from the other
>
> regards, Achim
>
>
>
> 2014-12-11 19:40 GMT+01:00 Ronny Bräunlich <r.braeunlich@gmail.com
> <ma...@gmail.com>>:
>
> Hi everyone,
>
> I have a general question about services in Cellar.
> I am running two instances and both are in the same group (default)
> and so synchronize their state.
> Both contain a bundle with a ManagedServiceFactory. The config file
> is in the etc directory of the first Karaf. All of the configuration
> arrives at the second Karaf, too.
> But the service the engine should created is only visible in the
> first Karaf. The second one doesn’t seem to bother.
> I am not sure about the behavior. Should both Karafs create the
> service or do they share the service or am I totally wrong? ;-)
>
> Cheers,
> Ronny
>
>
>
>
> --
>
> Apache Member
> 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/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Cellar: sharing services
Posted by Ronny Bräunlich <r....@gmail.com>.
Hi Achim,
how did I blacklist the service? Or better, how do I whitelist it?
Cheers,
Ronny
Am 11.12.2014 um 20:36 schrieb Achim Nierbeck <bc...@googlemail.com>:
Hi Ronny,
since you seemed to have blacklisted the service on the second node it's not being managed even though the configuration is available to the node because of configuration synchronization. Actually both nodes of the same group should be equivalent therefore the second node should have the same services running.
If you want to have a distributed service you need to separate both nodes into different groups. With that running you're able to have one
service only running on one node which is consumable from the other
regards, Achim
2014-12-11 19:40 GMT+01:00 Ronny Bräunlich <r....@gmail.com>:
Hi everyone,
I have a general question about services in Cellar.
I am running two instances and both are in the same group (default) and so synchronize their state.
Both contain a bundle with a ManagedServiceFactory. The config file is in the etc directory of the first Karaf. All of the configuration arrives at the second Karaf, too.
But the service the engine should created is only visible in the first Karaf. The second one doesn’t seem to bother.
I am not sure about the behavior. Should both Karafs create the service or do they share the service or am I totally wrong? ;-)
Cheers,
Ronny
--
Apache Member
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/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Cellar: sharing services
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Ronny,
since you seemed to have blacklisted the service on the second node it's
not being managed even though the configuration is available to the node
because of configuration synchronization. Actually both nodes of the same
group should be equivalent therefore the second node should have the same
services running.
If you want to have a distributed service you need to separate both nodes
into different groups. With that running you're able to have one
service only running on one node which is consumable from the other
regards, Achim
2014-12-11 19:40 GMT+01:00 Ronny Bräunlich <r....@gmail.com>:
> Hi everyone,
>
> I have a general question about services in Cellar.
> I am running two instances and both are in the same group (default) and so
> synchronize their state.
> Both contain a bundle with a ManagedServiceFactory. The config file is in
> the etc directory of the first Karaf. All of the configuration arrives at
> the second Karaf, too.
> But the service the engine should created is only visible in the first
> Karaf. The second one doesn’t seem to bother.
> I am not sure about the behavior. Should both Karafs create the service or
> do they share the service or am I totally wrong? ;-)
>
> Cheers,
> Ronny
--
Apache Member
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/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Cellar: sharing services
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ronny,
The service should be local to each node: it's the responsability of the
bundles (so sync by Cellar as well).
Regards
JB
On 12/11/2014 07:40 PM, Ronny Bräunlich wrote:
> Hi everyone,
>
> I have a general question about services in Cellar.
> I am running two instances and both are in the same group (default) and so synchronize their state.
> Both contain a bundle with a ManagedServiceFactory. The config file is in the etc directory of the first Karaf. All of the configuration arrives at the second Karaf, too.
> But the service the engine should created is only visible in the first Karaf. The second one doesn’t seem to bother.
> I am not sure about the behavior. Should both Karafs create the service or do they share the service or am I totally wrong? ;-)
>
> Cheers,
> Ronny
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com