cancel
Showing results for 
Search instead for 
Did you mean: 

recommended load balancer for all services, not just http

xarope
Champ in-the-making
Champ in-the-making
does anybody have any recommendations on how to do LB for a setup proper, including not just alfresco share, but also CIFS and IMAP?

I've already implemented, using the recommendations in the wiki for alfresco cluster setup, the simple cluster with two separate alfresco instances+solr, accessing a shared postgresql database and NFS file store, with Apache 2.2 on a separate server to do http load balancing to the alfresco tomcat instances.

However, apart from alfresco share, we would also like to use the IMAP service as well as CIFS access.  Is this something people have accomplished with Apache as well, or have you switched to nginx/varnish/some other hardware load balancer (although I would think that whatever a HW LB can do, should also be doable in software - after all, the HW LB is just running some embedded unix variant at the end of the day).
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
CIFS is not clusterable on 3.4.    It is supported on 4.0 but it requires the CIFS sessions to be "pinned" to a single server, and configuration of the shared hazelcast file state cache.

IMAP is probably O.K.

xarope
Champ in-the-making
Champ in-the-making
Thanks, appreciate the feedback.

For those interested, here's what I came up with for nginx load balancing for web and imap, with php5-fpm for nginx to be able to run the php script for imap auth.

Firstly, the nginx configuration for the alfresco site (I'm using ubuntu, so this sits in the file /etc/nginx/sites-enabled/alfresco).  I explicitly only allow access to /share and /alfresco:
upstream alfrescoTomcatInstances {
        ip_hash;
        server 10.0.0.1:8080;
        server 10.0.0.2:8080;
}
server {
        listen 80;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        root /usr/share/nginx/www;
        error_page 404 share;
        error_page 500 502 503 504 50x.html;
        location /50x.html {
                root 50x.html;
        }
        location /share {
                proxy_pass http://alfrescoTomcatInstances/share;
        }
        location /alfresco {
                proxy_pass http://alfrescoTomcatInstances/alfresco;
        }
        location ~\.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
}

Then enable the imap proxy in /etc/nginx/nginx.conf:
mail {
        auth_http localhost:80/mail/auth.php;
        imap_capabilities "IMAP4rev1" "UIDPLUS";
        server {
                listen     10.0.0.3:143; #or whatever ext IP you are listening on
                listen     localhost:143; #for local testing
                protocol   imap;
                proxy      on;
        }
}

And lastly, the simple auth.php found in /usr/share/nginx/www/, that I referred to in the nginx.conf file, which simplistically just redirects to the first server I have:
<?php
   header("Auth-Status: OK");
   header("Auth-Server: 10.0.0.1");
   header("AUth-Port: 143");
?>

I intend to make this a bit more load balanced by doing a simple hash against the userid and redirecting to one of the servers, but for now this serves for my testing purposes.

If I can figure out CIFS as well I'll update this post.  Thanks again.

xarope
Champ in-the-making
Champ in-the-making
FYI as an update, I ended up using HAProxy for the CIFS and IMAP backend, whilst staying with nginx for the web.

danielf
Champ in-the-making
Champ in-the-making
If you want enable sticky sessions, you could grab and install the nginx-sticky-module module and replace
<blockcode>ip_hash;</blockcode>
with
<blockcode>sticky;</blockcode>

Cheers!

D.