Quantcast

[Cellar] Load balancer setup

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Cellar] Load balancer setup

glopez
Hi,

I've been reading from the following places:
https://karaf.apache.org/manual/cellar/latest-4/
http://blog.nanthrax.net/2015/09/whats-new-in-apache-karaf-cellar-4-0-0/

I'm trying to make a 3 node cluster, 2 of the nodes (node1 and node2) having the webconsole feature installed locally and the other (node3) proxying to those nodes, this is what I did:

The steps I followed for node1 and node2 are the same (except for the install of cellar-http-balancer, done only on node1):
karaf@node1()> feature:install http
karaf@node1()> feature:install http-whiteboard
karaf@node1()> feature:repo-add cellar
karaf@node1()> feature:install cellar
karaf@node1()> cluster:feature-install default cellar-http-balancer (only node1)
karaf@node1()> feature:install webconsole

The steps I followed for node3:
karaf@node3()> feature:install http
karaf@node3()> feature:install http-whiteboard
karaf@node3()> feature:repo-add cellar
karaf@node3()> feature:install cellar

In node3 I got an error when registering node2's webconsole (node1 was registered first):
org.osgi.service.http.NamespaceException: alias: '/system/console' is already in use in this or another context

In node3:
karaf@node3()> cluster:http-list default
Alias               | Locations
------------------------------------------------------------------------------------------------------
/features           | http://192.168.1.56:8181/features http://192.168.1.52:8181/features
/system/console     | http://192.168.1.56:8181/system/console http://192.168.1.52:8181/system/console
/gogo               | http://192.168.1.56:8181/gogo http://192.168.1.52:8181/gogo
/system/console/res | http://192.168.1.56:8181/system/console/res
/instance           | http://192.168.1.56:8181/instance http://192.168.1.51:8181/instance

