Setup load balancing using Pound in linux


  • ابزار دیگری برای ایجاد این منظور وجود دارد به نام pound
  • بسته‌ی این ابزار برای سیستم عامل ubunut نسخه‌ی 18.04 موجود نیست اما بر روی 16.04 موجود است.
  • مراحل در سیستم عامل ubuntu 16.04 دنبال می‌شود.
  • ابتدا بسته‌ها را آپدیت کنید :
# apt-get update ; apt-get -y dist-upgrade
  • سپس بسته‌ی pound را نصب کنید :
# apt-get -y install pound
  • مسیر تنظیمات این ابزار در مسیر زیر است. آن را با یک ویرایشگر باز کنید :
/etc/pound/pound.cfg
  • محتویات زیر را برای اعمال load balance برای پرونده‌ی بالا در نظر بگیرید :
## Logging: (goes to syslog by default)
##      0       no logging
##      1       normal
##      2       extended
##      3       Apache-style (common log format)
LogLevel        3

# Add this line to specify log facility
LogFacility     local1

Define the listening address for the front-end Pound server abd the Back-end web servers,

## redirect all requests on port 80 ("ListenHTTP") to the local webserver (see "Service" below):
ListenHTTP
        Address 192.168.10.47
        Port    80
End
        ## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
#       xHTTP           0 # Comment out this line
# If you are going to load balance https traffic uncomment the following lines
#ListenHTTPS
#        Address 192.168.10.47
#        Port    443
#        Cert    "/etc/ssl/pound.pem"
#End

Service
    BackEnd
        Address 10.10.1.33 # websrv01 back-end IP address
        Port    80         # Listening port for back-end websrv01
        Priority 5         # Priority of this backend
   End

   BackEnd
       Address 172.16.0.28 # IP address for second web-server backend
       Port    80
       Priority 5
  End
End
  • به موارد قرمز رنگ توجه کنید.

  • تست شده بر روی ubuntu 16.04

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *