• Post Reply Bookmark Topic Watch Topic
  • New Topic

Building Distributed App DB Image Server  RSS feed

 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Is there any chance one of you might point me in the right direction to building a small distributed server farm? What I'm after, like the subject implies, is a server dedicated to delivering dynamic content, one server to deliver images and one to deliver the DB all tied together neat and tidy.

Oh, and I would like them to be Linux OS.

Thanks in advance!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "talkingstone" and welcome to the JavaRanch!

May I point you to our naming policy and to the place where you can edit your display name to comply with that policy...

Thanks.
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, my profile has been updated
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The naming policy may be unclear on this, but you need a first name AND last name.
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, my profile has been updated
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I asked this question in the wrong list

Thanks for straightening me out on my profile name.
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no sure exactly what you asking for. Do you want a load balancing server farm systems for web servers? Or you want a server farm for your database. There are many articles on building linux server farm. check out this one: Core Linux Server Farm or this one: Linux Virtual Server
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Adrian.

Basically, I'm looking at creating an AppServer A such that it would pull images from Server B and access MySQL Database from Server C. Does that make sense?

My thought process lies with an evergrowing imagebank, heavily utilized DB and a farm of Tomcat webapps.

Thanks once again for your thoughts!

P.S. I would like to migrate the DB to RAID 5 as well.
 
Tim Holloway
Saloon Keeper
Posts: 18792
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use of RAID is done as part of your hardware/OS configuration. If you have RAID 5 and you install your database files on it, there's nothing more to do - RAID is transparent to apps.

A webapp that servers pictures and outsources data access is hardly a "farm". You simply put Apache on the image server and set the web page URLs to explicitly reference that server instead of doing URLS with implicit (relative) paths.

Likewise for JDBC. The database server address is part of its JDBC URL.
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its nice that you hit all the easy canned responses first. I do undertand RAID, its configuration and use and have a hardware controller rather than logical.

Regarding the farm comment, I'll just take that as a jab. ;-).

My whole issue is that I want the images to appear to be referenced from the same url eventhough the exist on a seperate IP internally.

I definately know that I'm missing something fairly simple in Apache config 101. What is it?

BTW, I'm using JK2 to tie the webapps to Apache.
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... I think I understand what you are saying regarding the images stuff. Have you check out virutal server configuration? I think that's what you want. As far as your database, user would never see the the connection link anyway, so what exactly is causing you problem?Hope it helps.
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats exactly the nugget of info I need. The DB only plays a part in that it is a seperate IP from the Tomcat/Apache Setup and I'll need to look into connecting the app Server and DB Server privatly.

Here's what I need to do in servlet container -> server.xml
define DB Resource whatever it may be and set the url param to point to a local private server with custom point
example: jdbc:mysql://some.where.yourdomain.com:####/db

Regarding the Image Server, if I understand you correctly, I need to setup a virtual server with port forwarding maybe? Can you give a few more details?
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what your DB side problem can be, because you database library should be able to handle database on a different server.
as far as your image thing, the more I read and think about it. It seems there are three possible solutions for you.
1) URL Rewrite using apache, I tried once before, it's extremely powerful, but difficult to understand. I did some very simple but the best solution to resolve the issue
2) URL Proxy, I think this is your one of best bet. check out the document on apache site: Proxy
3) This is hte easiest in my opinion. Mount your remote server onto your local drive. You can use NFS or SAMBA to do drive mapping, making those image files to look like local files.
Some of the stuff might be confusing, cause it takes alot of trial and error to get them to work. The best way is KISS (Keep It Simple Stupid) .
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advice. I agree that the KISS principle applies. Ultimatly the intent is to have a rack containing image servers which I think lends itself to #2 and the proxy suggestion.

Have a great day!
 
Tim Holloway
Saloon Keeper
Posts: 18792
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Play nice, now! We're only trying to help.

I'd have voted for mod_rewrite if I'd caught the requirement for all having the same hostname on the URL - proxying it goos, too - though I cordially invite you to use the "Page Info" command on your web browser while pointed to a major website (like JavaRanch) if you think that there's some inherent virtue in having all the page components appear on one host - or even one domain. Akamai, for one, would be happy to suggest otherwise.

On the JDBC connection, you should consult the Tomcat docs on JDBC resource definition. You can define database resource definitions as WAR xml files as well as in server.xml. Not only is it possible to have each webapp using its own database, thanks to the magic of JNDI resource lookups and database connection factories, you can have a single webapp connect to multiple databases.
 
dave nelson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tim,

I thought for sure we were all playing nice. :roll: I have seen the mod_rewrite utility you mention and will have a look. It's fairly well documented.

I just wanted a bit of a nudge when I wire this new system together. With funding the way it is (translates to $0), my dev system will migrate to production directly so I need to get it right the first time.

I understand your point that having many sources serving content seems to be a norm these days. I'm just trying to minimise maintenance for site stats and minimize how much backend config is revealed to user.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!