karaf@node3()> http:list
ID  | Servlet                    | Servlet-Name    | State       | Alias               | Url
----------------------------------------------------------------------------------------------------------------
105 | FeaturesPlugin             | ServletModel-20 | Failed      | /features           | [/features/*]
103 | CellarBalancerProxyServlet | ServletModel-10 | Failed      | /system/console     | [/system/console/*]
104 | KarafOsgiManager           | ServletModel-16 | Failed      | /system/console     | [/system/console/*]
103 | CellarBalancerProxyServlet | ServletModel-3  | Deployed    | /system/console     | [/system/console/*]
103 | CellarBalancerProxyServlet | ServletModel-2  | Undeployed  | /features           | [/features/*]
108 | InstancePlugin             | ServletModel-18 | Deployed    | /instance           | [/instance/*]
103 | CellarBalancerProxyServlet | ServletModel-7  | Failed      | /gogo               | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-12 | Deployed    | /gogo               | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-6  | Undeployed  | /instance           | [/instance/*]
103 | CellarBalancerProxyServlet | ServletModel-11 | Deployed    | /features           | [/features/*]
103 | CellarBalancerProxyServlet | ServletModel-5  | Deployed    | /system/console/res | [/system/console/res/*]
103 | CellarBalancerProxyServlet | ServletModel-9  | Failed      | /features           | [/features/*]
104 | KarafOsgiManager           | ServletModel-14 | Failed      | /system/console     | [/system/console/*]
106 | GogoPlugin                 | ServletModel-22 | Failed      | /gogo               | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-4  | Undeployed  | /gogo               | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-8  | Failed      | /instance           | [/instance/*]


So, if I go to:
node3:8181/system/console
And node1 is up it works correctly, if I stop node1 It fails because node2's stuff was not registered


What do I need to do so there is no conflict registering the features from node2?

Thanks






Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Hi,

It seems the Cellar proxy servlet didn't install correctly on node3.

Do you have anything in the log of node3 ?

Regards
JB

On 03/02/2017 04:09 PM, glopez wrote:

> Hi,
>
> I've been reading from the following places:
> https://karaf.apache.org/manual/cellar/latest-4/
> http://blog.nanthrax.net/2015/09/whats-new-in-apache-karaf-cellar-4-0-0/
>
> I'm trying to make a 3 node cluster, 2 of the nodes (node1 and node2) having
> the webconsole feature installed locally and the other (node3) proxying to
> those nodes, this is what I did:
>
> The steps I followed for node1 and node2 are the same (except for the
> install of cellar-http-balancer, done only on node1):
> karaf@node1()> feature:install http
> karaf@node1()> feature:install http-whiteboard
> karaf@node1()> feature:repo-add cellar
> karaf@node1()> feature:install cellar
> karaf@node1()> cluster:feature-install default cellar-http-balancer (only
> node1)
> karaf@node1()> feature:install webconsole
>
> The steps I followed for node3:
> karaf@node3()> feature:install http
> karaf@node3()> feature:install http-whiteboard
> karaf@node3()> feature:repo-add cellar
> karaf@node3()> feature:install cellar
>
> In node3 I got an error when registering node2's webconsole (node1 was
> registered first):
> org.osgi.service.http.NamespaceException: alias: '/system/console' is
> already in use in this or another context
>
> In node3:
> karaf@node3()> cluster:http-list default
> Alias               | Locations
> ------------------------------------------------------------------------------------------------------
> /features           | http://192.168.1.56:8181/features
> http://192.168.1.52:8181/features
> /system/console     | http://192.168.1.56:8181/system/console
> http://192.168.1.52:8181/system/console
> /gogo               | http://192.168.1.56:8181/gogo
> http://192.168.1.52:8181/gogo
> /system/console/res | http://192.168.1.56:8181/system/console/res
> /instance           | http://192.168.1.56:8181/instance
> http://192.168.1.51:8181/instance
>
> karaf@node3()> http:list
> ID  | Servlet                    | Servlet-Name    | State       | Alias
> | Url
> ----------------------------------------------------------------------------------------------------------------
> 105 | FeaturesPlugin             | ServletModel-20 | Failed      | /features
> | [/features/*]
> 103 | CellarBalancerProxyServlet | ServletModel-10 | Failed      |
> /system/console     | [/system/console/*]
> 104 | KarafOsgiManager           | ServletModel-16 | Failed      |
> /system/console     | [/system/console/*]
> 103 | CellarBalancerProxyServlet | ServletModel-3  | Deployed    |
> /system/console     | [/system/console/*]
> 103 | CellarBalancerProxyServlet | ServletModel-2  | Undeployed  | /features
> | [/features/*]
> 108 | InstancePlugin             | ServletModel-18 | Deployed    | /instance
> | [/instance/*]
> 103 | CellarBalancerProxyServlet | ServletModel-7  | Failed      | /gogo
> | [/gogo/*]
> 103 | CellarBalancerProxyServlet | ServletModel-12 | Deployed    | /gogo
> | [/gogo/*]
> 103 | CellarBalancerProxyServlet | ServletModel-6  | Undeployed  | /instance
> | [/instance/*]
> 103 | CellarBalancerProxyServlet | ServletModel-11 | Deployed    | /features
> | [/features/*]
> 103 | CellarBalancerProxyServlet | ServletModel-5  | Deployed    |
> /system/console/res | [/system/console/res/*]
> 103 | CellarBalancerProxyServlet | ServletModel-9  | Failed      | /features
> | [/features/*]
> 104 | KarafOsgiManager           | ServletModel-14 | Failed      |
> /system/console     | [/system/console/*]
> 106 | GogoPlugin                 | ServletModel-22 | Failed      | /gogo
> | [/gogo/*]
> 103 | CellarBalancerProxyServlet | ServletModel-4  | Undeployed  | /gogo
> | [/gogo/*]
> 103 | CellarBalancerProxyServlet | ServletModel-8  | Failed      | /instance
> | [/instance/*]
>
>
> So, if I go to:
> node3:8181/system/console
> And node1 is up it works correctly, if I stop node1 It fails because node2's
> stuff was not registered
>
>
> What do I need to do so there is no conflict registering the features from
> node2?
>
> Thanks
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

glopez
Here is the log:
karaf.log

The only errors I see are when trying to register and when I try to access /system/console and node1 is down. It is a clean install.

I could try setting log in DEBUG mode, not sure it would help at all though
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Thanks

let me try to reproduce.

Regards
JB

On 03/02/2017 06:09 PM, glopez wrote:

> Here is the log:
> karaf.log <http://karaf.922171.n3.nabble.com/file/n4049723/karaf.log>
>
> The only errors I see are when trying to register and when I try to access
> /system/console and node1 is down. It is a clean install.
>
> I could try setting log in DEBUG mode, not sure it would help at all though
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717p4049723.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

glopez
Ok, let me know if you need anything from me.

Thank you
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Sorry, I'm busy on Karaf Container fixes. I will resume my investigation
on your issue tomorrow.

Regards
JB

On 03/06/2017 01:08 PM, glopez wrote:

> Ok, let me know if you need anything from me.
>
> Thank you
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717p4049760.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

glopez
For what I understand it fails when trying to register the webconsole servlets for the second time (node1's were registered succesfully, node2 fails), the error is "alias already in use" .

To solve that I thought I could try registering node2 webconsole servlets (/gogo, /features, etc) with different alias, but then, reading ServerModel code, I realized that if I do that it will also fail throwing the error:

throw new ServletException("servlet already registered with a different alias");

I don't know what else to try, any idea?

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Hi,

Maybe your two nodes are in the same cluster group, and so, webconsole feature
is installed on the two nodes. As the context patch is already used, the Cellar
proxy servlet can't be registered.

Is that the case ?

Regards
JB

On 03/14/2017 02:50 AM, glopez wrote:

> For what I understand it fails when trying to register the webconsole
> servlets for the second time (node1's were registered succesfully, node2
> fails), the error is "alias already in use" .
>
> To solve that I thought I could try registering node2 webconsole servlets
> (/gogo, /features, etc) with different alias, but then, reading ServerModel
> code, I realized that if I do that it will also fail throwing the error:
>
> throw new ServletException("servlet already registered with a different
> alias");
>
> I don't know what else to try, any idea?
>
> Thanks
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717p4049843.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

glopez
Yes, thats the case.

I think I'm confused, what I'm trying to do is the following:

           load-balancer
                               
        node1          node2
       

Requests are made to load balancer:
load-balancer:8181/system/console

And then the requests are proxied to node1 or node2

And if one of the nodes (1 or 2) dies, all requests go to the other.

Do I need more then one cluster group to achieve that?
Do I need to install webconsole on the load-balancer?

I have tried with 1 group (default), did the following:

in the 3 nodes:
feature:install http
feature:install http-whiteboard
feature:repo-add cellar
feature:install cellar

Then, in one of the nodes I did:
cluster:feature-install default cellar-http-balancer

Finally I installed webconsole only on node1.

The problem there is that if node1 dies and I do load-balancer:8181/system/console I get a Connection timed out error.

How can I solve that?

Thank you for your time!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Let me explain a bit ;)

If node1 and node2 are in the same cluster group (let say "default"), and you do:

cluster:feature-install default webconsole

then, the webconsole will be installed on both node1 and node2.

So /system/console path will be on both node1 and node2. So, it's doesn't make
sense to proxy from  node1 to node2.

Let's take another scenario: you install a web application (let's say /foo) on
node1, node2, node3 (via cluster:feature-install group foo).

Then, you want to have node4 and node5 proxying and load balancing requests to
/foo. So, on node4 and node5, you don't install foo feature, you just install
http-balancer.

Back on your case, you should install webconsole only on node1 or node2 (using
feature:install on one node, instead of cluster:feature-install).

Agree ?

Regards
JB

On 03/14/2017 10:06 PM, glopez wrote:

> Yes, thats the case.
>
> I think I'm confused, what I'm trying to do is the following:
>
>   load-balancer
>
> node1          node2
>
>
> Requests are made to load balancer:
> load-balancer:8181/system/console
>
> And then the requests are proxied to node1 or node2
>
> And if one of the nodes (1 or 2) dies, all requests go to the other.
>
> Do I need more then one cluster group to achieve that?
> Do I need to install webconsole on the load-balancer?
>
> I have tried with 1 group (default), did the following:
>
> in the 3 nodes:
> feature:install http
> feature:install http-whiteboard
> feature:repo-add cellar
> feature:install cellar
>
> Then, in one of the nodes I did:
> cluster:feature-install default cellar-http-balancer
>
> Finally I installed webconsole only on node1.
>
> The problem there is that if node1 dies and I do
> load-balancer:8181/system/console I get a Connection timed out error.
>
> How can I solve that?
>
> Thank you for your time!
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717p4049847.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

glopez
Thanks for your reply and sorry to keep bothering :/

I think I understand what you say and I want to implement the scenario you described, in my case with 3 nodes instead of 5.

I want to proxy from the load-balancer node to node1 or node2.

So I guess in my case I should have node1 and node2 in a group (web), then, as you say:
cluster:feature-install web foo

Now I need to install http-balancer on the other node (load-balancer), here is where I'm not sure how to proceed.

Do I have to use a different cluster group (containing the 3 nodes) to install the cellar-http-balancer on the load-balancer node?

I have tried many ways and still didnt make it work :(
I've also tried to replicate some of the configuration mentioned in the README here:
https://github.com/oconnormi/karaf-cellar-examples/tree/master/cellar-failover-proxy

But still no success




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Cellar] Load balancer setup

jbonofre
Hi,

You are right for the cluster groups organization:
1. web cluster group to install the "web" application on node2 and node3. The
web cluster group contains only node2 and node3 (not node1).
2. balancer cluster group contains node1, node2, node3, and you only install the
cellar-http-balancer feature there (not your web application feature).

Regards
JB

On 03/17/2017 06:20 PM, glopez wrote:

> Thanks for your reply and sorry to keep bothering :/
>
> I think I understand what you say and I want to implement the scenario you
> described, in my case with 3 nodes instead of 5.
>
> I want to proxy from the load-balancer node to node1 or node2.
>
> So I guess in my case I should have node1 and node2 in a group (web), then,
> as you say:
> cluster:feature-install web foo
>
> Now I need to install http-balancer on the other node (load-balancer), here
> is where I'm not sure how to proceed.
>
> Do I have to use a different cluster group (containing the 3 nodes) to
> install the cellar-http-balancer on the load-balancer node?
>
> I have tried many ways and still didnt make it work :(
> I've also tried to replicate some of the configuration mentioned in the
> README here:
> https://github.com/oconnormi/karaf-cellar-examples/tree/master/cellar-failover-proxy
>
> But still no success
>
>
>
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cellar-Load-balancer-setup-tp4049717p4049876.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Loading...