Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I run a website, and i recently bought two extra machines and installed linux on them (same hardware). My original machine was a standard desktop, with Debian and NGINX installed on it. I bought 2 raspberry pi's and i am using identical images (archlinux with nginx, identical configuration to main machine) for both of them. Everything was working fine before, but when i added the raspberry pi's to the network, and set port fowarding to an IP range, 192.168.0.100 - 192.168.0.102 (between those are my machines static IP's), i am getting a connection error.

How would i network several computers together (My main machine is more powerful, so it acts as the Mysql backend and storage location) so that each computer handles some of the connections.

Thanks,

Jack Renshaw

EDIT:

For anyone interested, or looking for a similar solution, what i did is used the first computer (the more powerful one) as a reverse proxy and mysql server.

My nginx.conf file looks like this

upstream lb_units {
  server 192.168.0.101:8080 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to  BES1
  server 192.168.0.102:8080 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to  BES1
}

upstream backend {
    server 192.168.0.101:443;
    server 192.168.0.102:443;
}

server {
 listen 80; # Listen on the external interface
 server_name  mywebsite.com; # The server name
 location / {
  proxy_pass         http://lb_units; # Load balance the URL location "/" to the      upstream lb_units
}
error_page   500 502 503 504  /50x.html;
 location = /50x.html {
 root   /wdata/redir;
  }
 }

server {
    listen 443 ssl; # Listen on the external interface
    server_name  mywebsite.com; # The server name
            ssl_certificate ssl/mywebsite.crt;
            ssl_certificate_key ssl/mywebsite.key;

            root /wdata;
            index index.php index.htm index.html;

    ssl_verify_client off;
    location / {
        proxy_pass  https://backend;
        proxy_set_header Host $http_host;
        proxy_set_header X_FORWARDED_PROTO https;
    }

  }
share|improve this question

closed as off topic by Michael Hampton, mdpc, Khaled, Dave M, Ward Jan 29 '13 at 14:58

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

    
How much load do you plan to have on your site? You may want to reconsider what you are attempting to accomplish with these machines, it seems underpowered to me. However, what you are looking for here sounds like a load-balancer. –  Brent Pabst Jan 29 '13 at 3:35
    
I just want to know how i can distribute traffic between the machines –  Jack Renshaw Jan 29 '13 at 3:37

1 Answer 1

up vote 0 down vote accepted

Use a Network Load Balancer. They come in hardware and software varieties. In your situation you may want to use a hardware based device as the load on your relatively small devices may increase too much to handle the addition of load balancing.

Alternatively you could look into clustering combined with load balancing to provide high availability and distributed access.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.