I guess I can do something like this:
<VirtualHost 192.168.1.101:443> RewriteEngine on ProxyRequests off ProxyPreserveHost on SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem DocumentRoot /var/www/ssl ProxyPass /seaside/go balancer://seaside_cluster stickysession=MYCOOKIE nofailover=on ProxyPassReverse /seaside/go balancer://seaside_cluster <Proxy balancer://seaside_cluster> BalancerMember http://localhost:9090/seaside/go route=A_ BalancerMember http://localhost:9091/seaside/go route=B_ BalancerMember http://localhost:9092/seaside/go route=C_ </Proxy> RewriteRule ^/$ balancer://seaside_cluster [P,L] </VirtualHost> Apparently, the format of the cookie name is something like 'somename.someroute'. I think in the above example, somename would be MYCOOKIE and someroute would be A_ or B_ or C_. Am I understanding correctly? But do I need to setup cookies in Seaside? If so, do I need to setup the cookie name format, as well? If so, how? Thanks, Richard -------- How do you ensure session affinity? It looks like you are using a round-robin strategy. I guess this is what Apache does by default. You have to ensure that only the first request goes to a random image, subsequent requests should go to the same image. Lukas _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
Did you indicate to balancer how to determine sticky sessions? I think there's a setting for it. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
> The succession of port numbers (9092/9091, 9091/9090, 9090/9092, 9092/9091,
> 9091/9090) suggests that the sessions are not sticky. The load balancer is > cycling through my VMs. But I'm the only user! I should only have one > session. How do you ensure session affinity? It looks like you are using a round-robin strategy. I guess this is what Apache does by default. You have to ensure that only the first request goes to a random image, subsequent requests should go to the same image. Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
You could add route identifying cookie to each app, say its hostname plus port number although I recall seeing solutions to use mod balancer without modding existing apps with mod_headers, google some. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
But isn't imageName1 the same as imageName2 ? In other words, imageName is a
constant, in my case, "GoodSexNetwork", since 'SmalltalkImage current imageName' returns '/home/richard/seaside/GoodSexNetwork.image'. I think the cookie needs to be made unique with, say, the port number. How do you obtain the port number in Seaside? Thanks, Richard ------ Ramon wrote: Have Seaside write out the image name in a cookie as the last step in your initial request (making sure to grab any state you need first). initialRequest: aRequest self parseAnyNeededParams: aRequest. (self session currentRequest cookieAt: #server) ifNil: [self session redirectWithCookie: (WACookie key: #server value: 'seaside.', ((SmalltalkImage current imageName copyAfterLast: FileDirectory slash asCharacter) copyUpToLast: $.))]. And configure your cluster with the route=imageName <Proxy balancer://seaside_cluster> BalancerMember http://localhost:3001/seaside route=imageName1 BalancerMember http://localhost:3002/seaside route=imageName2 </Proxy> _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
> I guess I can do something like this:
> > <VirtualHost 192.168.1.101:443> > RewriteEngine on > ProxyRequests off > ProxyPreserveHost on > SSLEngine on > SSLCertificateFile /etc/apache2/ssl/apache.pem > DocumentRoot /var/www/ssl > ProxyPass /seaside/go balancer://seaside_cluster > stickysession=MYCOOKIE nofailover=on > ProxyPassReverse /seaside/go balancer://seaside_cluster > <Proxy balancer://seaside_cluster> > BalancerMember http://localhost:9090/seaside/go route=A_ > BalancerMember http://localhost:9091/seaside/go route=B_ > BalancerMember http://localhost:9092/seaside/go > route=C_ </Proxy> RewriteRule ^/$ > balancer://seaside_cluster [P,L] </VirtualHost> > > > Apparently, the format of the cookie name is something like > 'somename.someroute'. I think in the above example, somename > would be MYCOOKIE and someroute would be A_ or B_ or C_. Am I > understanding correctly? > > But do I need to setup cookies in Seaside? If so, do I need > to setup the cookie name format, as well? If so, how? > > Thanks, > Richard Have Seaside write out the image name in a cookie as the last step in your initial request (making sure to grab any state you need first). initialRequest: aRequest self parseAnyNeededParams: aRequest. (self session currentRequest cookieAt: #server) ifNil: [self session redirectWithCookie: (WACookie key: #server value: 'seaside.', ((SmalltalkImage current imageName copyAfterLast: FileDirectory slash asCharacter) copyUpToLast: $.))]. And configure your cluster with the route=imageName <Proxy balancer://seaside_cluster> BalancerMember http://localhost:3001/seaside route=imageName1 BalancerMember http://localhost:3002/seaside route=imageName2 </Proxy> ProxyPass /seaside/files balancer://seaside_cluster/files lbmethod=byrequests stickysession=server ProxyPass / balancer://seaside_cluster/ lbmethod=byrequests stickysession=server ProxyPassReverse / balancer://seaside_cluster/ Tell Apache what the cookie name is and it will have what it needs to parse the cookie and route to the correct image. I couldn't get this working last time I tried but I was missing the information about the "." Apache was expecting in the cookie, I chose HAProxy instead. Now that this works, I might have to switch back to Apache for load balancing, very nice! Found what I needed in http://www.markround.com/archives/33-Apache-mod_proxy-balancing-with-PHP-sti cky-sessions.html Ramon Leon http://onsmalltalk.com _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
You'd need to ask your webserver, for instance Swazoo,
SwazooServer singleton servers collect: [:ea | ea port] Set (7777) Cheers, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 http://tinyurl.com/r7uw4 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. > -----Original Message----- > From: [hidden email] [mailto:seaside- > [hidden email]] On Behalf Of Richard Eng > Sent: Tuesday, November 06, 2007 9:13 AM > To: Seaside - general discussion > Subject: Re: [Seaside] ProxyPass and the P Option > > But isn't imageName1 the same as imageName2 ? In other words, imageName is > a > constant, in my case, "GoodSexNetwork", since 'SmalltalkImage current > imageName' returns '/home/richard/seaside/GoodSexNetwork.image'. > > I think the cookie needs to be made unique with, say, the port number. How > do you obtain the port number in Seaside? > > Thanks, > Richard > > ------ > Ramon wrote: > > Have Seaside write out the image name in a cookie as the last step in your > initial request (making sure to grab any state you need first). > > initialRequest: aRequest > self parseAnyNeededParams: aRequest. > > (self session currentRequest cookieAt: #server) > ifNil: [self session redirectWithCookie: > (WACookie > key: #server > value: 'seaside.', > ((SmalltalkImage current imageName copyAfterLast: > FileDirectory slash asCharacter) copyUpToLast: > $.))]. > > And configure your cluster with the route=imageName > > <Proxy balancer://seaside_cluster> > BalancerMember http://localhost:3001/seaside route=imageName1 > BalancerMember http://localhost:3002/seaside route=imageName2 > </Proxy> > > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
> But isn't imageName1 the same as imageName2 ? In other words,
> imageName is a constant, in my case, "GoodSexNetwork", since > 'SmalltalkImage current imageName' returns > '/home/richard/seaside/GoodSexNetwork.image'. > > I think the cookie needs to be made unique with, say, the > port number. How do you obtain the port number in Seaside? > > Thanks, > Richard Depends on how you start multiple images, multiple copies of the same image with a switch to ignore the lock on the changes file or just launch multiple images which are all copies of a master each with their own changes file. I was lazy and chose the latter because it was easier to just create a few copies and launch them all manually in windows when testing this. You could use anything unique, the port I guess would do it as well. If you're only running one server, this will get what you want.. ((HttpService allInstances select: [:each | each isRunning]) collect:[:each | each portNumber]) first Ramon Leon http://onsmalltalk.com _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
Re: #cookieAt:
There is no such message in Seaside 2.7/Squeak 3.9. Is this new to Seaside 2.8 ? I'm having difficulty locating any similar cookie-related messages for 'self session currentRequest'. Thanks, Richard ------ Ramon wrote: (self session currentRequest cookieAt: #server) ifNil: [self session redirectWithCookie: (WACookie key: #server value: 'seaside.', _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> Re: #cookieAt:
> > There is no such message in Seaside 2.7/Squeak 3.9. Is this > new to Seaside > 2.8 ? > > I'm having difficulty locating any similar cookie-related > messages for 'self session currentRequest'. > > Thanks, > Richard self session currentRequest cookies at: #server in 2.7, #cookieAt: is just a shortcut. Just look at the WARequest class, you'll see what's available. Ramon Leon http://onsmalltalk.com _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
Instead of
self session currentRequest cookies at: #server I had to do self session currentRequest cookies at: #server ifAbsent: because #at: throws a ³key not found² exception. Thank you very much, Ramon! You rock! My web app is essentially complete now. Our website is SSL-secured. My app is load-balanced. Once I work out some streaming video issues, I'll be able to deploy our 1U rack server (to be colocated at a host provider). Then we can start our beta test program in the New Year. With any luck, our website will go live next summer. I started this Seaside project in June and within one year I expect to go live. *One year!!* Let's see a Java/Struts or PHP or C#/ASP.NET developer accomplish that! Regards, Richard _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
That would of course depend on what the application actually does, I bet one could deploy /counter application rather quickly ;)
-Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 http://tinyurl.com/r7uw4 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. > -----Original Message----- > From: [hidden email] [mailto:seaside- > [hidden email]] On Behalf Of Richard Eng > Sent: Tuesday, November 06, 2007 3:58 PM > To: Seaside - general discussion > Subject: Re: [Seaside] ProxyPass and the P Option > > Instead of > > self session currentRequest cookies at: #server > > I had to do > > self session currentRequest cookies at: #server ifAbsent: > > because #at: throws a ³key not found² exception. > > > Thank you very much, Ramon! You rock! > > My web app is essentially complete now. Our website is SSL-secured. My app > is load-balanced. Once I work out some streaming video issues, I'll be > able > to deploy our 1U rack server (to be colocated at a host provider). > > Then we can start our beta test program in the New Year. With any luck, > our > website will go live next summer. I started this Seaside project in June > and > within one year I expect to go live. *One year!!* Let's see a Java/Struts > or > PHP or C#/ASP.NET developer accomplish that! > > Regards, > Richard > > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
> Thank you very much, Ramon! You rock!
> > My web app is essentially complete now. Our website is > SSL-secured. My app is load-balanced. Once I work out some > streaming video issues, I'll be able to deploy our 1U rack > server (to be colocated at a host provider). > > Then we can start our beta test program in the New Year. With > any luck, our website will go live next summer. I started > this Seaside project in June and within one year I expect to > go live. *One year!!* Let's see a Java/Struts or PHP or > C#/ASP.NET developer accomplish that! > > Regards, > Richard No problem and congratulations, once you launch be sure to let Lukas know and get yourself listed on the seaside.st/users page. If you have the time, start a blog and write about your experiences so others can learn more about Seaside. Ramon Leon http://onsmalltalk.com _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Richard Eng
http://open-sourcerer.blogspot.com/
Hey, it's a start. Richard -------- > Thank you very much, Ramon! You rock! > > My web app is essentially complete now. Our website is > SSL-secured. My app is load-balanced. Once I work out some > streaming video issues, I'll be able to deploy our 1U rack > server (to be colocated at a host provider). > > Then we can start our beta test program in the New Year. With > any luck, our website will go live next summer. I started > this Seaside project in June and within one year I expect to > go live. *One year!!* Let's see a Java/Struts or PHP or > C#/ASP.NET developer accomplish that! > > Regards, > Richard No problem and congratulations, once you launch be sure to let Lukas know and get yourself listed on the seaside.st/users page. If you have the time, start a blog and write about your experiences so others can learn more about Seaside. Ramon Leon _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> -----Original Message-----
> From: [hidden email] > [mailto:[hidden email]] On Behalf > Of Richard Eng > Sent: Friday, November 09, 2007 7:16 AM > To: Seaside - general discussion > Subject: Re: [Seaside] ProxyPass and the P Option > > http://open-sourcerer.blogspot.com/ > > Hey, it's a start. > > Richard Awesome, I just subscribed to you feed, I hope you keep it up. Retired already... I'm jealous! Ramon Leon http://onsmalltalk.com _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |