Load Balancing in UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Load Balancing in UNIX
# 1  
Old 02-21-2017
Load Balancing in UNIX

Dear All,
Can any one help me for this request?

There is a case. I have 20 files which I need to FTP to 5 servers. I want to know if there is any possibility to make a load balancer which transfers files in round robin manner to 5 servers.

As per theoretical algorithm, what I think, flow can be like:
There are 20 files from aaa to ttt and servers are from 1.1.1.1 till 5.5.5.5.
I will write a code which will check number of files presence in a folder. Then will start picking files and transferring these to servers one by one.
Will start from file1 to server1 till file5 to server5 and
file6 to server1 again and so on.

I am using Solaris. Can anyone help how to achieve it?

Last edited by rbatte1; 02-22-2017 at 07:11 AM.. Reason: Converted CODE tags to ICODE tags
# 2  
Old 02-21-2017
GNU Parallel
- GNU Project - Free Software Foundation


Download parallel. It does exactly what you want. We had it on Solaris 10, worked fine. Note that there is a version for Solaris on the website.
# 3  
Old 02-23-2017
Quote:
Originally Posted by jim mcnamara
GNU Parallel
- GNU Project - Free Software Foundation


Download parallel. It does exactly what you want. We had it on Solaris 10, worked fine. Note that there is a version for Solaris on the website.
Thanks. I will check by keeping it aside. However, on live servers, we can't install any utility or patch for this.
So, I am trying to get idea to develop a script for this.

---------- Post updated 02-23-17 at 04:55 PM ---------- Previous update was 02-22-17 at 11:15 PM ----------

Any help on this please?
# 4  
Old 02-23-2017
Might I suggest an approach like this then:-
  • List your filenames into a work file
  • Split the list into 5 smaller job input files with split for the appropriate number of rows or if you can sort them by size, round-robin split them into 5 job input files
  • Initiate a job for each job input file in the background
  • Wait. Not a joke, but use the wait command to pause your script until all the transfers complete
  • Check the logs from your background jobs, should you wish to do so
  • End.


Does that structure help? If it does, have a go and let us know how far you get. Please share a working solution if you can so others finding this thread may learn from it.

If you get stuck, show us what you have so far and we will try to suggest options.



Kind regards,
Robin
# 5  
Old 02-27-2017
Thanks rbatte1.
I got your idea.
I have placed file in one directory, listed and got output in a file.
Splitting done and now I have 3 files.

Unable to find a suitable way to create separate jobs.
one possibility is to create a sub-script for each file and then start it in background by using ampersand sign.
Is it a good approach?
# 6  
Old 02-27-2017
Do you want to transfer each file once i.e. to one random server, or many times i.e. to each server?
# 7  
Old 02-28-2017
Quote:
Originally Posted by MadeInGermany
Do you want to transfer each file once i.e. to one random server, or many times i.e. to each server?
My idea is to transfer multiple files to multiple servers. Let's say 20 files to 5 servers.
I want to start transfer in parallel to multiple hosts and once first 5 files are uploaded to all 5 servers then next chunk onwards. Hope you are getting my point.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Load balancing in Autosys

Hi, I am working on development project where I have to migrate many jobs from Tidal to Autosys R11. During this project we came across the following requirements. 1. There are 3 real machines. There could be many jobs activated simultaneously, but only one job should execute at a time and... (0 Replies)
Discussion started by: sujeetp
0 Replies

2. UNIX for Advanced & Expert Users

Help in MQ load balancing

Hi, Currently we have 3 old and 3 new servers catering to Live traffic. As my component move from legacy interfaces to MQ one, we want to have load balancing of old interfaces available on MQ interface as well. For this, we want to send only 30% of all MQ traffic on 3 OLD Live servers, and want... (1 Reply)
Discussion started by: senkerth
1 Replies

3. IP Networking

Load Balancing ppp

Hello everybody How can i Load Balance two slow ppp(gprs) connections with iptables . (4 Replies)
Discussion started by: rink
4 Replies

4. Linux

HTTP load balancing.

Hi, We have 2 pools of servers. Lets call them A and B and they would contain 2 servers each. Pool A will be hosting www.example.com/app/v1 and pool B will be hosting www.example.com/app/v2. Clients will be requesting right url (/v1 or /v2) but will be hitting just one IP. I'd like to: 1)... (3 Replies)
Discussion started by: chrisfb
3 Replies

5. UNIX for Advanced & Expert Users

High availability/Load balancing

Hi folks, (Sorry I don't know what its technology is termed exactly. High Availability OR load balancing) What I'm going to explore is as follows:- For example, on Physical Servers; Server-1 - LAMP, a working server Server-2 - LAMP, for redundancy While Server-1 is working all... (3 Replies)
Discussion started by: satimis
3 Replies

6. Web Development

Load Balancing in Apache

Hi All, I have one webserver which has an application for a set of internal users can be accessed by _http://server1.com I am planning to load balance this application. For that I have cloned this server and build a new one which can be accessed using _http://server2.com]Server2.com. Also i... (2 Replies)
Discussion started by: Tuxidow
2 Replies

7. Solaris

Load balancing with IPMP

Is it possible to do a load balancing ( incoming and outgoing )with with IPMP in solaris 10 like sun trunking ? If yes what are the steps involved in it , i know how to do the failover IPMP both link based and probe based but i 'm looking for possible load balancing (3 Replies)
Discussion started by: fugitive
3 Replies

8. Ubuntu

perlbal and load balancing

Hi guys, I wonder if someone would be able to assist with my problem. I have just set up a load balancer for a company I am working for. HTTP redirection is working fine, however they also want to load balance SSH and FTP too. At the moment the perlbal config looks like; CREATE POOL webhttp ... (1 Reply)
Discussion started by: JayC89
1 Replies

9. AIX

idea on hacmp load balancing

Hi All, Any idea about load balancing on hacmp? Or load balancing is only on lpar. Any idea or link info will do. Thanks in advance. (2 Replies)
Discussion started by: itik
2 Replies

10. UNIX for Dummies Questions & Answers

Question about load balancing

If you have two or more servers load balancing, are the servers mirroring one another? If images, etc., are uploaded, will they be stored on all the servers so that if one server goes down, the images will be served up by another server? (1 Reply)
Discussion started by: wvmlt
1 Replies
Login or Register to Ask a Question