|
From: Alvaro d. C. <ac...@ba...> - 2001-07-26 07:01:34
|
Hi! I think that currently is not possible to have 2 different web server with different names pulling the data from the same database. Maybe you can use other schemas to share the load between the servers, but the name for the web server has to be the same, I think. Good luck! -- Alvaro El d_ 25 Jul 2001 10:11:35 -0400, Martin, James S. escribi_ > Currently I have the Slash 2.0 database setup on a Linux box, and 2 Solaris > boxes trying to act as the web servers pulling the slash database. Let's > call the the first slash server slash1, and the other slash2. Well almost > all is fine and dandy. Slash1 connects and pulls data remotely with no > problem. I rsynched the /usr/local/slash dir to the second machine, made > the necessary configuration changes(I think) and setup the necessary perl > modules and it pulls the data--but all the links from the main page point > back to slash1. I know this has something to do with the absolutedir and > rootdir variables in the database, both of which are set to slash1's > hostname. How is it possible then to have to webservers sharing the same > database if they are pulling a static absolute and root dir from a database? > I'd like to be able to hit the database with either machine and each machine > processing it's on perl scripts. > > Thanks, > > James > > _______________________________________________ > Slashcode-general mailing list > Sla...@li... > http://lists.sourceforge.net/lists/listinfo/slashcode-general > |
|
From: Martin, J. S. <Jam...@di...> - 2001-07-26 13:16:24
|
The reason I bring this up is because if you haev 2 Web servers pointing to a database server and the Web Servers are sitting behind a Cisco Load Director (load balancing hardware). It seems as though it's almost an oversite in the code that the absoulte and relative dirs are hardcoded into the database. The absolute and root dirs should be generated by the perl scripts on the web server based on either a config file or generated by the "hostname" command. I've tried hardcoding the Utility.pm module to get this to work, as far as I can tell a constants hash is created with all the variables pulled from the vars table. I tried to modify the Utility.pm-- there is a subroutine called root2abs in which it retrieves the rootdir from the database and makes it into the relative dir--instead of it pulling it out of the DB I hardcoded it to the 2nd webserver and it still would not take. If I could just find where exactly that the code is pulling that information from the DB, I could hard code it on the 2nd machine so that it would work. Right now my crappy solution was to start the first server, modify the rootdir variable in the database to point to the 2nd server, and then start the 2nd server. It seems to work that way, but it's not favorable for obvious reasons. James -----Original Message----- From: Alvaro del Castillo [mailto:ac...@ba...] Sent: Thursday, July 26, 2001 5:00 AM To: sla...@li... Subject: Re: [Slashcode-general] Multiple Slash Servers El d_ 26 Jul 2001 10:47:57 +0300, Alessio Bragadini escribi_ > Alvaro del Castillo wrote: > > > I think that currently is not possible to have 2 different web server > > with different names pulling the data from the same database. Maybe you > > can use other schemas to share the load between the servers, but the > > name for the web server has to be the same, I think. > > Hhmmm... why not? In your DBIx::Password configuration, you could define > two different virtual users that uses the same connect string, username, > and password. As much as Slash is concerned, they are different > databases, but in fact they update the same tables. > > This could expose you to some race conditions because of the > symultaneous (spelling?!) access from two different engines, anyway - > but that's something that needs to be investigated in the code. Uhmm, yes, you are right. I haven't think about that. But you have the problemas that Martin has shown with the domain name, the cookie domain also ... Cheers -- Alvaro > -- > Alessio F. Bragadini al...@al... > APL Financial Services http://village.albourne.com > Nicosia, Cyprus phone: +357-2-755750 > > "It is more complicated than you think" > -- The Eighth Networking Truth from RFC 1925 > > _______________________________________________ > Slashcode-general mailing list > Sla...@li... > http://lists.sourceforge.net/lists/listinfo/slashcode-general > _______________________________________________ Slashcode-general mailing list Sla...@li... http://lists.sourceforge.net/lists/listinfo/slashcode-general |
|
From: Alessio B. <al...@al...> - 2001-07-26 13:40:35
|
"Martin, James S." wrote: > It seems as though it's almost an > oversite in the code that the absoulte and relative dirs are hardcoded into > the database. Well, two things: first, if the two servers are behind a load balancer hardware, it seems to me that this configuration should be kept hidden to the end user. As an example, if you have slash1.yourdomain.com and slash2.yourdomain.com as Slash balanced-servers, I, as a user, expect to access them as slash.yourdomain.com and leave the dirty work to the hardware/software. I don't want to see slash1 or slash2 in my URL since it annoys me, doesn't work well with caches, etc. So having slash.yourdomain.com in the db config seems ok to me, since it will be encoded in URLs sent back to the user, that therefore will show up again in front of the load balancer. If not, user will continue to work always on the same server, so you are just "balancing" the number of users that first access to the homepage, because from that point on URLs will have the name of a single server inside. What if a URL gets linked in some other site? What URL you print in your RSS feed file? On the other hand, relativedir can be relative, so I believe can just be '/' without the hostname. absolutedir is included in mail messages and RSS files, so it really is the main URL of your site. Unfortunately, 1.0.X was buggy in this respect and I don't know if all of them have been cleaned for 2.X. > I tried to modify the Utility.pm-- You really have to know where you put your hands... -- Alessio F. Bragadini al...@al... APL Financial Services http://village.albourne.com Nicosia, Cyprus phone: +357-2-755750 "It is more complicated than you think" -- The Eighth Networking Truth from RFC 1925 |
|
From: shane <sh...@lo...> - 2001-07-26 13:37:58
|
At 09:06 AM 7/26/2001 +0200, you wrote: >Hi! > >I think that currently is not possible to have 2 different web server >with different names pulling the data from the same database. Maybe you >can use other schemas to share the load between the servers, but the >name for the web server has to be the same, I think. > >Good luck! > >-- Alvaro > >El d_ 25 Jul 2001 10:11:35 -0400, Martin, James S. escribi_ > > Currently I have the Slash 2.0 database setup on a Linux box, and 2 Solaris > > boxes trying to act as the web servers pulling the slash database. Let's > > call the the first slash server slash1, and the other slash2. Well almost > > all is fine and dandy. Slash1 connects and pulls data remotely with no > > problem. I rsynched the /usr/local/slash dir to the second machine, made > > the necessary configuration changes(I think) and setup the necessary perl > > modules and it pulls the data--but all the links from the main page point > > back to slash1. I know this has something to do with the absolutedir and > > rootdir variables in the database, both of which are set to slash1's > > hostname. How is it possible then to have to webservers sharing the same > > database if they are pulling a static absolute and root dir from a > database? > > I'd like to be able to hit the database with either machine and each > machine > > processing it's on perl scripts. > > > > Thanks, > > > > James I missed the first part of this discussion, so excuse me if my assumptions are wrong... You have 3 boxes: sql1 www1 www2 Your db is on sql1. Your apache/mod_perl/slash install is on each box: www1, www2. Now, if you have www1 and www2 setup *identically* you should have no problems. What do I mean by identical? Same paths, same apache/mod_perl build, same slash_virutal_user. If slash isn't installed on www1 and www2 exactly the same, and the site on each isn't installed exactly the same (paths, user.owner user.group, etc) you will run into problems. Take a look at slashcode.com, and maybe even the FAQ on slashdot to see how they have arranged their multiple-server environment. Last I checked they have a 4th machine, serving NFS, that hosts the actual website and runs slashd. Each web machine mounts that share, and apache's config is set to use that share as the site's directory. Are you trying to setup for load balancing or redundancy with the two machines serving one site? We've been experimenting with this type of setup and LVS. We have our LVS primary/secondary machine going, and two simple apache boxes behind it. So far, so good. We have not go to the point yet where we have put 2 machines running the slash site behind the LVS yet. I hope we can get to it soon though. Shane |
|
From: <al...@ya...> - 2001-07-26 14:03:01
|
Let me ask a slightly different question suggested by the "multiple slash servers" discussion. I want to copy my existing slash site (<plug>http://news.DiverseBooks.com</plug>) to a development/backup version of the same site so that my colleague and I can try things out without messing up the existing site. If the hostname is hardcoded into the database then I can't just do a database copy onto a fresh slash installation - at least not without faking the hostname of the test machine to be the same as the production machine :-( Make sense? What do other people do? Alex ===== Alex McLintock al...@OW... Open Source Consultancy in London OpenWeb Analysts Ltd, http://www.OWAL.co.uk/ DR WHO COMPETITION: http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104 Get Your XML T-Shirt <t-shirt/> at http://www.inversity.co.uk/ ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie |
|
From: Alvaro d. C. <ac...@ba...> - 2001-07-26 14:12:09
|
El d_ 26 Jul 2001 15:03:01 +0100, Alex McLintock escribi_ > Let me ask a slightly different question suggested by the "multiple slash servers" > discussion. > > I want to copy my existing slash site (<plug>http://news.DiverseBooks.com</plug>) > to a development/backup version of the same site so that my colleague and I > can try things out without messing up the existing site. > > If the hostname is hardcoded into the database then I can't just do a database copy > onto a fresh slash installation - at least not without faking the hostname of > the test machine to be the same as the production machine :-( > > Make sense? What do other people do? I dump the database in a sql file and then replace there the name of the hostname1 with hostname2. The you can use this data to create the development system. And if you want also to have the static pages, you need to change the writestatus to the stories so they are generated by slashd. But in slashcode 2.0 it seems the static pages are disabled so you don't have to do it. Cheers -- Alvaro > > Alex > > > ===== > Alex McLintock al...@OW... Open Source Consultancy in London > OpenWeb Analysts Ltd, http://www.OWAL.co.uk/ > DR WHO COMPETITION: http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104 > Get Your XML T-Shirt <t-shirt/> at http://www.inversity.co.uk/ > > ____________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie > > _______________________________________________ > Slashcode-general mailing list > Sla...@li... > http://lists.sourceforge.net/lists/listinfo/slashcode-general > |