歡迎您光臨本站 註冊首頁

如何在LVS請求分發下保存WEB的session

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

如何在LVS請求分發下保存WEB的session

前端有台A調度器負責分發客戶端的訪問到後端B.C兩台伺服器上。
當USER通過LVS調度器訪問web伺服器的時候,調度器把請求分發到了B這台機器上。
這樣當USER在600秒內第二次打開WEB客戶端的時候不要求輸入用戶和密碼就能直接登陸論壇

現在遇到這樣個問題

當USER第一次登陸連接的是B這台伺服器,但是為什麼USER第二次登陸還是要求要輸入用戶名和密碼,根本沒有保存
我懷疑是前端LVS把請求分發到了C這台伺服器上面去了,那麼USER和C就建立了一個新的session,原來和B的那個會話就斷開了,不知道這樣的問題怎麼解決
《解決方案》

F5已經實現了這個功能,LVS目前好像還不行

要不章博士出的那個盒子怎麼還沒這個功能呢。
《解決方案》

回復 #1 werll 的帖子

這個問題就是要設置會話的保持時間

       -p, --persistent
              Specify that a virtual service is persistent. If this option  is
              specified, multiple requests from a client are redirected to the
              same real server selected for the  first  request.   Optionally,
              the  timeout  of  persistent  sessions may be specified given in
              seconds, otherwise the default of 300 seconds will be used. This
              option  may be used in conjunction with protocols such as SSL or
              FTP where it is important that clients consistently connect with
              the same real server.

              Note:  If  a  virtual  service is to handle FTP connections then
              persistence must be set for the virtual service if Direct  Rout-
              ing  or  Tunnelling is used as the forwarding mechanism. If Mas-
              querading is used in conjunction with an FTP service  than  per-
              sistence  is not necessary, but the ip_vs_ftp kernel module must
              be used.  This module may be manually inserted into  the  kernel
              using insmod(8).

[火星人 ] 如何在LVS請求分發下保存WEB的session已經有260次圍觀

http://coctec.com/docs/service/show-post-6023.html