MogileFs + Perlbal as Reproxy + Java Client

Brad Fitzpatrick brad at danga.com
Tue May 1 05:55:05 UTC 2007


What's the raw HTTP response headers you see from both Resin (directly,
not via Perlbal), and from Perlbal (as a user would see it)?

Looking at those should illustrate exactly what's going wrong, but if it's
not clear, post it here and we can help.

- Brad


On Tue, 1 May 2007, Oezcan Acar wrote:

> Hi,
>
> I use perlbal (latest version) in front of my resin webserver as reproxy server to serve the images out of mogilefs and mogilefs java client from guba.
>
> To serve an an image, which is stored in mogilefs the following way applies:
>
> Client --> Perbal --reproxy---> resin (getfile.jsp).
>
> eg: http://www.domain.com/getfile.jsp?key=amazon
>
> domain.com is perlbal instance, getfile.jsp resides on backend resin instance. In getfile.jsp I use the java mogilefs client to get the image location.
>
> I use the following code in getfile.jsp to get the image with the key amazon
>
>
>
> <%
> String[] tracker = new String[1];
> tracker[0] = "213.221.93.230:6001";
> com.guba.mogilefs.MogileFS fs = new com.guba.mogilefs.MogileFS("testdomain", tracker, true);
> String[] paths = fs.getPaths(request.getParameter("k"), true);
> response.setHeader("Cache-Control", "must-revalidate");
> response.setHeader("Content-type",  "image/jpeg");
> response.setHeader("X-REPROXY-URL", (String)paths[0]);
> return;
> %>
>
> The image location is returned in paths. With X_REPROXY_URL the image location is passed back to perlbal but with the code above the image is never displayed in the client browser. What is wrong here?
>
> My perlbal config:
>
> image1:/home/bizimalem # cat /etc/perlbal.conf
> CREATE POOL webcluster
>   POOL webcluster ADD 213.221.93.230:8080
>
> CREATE SERVICE balancer
>    SET listen          = 213.221.93.198:80
>    SET role            = reverse_proxy
>    SET enable_reproxy  = true
>    SET pool            = webcluster
>    SET persist_client  = on
>    SET persist_backend = on
>    SET verify_backend  = off
> ENABLE balancer
>
> CREATE SERVICE mgmt
>   SET role   = management
>   SET listen = 213.221.93.198:60000
> ENABLE mgmt
>
>
>
> Thank you for your help.
>
>
> --
> Mit freundlichen Grüßen
>
> ___________________________
>
> Özcan Acar, Dipl. Inf(FH)
> Vorstand
> Smart Web Business AG
>
> Im Niederfeld 8
> 65462 Gustavsburg
>
> +49 171 57 33 66 5
> acar at unitedinter.net
>
>
> --
> Mit freundlichen Grüßen
>
> ___________________________
>
> Özcan Acar, Dipl. Inf(FH)
> Vorstand
> Smart Web Business AG
>
> Im Niederfeld 8
> 65462 Gustavsburg
>
> +49 171 57 33 66 5
> acar at unitedinter.net
>
>


More information about the mogilefs mailing list