MogileFs + Perlbal as Reproxy + Java Client
Oezcan Acar
acar at unitedinter.net
Tue May 1 09:20:39 UTC 2007
Hi Brad,
I recorded the Http Session and have the following result:
1. Response Header via Perlbal (user get this)
200 OK HTTP/1.0
headers(8)
Server: Resin/2.1.7
Vary: Accept-Encoding
Cache-Control: must-revalidate
Set-Cookie: JSESSIONID.....
Content-Type: image/gif
Date: 01 May.....
Connection: close
Content-Length: 1226
2. Response directly from resin
200 OK HTTP/1.1
headers(7)
Server: Resin/2.1.7
Vary: Accept-Encoding
Cache-Control: must-revalidate
X-REPROXY_URL: http://213.221.93.230:7500/dev1/0/000/000/0000000018.fid
Set-Cookie: JSESSIONID.....
Content-Type: image/gif
Date: 01 May.....
0000000018.fid is an .gif image.
Thank you for your help.
-------- Original-Nachricht --------
Datum: Tue, 1 May 2007 05:55:05 +0000 (UTC)
Von: Brad Fitzpatrick <brad at danga.com>
An: Oezcan Acar <acar at unitedinter.net>
CC: mogilefs at lists.danga.com
Betreff: Re: MogileFs + Perlbal as Reproxy + Java Client
> 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
> >
> >
--
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