2011-01-23 13 views
0

私はHAProxyの設定をしていますが、私のAppサーバーのパブリックIPを指しても問題はありませんが、プライベートIPを指すようにはできません。 「503サービスを利用できません」このリクエストを処理するサーバーはありません。エラープライベートIPでのHAProxyとNGINXの問題

は、これらは私の設定です:

haproxy.cfg

global 
     log 127.0.0.1 local0 
     log 127.0.0.1 local1 notice 
     maxconn 4096 
     user haproxy 
     group haproxy 

defaults 
     log  global 
     mode http 
     option httplog 
     option dontlognull 
     retries 3 
     option redispatch 
     maxconn 2000 
     contimeout  5000 
     clitimeout  50000 
     srvtimeout  50000 

listen webfarm 173.255.222.100:80 
     mode http 
     stats enable 
     stats auth deploy:d3pl0y 
     balance roundrobin 
     cookie JSESSIONID prefix 
     option httpclose 
     option forwardfor 
     server App1 192.168.133.136:80 cookie App1 check 

(アプリケーションサーバー用)nginx.conf

#user nobody; 
worker_processes 4; 

#error_log logs/error.log; 
#error_log logs/error.log notice; 
#error_log logs/error.log info; 

#pid  logs/nginx.pid; 


events { 
    worker_connections 1024; 
} 


http { 
    passenger_root /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.2; 
    passenger_ruby /opt/ruby/bin/ruby; 

    include  mime.types; 
    default_type application/octet-stream; 

    #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
    #     '$status $body_bytes_sent "$http_referer" ' 
    #     '"$http_user_agent" "$http_x_forwarded_for"'; 

    #access_log logs/access.log main; 

    sendfile  on; 
    #tcp_nopush  on; 

    #keepalive_timeout 0; 
    keepalive_timeout 65; 

    #gzip on; 

server { 
    listen 192.168.133.136:80; 
    port_in_redirect off; 
    server_name localhost; 
    root /var/www/current/public; 
    passenger_enabled on; 
    rack_env production; 
    if (-f $document_root/system/maintenance.html){ 
      rewrite ^(.*)$ /system/maintenance.html break; 
    } 


    if ($host ~* www\.(.*)) { 
      set $host_without_www $1; 
      rewrite ^(.*)$ http://$host_without_www$1 permanent; 
    } 
     } 

    server { 
     listen  80; 
     server_name localhost; 

     #charset koi8-r; 

     #access_log logs/host.access.log main; 

     location/{ 
      root html; 
      index index.html index.htm; 
     } 

     #error_page 404    /404.html; 

     # redirect server error pages to the static page /50x.html 
     # 
     error_page 500 502 503 504 /50x.html; 
     location = /50x.html { 
      root html; 
     } 

} 

答えて

1

503は、サーバがある小切手を、失敗したことを意味します単純にあなたの設定のTCP。あなたのトラフィックがhaproxy LBとサーバーの間でフィルタリングされているか、またはサーバーがLBに応答できないと思われます。

0

haproxy.confのバックエンド定義はどこにありますか?デフォルトのバックエンドを定義し、サーバーApp1 192.168.133.136:80のCookie App1をそこにチェックインし、何が起きているかを確認するためにHaproxyの統計情報を有効にする必要があります。また、ファイアウォールを確認して、192.168.133.136がhaproxyがインストールされているサーバーに応答していることを確認しましたか?

load balancing with haproxyで次の記事を確認してください。

関連する問題