Common data, multiple web servers

schaef350

Joined: 2009-02-04
Posts: 7
Posted: Fri, 2009-08-07 19:19

I would like to use one common data store/database and multiple web servers. One server will have Gallery2 installed with Drupal CMS and the other will be just a Gallery2 install only. The first server will be internet facing while the Gallery only server will be internal to the company network. What are my options in doing this?

Thanks,

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-08-07 19:42
Quote:
[/What are my options in doing this?

None as far as Gallery is concerned. You'll need to solve that problem with hardware and/or clustering software.

You're going to run into all kinds of issues if you try sharing the same DB (with same tables) or g2data with different installs of Gallery.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
schaef350

Joined: 2009-02-04
Posts: 7
Posted: Fri, 2009-08-07 20:02

What kinds of information/ settings are tied directly to the install? Strings of hostnames, directories, etc.

g2data could be shared if its on a shared storage and mounted at the same place on each system.

I would agree in seeing a lot of issues coming up with trying to do this...

I have read about some rsync / database replication schemes used to sync two instances of the same gallery, not sure how successful they were when adding complexity of a CMS though...

Thanks!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-08-07 20:12
Quote:
What kinds of information/ settings are tied directly to the install? Strings of hostnames, directories, etc.

Depends on what you have setup. URL Rewrite I believe would get borked in this situation. That would take testing.

config.php stores g2data directory location and the URL of the site.

Read up on these to get a better feel for what it takes to move parts of Gallery around or even the entire install itself:
FAQ: How can I move my storage folder to another path?

FAQ: How can I move my gallery installation from one folder to another?

FAQ: How can I move my gallery installation from one server to another?

Quote:
I have read about some rsync / database replication schemes used to sync two instances of the same gallery, not sure how successful they were when adding complexity of a CMS though...

I don't either, nobody really posted back that I can recall. If one Gallery is setup to be "read-only" I think it could be done fairly easily. If you want people posting stuff to both installs, you're on your own. I'm not even going to spend 10 seconds thinking about that, my head will explode :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
schaef350

Joined: 2009-02-04
Posts: 7
Posted: Fri, 2009-08-07 20:23
Quote:
If one Gallery is setup to be "read-only" I think it could be done fairly easily.

That would actually work. The internet facing Gallery could (and maybe should) be read only...

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Sat, 2009-08-08 09:37

Here's another point of view.

Gallery2 runs with three main components: Apache/php + database + file-store.

It should be straightforward (ish) to run two Apache instances referring to the same filesystore + db combination, based on the fact that web accesses to consecutive pages maintain no state in the webserver; state is held only in the client (cookies), db, and cache files in the file-store. Your database and shared filesystem will deal with concurrency issues, just as they do for simultaneous accesses from two Apache threads at present. However this would effectively be the same Gallery installation, not two. You could not make one read-only. I don't think any special setup would be required to try this out.

I don't believe that you can run two filesystems from the same db (why would you want to?) nor two databases based on the same files. The synch between the g2data directory and the database is too strong. If you really need to run two g2 installations you'll need to look at synchronisation options, as you discussed.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sat, 2009-08-08 13:16

Thank you for explaining that so much better than I could.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
schaef350

Joined: 2009-02-04
Posts: 7
Posted: Mon, 2009-08-10 18:19

Ok, I see what your saying now... based on that I think I know how to make my setup work. (A bit different than I was first thinking but It will work)

Thanks,

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Mon, 2009-08-10 19:08

OK - I hope it works. I can't see any issues - but that doesn't mean there aren't any. Test it on a disposable installation first, and give it a good test via both webservers. And please post back with results.