Contest Opens- June 09, 2015 - 04:30 PM IST
Contest Closes- August 15, 2015 - 06:00 PM IST |
We bring to you a unique contest "geeksScript Kiddie" wherein you will be given a question and you need to write a script for it. Solve it and mail us your script at- [email protected].
We will review & short-list the top 3 scripts and winners will be declared on the geeksScript facebook page. Make sure you like the page, so that we can tag you during results. Get ready and solve the question! :) |
geeksScript Kiddie Question- 3 [Shell Script]
Guidelines:
1. Use latest version of Ubuntu.
2. It must have proper error-handling.
Tasks:
Please create a command-line script, preferably in bash, to perform web-server load-balancing:
1. Your script should ask for total number of machines and their respective IP address
2. Script should ask for common username/password to login on those machines
3. Script should install HTTP web-server, either Apache or Nginx on all those machines using sudo apt-get
4. Script should modify the web-server’s default index file, mentioning the web-server’s ID and it’s IP address.
For eg. ID- Web-Server 01 | IP- 192.168.x.x
5. Perform web-server load-balancing such as that if any machine goes down or serving max 5 HTTP connections/sec, load-balancer should pass on the HTTP traffic to next available machine. You may use HA-Proxy as load-balancer.
For eg. If web-server 01 is down or serving 5 max connections/sec, traffic should be passed on to web-server 02 and likewise.
5. Script should do the necessary configuration on the load-balancer / machines(if any).
Note:
1. Purpose of above tasks is just to test your shell-scripting skills. So feel free to make assumption if needed. Make sure you mention all assumptions as comments in your shell-script file.
2. To test the script, HTTP requests will be passed on to load-balancer’s IP on port 80. The connections will look like-
Client —> Load-Balancer —> Web-server(s)
3. There can be any number of machines. Your script should do the necessary configuration accordingly.
4. After you're done, mail us your script at- [email protected].
1. Use latest version of Ubuntu.
2. It must have proper error-handling.
Tasks:
Please create a command-line script, preferably in bash, to perform web-server load-balancing:
1. Your script should ask for total number of machines and their respective IP address
2. Script should ask for common username/password to login on those machines
3. Script should install HTTP web-server, either Apache or Nginx on all those machines using sudo apt-get
4. Script should modify the web-server’s default index file, mentioning the web-server’s ID and it’s IP address.
For eg. ID- Web-Server 01 | IP- 192.168.x.x
5. Perform web-server load-balancing such as that if any machine goes down or serving max 5 HTTP connections/sec, load-balancer should pass on the HTTP traffic to next available machine. You may use HA-Proxy as load-balancer.
For eg. If web-server 01 is down or serving 5 max connections/sec, traffic should be passed on to web-server 02 and likewise.
5. Script should do the necessary configuration on the load-balancer / machines(if any).
Note:
1. Purpose of above tasks is just to test your shell-scripting skills. So feel free to make assumption if needed. Make sure you mention all assumptions as comments in your shell-script file.
2. To test the script, HTTP requests will be passed on to load-balancer’s IP on port 80. The connections will look like-
Client —> Load-Balancer —> Web-server(s)
3. There can be any number of machines. Your script should do the necessary configuration accordingly.
4. After you're done, mail us your script at- [email protected].