{"id":1057,"date":"2010-02-08T11:54:00","date_gmt":"2010-02-08T03:54:00","guid":{"rendered":"\/?p=1057"},"modified":"2010-02-08T11:54:00","modified_gmt":"2010-02-08T11:54:00","slug":"1057","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1057.html","title":{"rendered":"ZendPlatform Session \u8de8\u670d\u52a1\u5668\u89e3\u51b3\u65b9\u6848\u767d\u76ae\u4e66"},"content":{"rendered":"\n\n\n\n\n
\u4ecb\u7ecd<\/a><\/p>\n

\u8fd9\u7bc7\u767d\u76ae\u4e66\u4ecb\u7ecd\u7684\u662fZend Platform \u5173\u4e8esession clustering\u7684\u65b0\u7684\u6a21\u5757\u3002Zend\u7684\u89e3\u51b3\u65b9\u6848\u662f\u552f\u4e00\u80fd\u4e3a\u4e0d\u65ad\u589e\u52a0\u7684\u96c6\u7fa4\u63d0\u4f9b\u7ebf\u6027\u5347\u7ea7\u7684\u65b9\u6848\uff0c\u540c\u65f6\u5b83\u8fd8\u63d0\u4f9b\u7a7a\u524d\u7684\u6027\u80fd\u548c\u6570\u636e\u5b8c\u6574\u6027\u3002<\/p>\n

\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u4ecb\u7ecd\u76ee\u524d\u53ef\u9009\u7684\u51e0\u79cd\u65b9\u6848\u3002\u7136\u540e\uff0c\u5c06\u5b83\u4eec\u4e0eZend\u63d0\u4f9b\u7684\u65b9\u6848\u505a\u5bf9\u6bd4\uff0c\u5e76\u4e14\u5bf9Zend\u7684Session\u96c6\u6210\u6a21\u5757\u7684\u8bbe\u8ba1\u7406\u5ff5\u548c\u67b6\u6784\u505a\u4e0b\u9610\u8ff0\u3002<\/p>\n

\u80cc\u666f<\/a><\/p>\n

\u56e0\u7279\u7f51\u6216\u8005\u4e07\u7ef4\u7f51\u7684\u6838\u5fc3\u662fHTTP\u534f\u8bae\uff08\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae\uff09\u3002\u540c\u65f6\uff0c\u56e0\u4e3aHTTP\u534f\u8bae\u7684\u65e0\u754c\u6027\uff0c\u7f51\u7ad9\u5e94\u7528\u65e0\u6cd5\u5c06\u6d4f\u89c8\u5668\u8bbf\u95ee\u4e0e\u4e0d\u540c\u7684\u670d\u52a1\u5668\u8fde\u63a5\u8d77\u6765\u3002\u4ece\u672c\u8d28\u4e0a\u8bf4\uff0c\u8fd9\u610f\u5473\u7740\u7528\u6237\u4ece\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u5165\u5230\u53e6\u4e00\u4e2a\u4e1a\u52a1\u65f6\uff0c\u65b0\u7684\u670d\u52a1\u5668\u6709\u53ef\u80fd\u65e0\u6cd5\u5f97\u5230\u8be5\u7528\u6237\u7684\u4fe1\u606f\u3002<\/p>\n

\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4e00\u4e2a\u65b0\u7684\u6982\u5ff5“Cookies”\u88ab\u5f15\u5165\u4e86\u3002\u6240\u8c13\u7684“Cookies”\u6307\u7684\u662f\u4e00\u4e2a\u5c0f\u578b\u6570\u636e\u7ed3\u6784\uff0c\u8fd9\u4e2a\u5b58\u653e\u5728\u7528\u6237\u672c\u5730\u7684\u6570\u636e\u662f\u88ab\u7528\u6765\u50a8\u5b58\u7528\u6237\u7684\u4fe1\u606f\u3002\u5f53\u8be5\u7528\u6237\u8bbf\u95ee\u4e00\u4e2a\u7f51\u7ad9\u7684\u65f6\u5019\uff0c\u7f51\u7ad9\u7684\u670d\u52a1\u5668\u4ece\u7528\u6237\u672c\u5730\u5f97\u5230\u7528\u6237\u6570\u636e\u540e\u7ecf\u8fc7\u5904\u7406\u518d\u628a\u7ed3\u679c\u8fd4\u56de\u7ed9\u7528\u6237\u3002\u6240\u4ee5\uff0c\u7ed9\u7528\u6237\u7684\u611f\u89c9\u662f\u7f51\u7ad9\u4f3c\u4e4e\u8bb0\u4f4f\u4e86\u8be5\u7528\u6237\u7684\u4fe1\u606f\u3002\u540c\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u767b\u9646\u8be5\u7f51\u7ad9\u65f6\u4f7f\u7528\u539f\u5148\u7684\u8bbe\u7f6e\uff0c\u751a\u81f3\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801\u8fdb\u884c\u767b\u9646\u3002“Cookies”\u4f7f\u7528\u6700\u591a\u7684\u9886\u57df\u662f\u8bb0\u5f55\u7528\u6237\u7684\u76f8\u5173\u914d\u7f6e\u4fe1\u606f\u6216\u8005\u662f\u5728\u4e00\u4e2a\u5728\u7ebf\u5546\u5e97\u6240\u91c7\u8d2d\u7684\u91c7\u8d2d\u8bb0\u5f55\u3002 <\/p>\n

\u7136\u800c\uff0c“Cookies”\u6570\u636e\u4fdd\u5b58\u5728\u7528\u6237\u672c\u5730\u7684\u7279\u70b9\u5bb9\u6613\u9020\u6210\u4e24\u4e2a\u65b9\u9762\u7684\u8d1f\u9762\u6548\u679c\u3002\u7b2c\u4e00\u3001\u8fc7\u957f\u7684“Cookies”\u6570\u636e\u7684\u4fdd\u5b58\u4e0e\u4f20\u8f93\u90fd\u5c06\u662f\u4e00\u4e2a\u4e0d\u5c0f\u7684\u8d44\u6e90\u6d88\u8017\u3002\u7b2c\u4e8c\u3001\u5bf9\u4e8e\u4e00\u4e9b\u91cd\u8981\u7684\u6570\u636e\uff0c\u4fdd\u5b58\u5728\u7528\u6237\u672c\u5730\u5bb9\u6613\u9020\u6210\u6570\u636e\u9519\u8bef\uff0c\u4ece\u800c\u7ed9\u7528\u6237\u7684\u8bbf\u95ee\u5e26\u6765\u8d1f\u9762\u5f71\u54cd\u3002\u4e3a\u6b64\uff0c\u57fa\u4e8e“Cookies”\u7684HTTP Session \u6982\u5ff5\u4ea7\u751f\u4e86\u3002\u4ee3\u66ff\u4f20\u7edf\u7684\u628a\u6240\u6709\u7684\u4fe1\u606f\u5b58\u50a8\u5728\u7528\u6237\u672c\u5730\u7684\u505a\u6cd5\uff0cSession \u67b6\u6784\u628a\u7528\u6237\u7684\u4fe1\u606f\u50a8\u5b58\u5728\u670d\u52a1\u5668\u7aef\uff0c\u800c\u5728\u7528\u6237\u7aef\u53ea\u4fdd\u5b58\u4e86\u533a\u5206\u5e03\u4e0d\u540c\u7528\u6237\u4fe1\u606f\u7684\u552f\u4e00\u7684“Session ID”\u3002<\/p>\n

PHP\u662f\u901a\u8fc7\u5185\u5d4c\u7684\u6269\u5c55\u6765\u5b9e\u73b0Session\u5e94\u7528\u7684\uff0c\u5e76\u4e14\u8be5\u6269\u5c55\u662f\u57fa\u4e8e\u5730\u5c42\u7684\u67b6\u6784\u3002PHP\u5bf9Session\u7684\u652f\u6301\u5141\u8bb8\u7f51\u7ad9\u5b9e\u73b0\u5927\u91cf\u7684\u6ce8\u518c\u548c\u8bbf\u95ee\u91cf\u3002<\/p>\n

\u53ef\u662f\uff0c\u5f53\u8981\u5728\u4e00\u4e2a\u670d\u52a1\u5668\u96c6\u7fa4\u5b9e\u73b0PHP Session \u7684\u5e94\u7528\u65f6\uff0c\u95ee\u9898\u53d8\u5f97\u590d\u6742\u8d77\u6765\u3002<\/p>\n

<\/p>\n

<\/p>\n

Figure: 1 – \u670d\u52a1\u5668\u96c6\u7fa4\u73af\u5883<\/p>\n

\u7ecf\u5178\u7684\u591a\u670d\u52a1\u5668\u96c6\u7fa4\u5305\u542b\u4e86\u4e00\u7ec4\u670d\u52a1\u5668\uff0c\u5728\u6bcf\u53f0\u670d\u52a1\u5668\u4e0a\u9762\u52a0\u8f7d\u76f8\u540c\u7684PHP\u5e94\u7528\u3002\u540c\u65f6\uff0c\u670d\u52a1\u5668\u96c6\u7fa4\u7684\u51fa\u53e3\u7531\u4e00\u4e2a\u4e0b\u8f7d\u5747\u8861\u670d\u52a1\u5668\u6765\u5b9e\u73b0\uff0c\u4e0b\u8f7d\u5747\u8861\u7ba1\u7406\u5668\u5728\u670d\u52a1\u5668\u4e4b\u95f4\u5206\u914d\u6d41\u91cf\u4fdd\u8bc1\u5404\u4e2a\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u662f\u5747\u8861\u7684\u3002\u8fd9\u79cd\u5e94\u7528\u4f7f\u5f97\u7f51\u7ad9\u5e94\u7528\u7a81\u7834\u4e86\u5355\u53f0\u670d\u52a1\u5668\u7684\u4f20\u7edf\u6a21\u5f0f\uff0c\u800c\u7531\u670d\u52a1\u5668\u96c6\u7fa4\u6765\u627f\u8f7d\u540c\u4e00\u4e2aPHP\u5e94\u7528\u3002\u5f88\u660e\u663e\uff0c\u8fd9\u79cd\u96c6\u7fa4\u670d\u52a1\u5668\u7684\u5e94\u7528\u63d0\u9ad8\u4e86PHP\u4e1a\u52a1\u7684\u6027\u80fd\u5e76\u51cf\u4f4e\u4e86\u7ec8\u7aef\u7528\u6237\u7684\u8bbf\u95ee\u65f6\u95f4\u3002<\/p>\n

\u7531\u4e8eHTTP\u534f\u8bae\u7684\u4e0d\u786e\u5b9a\u6027\uff0c\u540c\u4e00\u4e2a\u7528\u6237\u7684\u4e0d\u540cHTTP\u8bf7\u6c42\u5f88\u6709\u53ef\u80fd\u88ab\u53d1\u9001\u5230\u4e0d\u540c\u7684\u670d\u52a1\u5668\u3002\u6240\u4ee5\uff0c\u5c06\u4f1a\u9020\u6210\u7528\u6237\u7684session id \u65e0\u6cd5\u53ca\u65f6\u83b7\u53d6\u6b63\u786e\u7684\u7528\u6237\u4fe1\u606f\u7684\u95ee\u9898\uff0c\u5e76\u6700\u7ec8\u5bfc\u81f4\u7528\u6237\u4f7f\u7528\u4e0a\u7684\u4e0d\u65b9\u4fbf\u3002<\/p>\n

Session \u96c6\u7fa4\u5316\u7ba1\u7406<\/a><\/p>\n

Zend\u4e4b\u524d\u7684\u4e00\u4e9b\u89e3\u51b3\u65b9\u6848\uff1a
\u8d1f\u8f7d\u5747\u8861Session\u65b9\u6848<\/a> <\/p>\n

\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u628a\u7279\u5b9a\u7684HTTP\u8bf7\u6c42\u6307\u5b9a\u5230\u76f8\u540c\u7684\u670d\u52a1\u5668\u3002\u5b58\u5728\u7740\u4e00\u4e9b\u4e0d\u8db3\uff1a <\/p>\n

• SessionID\u4e0e\u670d\u52a1\u5668\u7684\u5bf9\u5e94\u5f88\u96be\u6210\u529f\u5730\u4fdd\u6301\u3002\u5728\u6ca1\u6709HTTP\u534f\u8bae\u6821\u9a8c\u7684\u524d\u63d0\u4e0b\uff0cHTTP\u534f\u8bae\u5f88\u5bb9\u6613\u4e22\u5931\u76ee\u6807\u3002\u800c\u4e14\uff0c\u56e0\u4e3a\u8d1f\u8f7d\u5747\u8861\u7684\u6027\u80fd\u95ee\u9898\u4f7f\u7528HTTP\u534f\u8bae\u8fdb\u884c\u6821\u9a8c\u662f\u4e0d\u7a33\u5b9a\u7684\u3002
• \u5982\u679c\u5728\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u4e0a\u9762\u542f\u7528Session\u5b9a\u5411\uff0c\u5c06\u4e0d\u5229\u4e8e\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u672c\u8eab\u7684\u8fd0\u884c\u7279\u6027\u3002\u5c24\u5176\u662f\u5728\u4f7f\u7528\u4e86\u4e86\u6d41\u884c\u7684NAT\u6280\u672f\u540e\uff0c\u5f71\u54cd\u66f4\u52a0\u660e\u663e\u3002
• \u4e3a\u4e86\u8fbe\u5230SessionID\u4e0e\u670d\u52a1\u5668\u7684\u5bf9\u5e94\u7684\u76ee\u7684\uff0c\u8d1f\u8f7d\u5747\u8861\u5c06\u9700\u8981\u82b1\u8d39\u76f8\u5f53\u6602\u8d35\u7684\u7cfb\u7edf\u6d88\u8017\u6765\u5b9e\u73b0\u3002
• \u5f53\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u7684\u4e3a\u4e86\u5b9e\u73b0Session\u529f\u80fd\u7684\u65f6\u5019\uff0c\u5b83\u7684\u8d1f\u8f7d\u5c06\u4f1a\u6025\u901f\u4e0a\u5347\uff0c\u5e76\u9010\u6e10\u5730\u6210\u4e3a\u4e86\u670d\u52a1\u5668\u96c6\u7fa4\u5347\u7ea7\u7684\u7684\u74f6\u9888\u3002\u5728\u96c6\u7fa4\u670d\u52a1\u5668\u4e0a\u6dfb\u52a0\u670d\u52a1\u5668\u5c06\u4f1a\u56e0\u4e3a\u8d1f\u8f7d\u5747\u8861\u7684\u7684\u74f6\u9888\u95ee\u9898\u800c\u53d8\u5f97\u56f0\u96be\u3002
\u901a\u8fc7NFS\u7cfb\u7edf\u6765\u5171\u4eabSession\u7684\u65b9\u6848<\/a>
\u56e0\u4e3a\u8d1f\u8f7d\u5747\u8861\u5b9e\u73b0Session\u5171\u4eab\u7684\u5c40\u9650\u6027\uff0c\u6709\u4eba\u5f00\u59cb\u5c1d\u8bd5\u7528NFS\u6765\u5171\u4eab\u3002\u901a\u8fc7\u96c6\u7fa4\u4e2d\u7684NFS\u6587\u4ef6\u670d\u52a1\u5668\u6765\u5b9e\u73b0\uff0c\u4ece\u800c\u6765\u5b9e\u73b0\u96c6\u7fa4\u91cc\u7684\u670d\u52a1\u5668\u7684Session\u5e94\u7528\u3002\u751a\u81f3\u6709\u4eba\u89c9\u5f97\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u6765\u5b9e\u73b0Session\u5171\u4eab\u4f1a\u53d8\u5f97\u6ca1\u6709\u5fc5\u8981\uff0c\u800c\u4e14\u53ef\u4ee5\u4f7f\u5f97\u7f51\u7edc\u7684\u786c\u4ef6\u6295\u5165\u5f97\u5230\u51cf\u5c11\uff0cDNS\u8f6e\u8be2\u90fd\u80fd\u591f\u6ee1\u8db3Session\u7684\u5e94\u7528\u3002
\u4f46\u662f\u8fd9\u79cd\u65b9\u6cd5\u540c\u6837\u5b58\u5728\u7740\u4e00\u4e9b\u5c40\u9650\u6027\uff1a<\/p>\n

• \u6570\u636e\u5b8c\u6574\u6027: NFS\u7684\u6587\u4ef6\u52a0\u9501\u673a\u5236\u5728\u8bb8\u591a\u573a\u5408\u4e0b\u662f\u4e0d\u5408\u9002\u7684\u3002\u8fd9\u79cd\u60c5\u51b5\u6709\u53ef\u80fd\u5bfc\u81f4Session\u7684\u6570\u636e\u5f88\u5bb9\u6613\u51fa\u9519\u3002
• \u901f\u5ea6\u7f13\u6162\uff1a\u4eceNFS\u6587\u4ef6\u7cfb\u7edf\u63d0\u53d6Session\u6570\u636e\u8fdc\u8fdc\u6bd4\u672c\u5730\u63d0\u53d6\u8017\u65f6\uff0c\u540c\u65f6\u7f51\u7edc\u7684\u67b6\u6784\u4e5f\u5c06\u5f71\u54cd\u6570\u636e\u7684\u4f20\u8f93\u901f\u5ea6\u3002
• \u5c06\u6240\u6709\u7684\u6570\u636e\u90fd\u5b58\u50a8\u5728\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\u610f\u5473\u7740\u8fd9\u662f\u4e00\u4e2a\u7cfb\u7edf\u6545\u969c\u70b9\uff1a\u5982\u679cNFS\u670d\u52a1\u5668\u51fa\u73b0\u4e86\u6545\u969c\uff0c\u6574\u4e2aPHP\u5e94\u7528\u7cfb\u7edf\u5c06\u65e0\u6cd5\u5de5\u4f5c\u3002\u4e3a\u6b64\u5c31\u5fc5\u987b\u4e3aNFS\u670d\u52a1\u5668\u914d\u7f6e\u66f4\u591a\u7684\u8bbe\u5907\u548c\u66f4\u5b8c\u5584\u7684\u7535\u6e90\u7ba1\u7406\u3002\u4f46\u662f\uff0c\u8fd9\u4e5f\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u8d44\u91d1\u6295\u5165\uff0c\u540c\u65f6\uff0c\u4ed6\u8fd8\u662f\u6ca1\u6709\u4ece\u6839\u672c\u4e0a\u89e3\u51b3\u5355\u4e00\u6545\u969c\u70b9\u7684\u95ee\u9898\u3002\u56e0\u4e3aNFS\u7684\u7f51\u7edc\u63a5\u53e3\u8fd8\u662f\u4e00\u4e2a\u3002
• \u7cfb\u7edf\u5347\u7ea7: \u628a\u7cfb\u7edf\u6240\u6709\u7684\u6570\u636e\u90fd\u5b58\u653e\u5728\u4e00\u4e2a\u4e2d\u5fc3\u8282\u70b9\u4f34\u968f\u7740\u7684\u4e00\u4e2a\u95ee\u9898\u662f\u7cfb\u7edf\u7684\u5347\u7ea7\u53d8\u5f97\u56f0\u96be\uff0c\u800c\u4e2d\u5fc3\u70b9\u5c31\u662f\u7cfb\u7edf\u5347\u7ea7\u7684\u4e00\u4e2a\u74f6\u9888\u3002\u6240\u4ee5\uff0c\u5f80\u96c6\u7fa4\u91cc\u9762\u589e\u52a0\u670d\u52a1\u5668\u6240\u5e26\u6765\u7684\u6548\u76ca\u5c06\u4e3a\u56e0\u4e3a\u8fd9\u4e2a\u74f6\u9888\u95ee\u9898\u800c\u88ab\u964d\u4f4e\u3002
• \u5b89\u5168\u6027: NFS \u4e00\u76f4\u4ee5\u6765\u90fd\u88ab\u8ba4\u4e3a\u662f\u4e00\u4e2a\u5b89\u5168\u6027\u6bd4\u8f83\u5dee\u7684\u534f\u8bae\u3002\u8bb8\u591a\u4e13\u4e1a\u7684IT\u516c\u53f8\u4e5f\u56e0\u6b64\u653e\u5f03\u4e86NFS\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\u3002
• \u6301\u7eed\u7684\u786c\u4ef6\u6295\u5165<\/p>\n

\u91c7\u7528\u6570\u636e\u5e93\u6765\u5b58\u653eSession\u4fe1\u606f<\/a><\/p>\n

\u7b2c\u4e09\u79cd\u89e3\u51b3Session\u4e0d\u80fd\u8de8\u670d\u52a1\u5668\u7684\u65b9\u6cd5\u662f\u628a\u5171\u4eab\u7684Session\u653e\u5728\u4e00\u53f0\u76f8\u5e94\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e2d\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e5f\u6709\u6548\u5730\u89e3\u51b3\u4e86NFS\u6587\u4ef6\u7cfb\u7edf\u65b9\u6848\u5e26\u6765\u7684\u6570\u636e\u5b8c\u6574\u6027\u548c\u6709\u6548\u6027\u7b49\u95ee\u9898\u3002\u4f46\u662f\u8fd9\u4e2a\u65b9\u6848\u540c\u6837\u5730\u5b58\u5728\u7740\u67d0\u4e9b\u4e0d\u8db3:<\/p>\n

• \u901f\u5ea6\uff1a\u76f8\u5bf9\u672c\u5730\u5b58\u50a8\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u5c06\u9700\u8981\u5728\u6570\u636e\u5e93\u5904\u7406\u4e0a\u9762\u5360\u7528\u6574\u4e2aPHP\u5e94\u7528\u5e73\u53f0\u7684\u65f6\u95f4\u3002
• \u6545\u969c\u70b9\uff1a\u6570\u636e\u5e93\u670d\u52a1\u5668\u8fd8\u662f\u5b58\u5728\u7740\u5355\u4e00\u6545\u969c\u70b9\u7684\u95ee\u9898\u3002
• \u7cfb\u7edf\u5347\u7ea7\uff1a\u4f7f\u7528\u6570\u636e\u5e93\u6765\u5b58\u50a8Session\u8fd9\u4e2a\u65b9\u6848\u540c\u6837\u5b58\u5728\u7740\u5347\u7ea7\u56f0\u96be\u7684\u95ee\u9898\u3002\u800c\u8fd9\u4e2a\u95ee\u9898\u5728\u8003\u8651\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u5904\u7406\u80fd\u529b\u548c\u8d1f\u8f7d\u7684\u65f6\u5019\u4f1a\u663e\u5f97\u5c24\u4e3a\u7a81\u51fa\u3002<\/p>\n

\u5c0f\u7ed3<\/a><\/p>\n

\u76ee\u524d\uff0c\u901a\u7528\u7684\u89e3\u51b3\u65b9\u6848\u5e76\u4e0d\u80fd\u6ee1\u8db3PHP\u96c6\u7fa4\u5316\u5e94\u7528\u53d1\u5c55\u7684\u9700\u6c42\u3002\u603b\u4f53\u6765\u8bf4\uff0c\u6709\u4e00\u4e0b\u51e0\u4e2a\u65b9\u6848\u7684\u56f0\u96be\u9700\u8981\u89e3\u51b3\uff1a <\/p>\n

• \u7cfb\u7edf\u5347\u7ea7\u7684\u74f6\u9888\u95ee\u9898\uff1a\u76ee\u524d\u5df2\u6709\u7684\u89e3\u51b3\u65b9\u6848\u603b\u662f\u628a\u95ee\u9898\u96c6\u4e2d\u5728\u4e00\u4e2a\u5355\u4e00\u7684\u4e2d\u5fc3\u8282\u70b9\u4e0a\u9762\u3002\u4e3a\u6b64 \uff0c\u9650\u5236\u4e86\u5176\u65b9\u6848\u7684\u5904\u7406\u80fd\u529b\uff0c\u4e3a\u96c6\u7fa4\u5e94\u7528\u7684\u53d1\u5c55\u9020\u6210\u4e86\u56f0\u96be\u3002
• \u6027\u80fd\uff1a\u76ee\u524d\u5df2\u6709\u7684\u89e3\u51b3\u65b9\u6848\u5f80\u5f80\u9700\u8981\u8fc7\u5ea6\u727a\u7272\u4e2d\u5fc3\u8282\u70b9\u7684\u7cfb\u7edf\u8d44\u6e90\uff0c\u6240\u4ee5\u4e2d\u5fc3\u8282\u70b9\u7684\u786c\u4ef6\u6295\u5165\u6bd4\u8f83\u5927\u3002
• \u6545\u969c\u70b9\uff1a\u76ee\u524d\u5df2\u6709\u7684\u89e3\u51b3\u65b9\u6848\u90fd\u9700\u8981\u4e00\u4e2a\u4e2d\u5fc3\u8282\u70b9\uff0c\u4e3a\u6b64\u6574\u4e2a\u7cfb\u7edf\u5b58\u5728\u7740\u5355\u4e00\u6545\u969c\u70b9\u7684\u95ee\u9898\u3002\u8fd9\u4e5f\u610f\u5473\u7740\u7cfb\u7edf\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5b58\u5728\u7740\u8f83\u5927\u7684\u98ce\u9669\u3002<\/p>\n

Zend \u7684\u89e3\u51b3\u65b9\u6848<\/a><\/p>\n

Zend \u516c\u53f8\u662f\u5e94\u8bb8\u591a\u5ba2\u6237\u7684\u8981\u6c42\u7684\u60c5\u51b5\u4e0b\uff0c\u5f00\u59cbSession clustering \u6a21\u5757\u7684\u5f00\u53d1\u7684\u3002\u8fd9\u4e48\u5ba2\u6237\u4e00\u76f4\u88ab\u5b9e\u73b0Session\u5171\u4eab\u800c\u5e26\u6765\u7684\u7cfb\u7edf\u6d88\u8017\u7b49\u95ee\u9898\u800c\u56f0\u6270\u3002\u4f5c\u4e3aPHP\u53d1\u5c55\u7684\u4e3b\u8981\u63a8\u52a8\u8005\uff0cZend\u516c\u53f8\u5f3a\u70c8\u610f\u8bc6\u5230\u8fd9\u4e2a\u95ee\u9898\u7684\u4e25\u91cd\u6027\u3002\u5ba2\u6237\u653e\u6620\u7684\u95ee\u9898\u4e3b\u8981\u662f\u96c6\u4e2d\u5728Session\u5171\u4eab\u7684\u5b89\u5168\u6027\u548c\u591a\u4f59\u8d44\u6e90\u6295\u5165\u3002\u5728Zend\u7684Session\u5171\u4eab\u7684\u89e3\u51b3\u65b9\u6848\u51fa\u73b0\u4e4b\u524d\uff0c\u5ba2\u6237\u5f80\u5f80\u8981\u642d\u5efa\u590d\u6742\u548c\u6602\u8d35\u7684\u6846\u67b6\u6dfb\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7b49\u786c\u4ef6\u6765\u5b9e\u73b0Session\u5171\u4eab\u3002\u4f46\u662f\u8fd9\u6837\u7684\u6846\u67b6\u8fd8\u7ecf\u5e38\u65e0\u6cd5\u63d0\u4f9b\u7a33\u5b9a\u3001\u53ef\u9760\u7684Session\u8de8\u670d\u52a1\u5668\u7684\u89e3\u51b3\u65b9\u6848\u3002\u800c\u4e14\uff0c\u8fd9\u79cd\u590d\u6742\u7684\u6846\u67b6\u8fd8\u7ecf\u5e38\u7ed9\u5546\u4e1a\u5e94\u7528\u7684\u7a33\u5b9a\u6027\u5e26\u6765\u9519\u8bef\u548c\u6f5c\u5728\u7684\u5371\u9669\u3002 <\/p>\n

Zend\u7684\u65b0\u7684Session Clustering \u7684\u6a21\u5757(Zend Platform \u7684\u90e8\u4ef6\u4e4b\u4e00) \u5c31\u4e3a\u63d0\u4f9b\u4e00\u4e2a\u7efc\u5408\u7684Session\u8de8\u670d\u52a1\u5668\u7684\u89e3\u51b3\u65b9\u800c\u5f00\u53d1\u7684\u3002\u5e76\u5728\u8fd9\u4e2a\u65b9\u6848\u4e2d\uff0c\u6709\u6548\u5730\u89e3\u51b3\u4e86\u4e0a\u8ff0\u51e0\u4e2a\u89e3\u51b3\u65b9\u6848\u5b58\u5728\u7684\u95ee\u9898\u4e86\u3002\u66f4\u4e3a\u91cd\u8981\u5730\uff0c\u6ca1\u6709\u4e3a\u73b0\u6709\u5ba2\u6237\u589e\u52a0\u6210\u672c\u3002 <\/p>\n

\u5728Zend session clustering \u7684\u89e3\u51b3\u65b9\u6848\u4e2d, sessions “\u5c45\u4f4f” \u5728\u5b83\u7b2c\u4e00\u6b21\u88ab\u751f\u6210\u7684\u670d\u52a1\u5668\u4e0a\u3002\u540c\u65f6\uff0c\u8fd9\u4e9bSession\u53ef\u4ee5\u522b\u540c\u4e00\u4e2a\u96c6\u7fa4\u670d\u52a1\u5668\u6240\u5171\u4eab\u3002\u8fd9\u610f\u5473\u7740Zend\u7684\u89e3\u51b3\u65b9\u6848\u4ece\u6839\u672c\u4e0a\u89e3\u51b3\u4e86Session\u4e0d\u80fd\u8de8\u670d\u52a1\u5668\u7684\u95ee\u9898\uff0c\u5e76\u63d0\u4f9b\u4e86\u8f83\u9ad8\u7684\u6027\u80fd\u3002\u540c\u65f6\uff0c\u5b83\u7684\u7cfb\u7edf\u5347\u7ea7\u7279\u6027\u4e5f\u53ef\u4ee5\u8ba9\u5ba2\u6237\u5462\u529f\u80fd\u6709\u6548\u5730\u4f7f\u7528\u73b0\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff0c\u5e76\u7b80\u4fbf\u3001\u8fc5\u901f\u5730\u5347\u7ea7\u3002<\/td>\n<\/tr>\n

\n

<\/p>\n<\/td>\n

Figure: 2 – SC \u67b6\u6784
\u56fe 2 \u7ed9\u6211\u4eec\u5c55\u793a\u4e86Session\u96c6\u7fa4\u7ba1\u7406\u7684\u51e0\u5927\u90e8\u4ef6\uff1a
Session \u7684\u5b58\u50a8 : \u53ef\u4ee5\u9009\u62e9\u5b58\u50a8\u5728\u5185\u5b58\u6216\u8005\u662f\u5b58\u50a8\u5728\u786c\u76d8\u5e76\u5728\u5185\u5b58\u8fdb\u884c\u7f13\u5b58\u3002
SCD\u5b88\u62a4\u8fdb\u7a0b: Session clustering \u5b88\u62a4\u8fdb\u7a0b, \u628aSession\u4fe1\u606f\u4eceSession\u88ab\u5b58\u50a8\u7684\u5730\u65b9\u63d0\u53d6\u51fa\u6765\u63d0\u4ea4 \u7ed9PHP engine\uff0c\u6216\u662f\u4ece\u96c6\u7fa4\u91cc\u522b\u7684\u670d\u52a1\u5668\u4e0a\u63d0\u53d6\u5e76\u63d0\u4ea4\u7ed9PHP engine\u3002
mod_cluster PHP\u6269\u5c55: \u662f\u4e00\u4e2aPHP\u7684session\u5904\u7406\u8d1f\u8d23\u4e0eSCD\u5b88\u62a4\u8fdb\u7a0b\u7684\u901a\u4fe1\u3002<\/td>\n<\/tr>\n
Zend\u7684session clustering \u6a21\u5757\u4f7f\u7528\u4e86\u5f3a\u5927\u7684\u52a0\u9501\u548c\u6570\u636e\u5b8c\u6574\u6027\u673a\u5236\u6765\u5b9e\u73b0session \u6570\u636e\u7684\u5b89\u5168\u6027\u3002\u5728\u4f7f\u7528Session clustering \u65f6\uff0c\u53ef\u4ee5\u968f\u65f6\u5730\u5207\u6362\u4e24\u79cd\u4e0d\u540c\u7684session\u5b58\u50a8\u6a21\u5f0f\uff1a\u786c\u76d8\u6216\u53ea\u5728\u5185\u5b58\u3002\u8fd9\u79cd\u5b58\u50a8\u65b9\u5f0f\u4e5f\u63d0\u4f9b\u4e86\u9519\u8bef\u6062\u590d\u7684\u529f\u80fd\uff0c\u56e0\u4e3a\u5982\u679c\u53d1\u751f\u4e86\u4e0d\u53ef\u9884\u6d4b\u7684\u6545\u969c\u65f6\uff0c\u80fd\u591f\u53ca\u65f6\u6062\u590dSession\u6570\u636e\u3002
Zend\u7684session clustering \u6a21\u5757\u5bf9\u73b0\u6709\u7684PHP\u7684\u517c\u5bb9\u6027\u5f88\u5f3a\uff0c\u540c\u65f6\u4e0d\u5f71\u54cd\u5176\u5b83\u7684\u6269\u5c55\u7684\u6b63\u5e38\u4f7f\u7528\uff0c\u4e5f\u4e0d\u9700\u8981\u4fee\u6539\u4efb\u4f55\u4ee3\u7801\u3002Zend Platform\u7684session clustering \u7684\u89e3\u51b3\u65b9\u6848\u5c31\u662f\u96c6\u6210\u4e86\u4e00\u4e2aPHP\u7684\u6269\u5c55\u3002\u540c\u65f6\uff0c\u5728PHP.ini\u91cc\u9762\u4e5f\u53ef\u4ee5\u9009\u62e9\u662f\u7528\u73b0\u6709\u7684\u89e3\u51b3\u65b9\u6848\u8fd8\u662fsession clustering \u6a21\u5f0f\u3002
\u7ed3\u8bba<\/a><\/p>\n

Zend\u7684session clustering \u6a21\u5757\u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u6bd4\u73b0\u6709\u7684\u51e0\u4e2a\u89e3\u51b3\u65b9\u6848\u90fd\u66f4\u52a0\u6210\u719f\uff0c\u4e5f\u662f\u73b0\u4eca\u552f\u4e00\u7684\u80fd\u8fc5\u901f\u5b9e\u73b0\u7cfb\u7edf\u5347\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002Session clustering\u7528\u8f83\u4f4e\u7684\u6210\u672c\u6765\u5b9e\u73b0PHPde \u96c6\u7fa4\u5e94\u7528\uff0c\u5e76\u53ef\u4ee5\u7ed9\u5ba2\u6237\u5e26\u6765\u65e0\u6cd5\u6bd4\u62df\u7684\u6027\u80fd\u3001\u7a33\u5b9a\u6027\u548c\u6570\u636e\u5b8c\u6574\u6027\u3002. <\/p>\n

Zend\u7684 session clustering \u7684\u89e3\u51b3\u65b9\u6848\u4e5f\u662f\u76ee\u524d\u552f\u4e00\u7684\u4e00\u4e2a\u80fd\u591f\u96c6\u6210\u5230PHP\u7684\u89e3\u51b3\u65b9\u6848\u3002\u56e0\u4e3a\u5b9e\u73b0session clustering\u7684\u8bbe\u8ba1\u4e0e\u4ee3\u7801\u7f16\u5199\u90fd\u662f\u5728PHP\u7684\u67b6\u6784\u4e0b\u5b9e\u73b0\u7684\u3002<\/p>\n

\u4e0b\u9762\u5217\u51fa\u7684\u662fsession clustering\u4e0e\u5176\u5b83\u65b9\u6848\u7684\u6bd4\u8f83\uff1a<\/p>\n

• \u7ebf\u6027\u7cfb\u7edf\u5347\u7ea7\uff1a\u5728\u7cfb\u7edf\u67b6\u6784\u4e2d\u4e0d\u518d\u5b58\u5728\u74f6\u9888\u95ee\u9898\u3002\u65b0\u52a0\u5165\u7684\u670d\u52a1\u5668\u80fd\u6709\u6548\u5730\u53d1\u6325\u51fa\u5e94\u6709\u7684\u6027\u80fd\u6548\u76ca\u3002\u540c\u65f6\uff0cSession clustering \u4e5f\u4e0d\u4f1a\u7ed9\u73b0\u6709\u7684\u7f51\u7edc\u67b6\u6784\u548c\u8bbe\u5907\u589e\u52a0\u989d\u5916\u7684\u8d1f\u62c5\u3002
• \u901f\u5ea6\u4f18\u52bf\uff1a\u7ecf\u8fc7\u538b\u529b\u6d4b\u8bd5\uff0csession clustering \u6a21\u5757\u662f\u73b0\u6709\u7684Session\u8de8\u670d\u52a1\u5668\u89e3\u51b3\u65b9\u6848\u76844\u52306\u500d\u7684\u901f\u5ea6\u3002
• \u65e0\u6545\u969c\u70b9\uff1a\u5982\u679c\u56e0\u4e3a\u4e0d\u53ef\u9884\u6d4b\u7684\u539f\u56e0\uff0c\u6709\u4e00\u53f0\u670d\u52a1\u5668\u505c\u6b62\u670d\u52a1\u4e86\uff0c\u635f\u5931\u7684\u4e5f\u53ea\u662f\u90a3\u4e00\u53f0\u670d\u52a1\u5668\u7684session\u6570\u636e\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u7cfb\u7edf\u3002\u635f\u5931\u7684\u6570\u636e\u53ef\u4ee5\u8fc5\u901f\u5728\u5176\u5b83\u7684\u670d\u52a1\u5668\u4e0a\u91cd\u65b0\u5efa\u7acb\u3002
• \u5b89\u5168\u6027: Session clustering’s \u5185\u5728\u7684\u6570\u636e\u5b8c\u6574\u6027\u548c\u52a0\u9501\u673a\u5236\u53ef\u4ee5\u5b9e\u73b0\u5f3a\u5927\u7684Session\u5e94\u7528\u3002\u5e76\u5141\u8bb8\u9ad8\u7528\u6237\u8d1f\u8f7d\u4e0b\u7684\u5546\u4e1a\u5e94\u7528\u3002
• \u9519\u8bef\u77eb\u6b63: session clustering\u53ef\u4ee5\u9009\u62e9\u628asession\u6570\u636e\u5b58\u50a8\u5728\u786c\u76d8\u5f53\u4e2d\u3002\u4ece\u800c\u53ef\u4ee5\u4ece\u7cfb\u7edf\u6216\u8005\u5185\u5b58\u7684\u51fa\u9519\u4e2d\u6062\u590d\u8fc7\u6765\u3002
• Session clustering\u8bd5\u4f60\u7684\u8d44\u91d1\u6295\u5165\u5747\u5300\u5206\u5e03\u5728\u670d\u52a1\u5668\u673a\u7fa4\u4e2d\uff1asession clustering\u53ef\u4ee5\u4e0e\u4efb\u4f55\u7684\u8d1f\u8f7d\u5747\u8861\u6280\u672f\u73af\u5883\u8fd0\u884c\uff08\u5305\u62ecDNS\u8f6e\u8be2\uff09\u3002
• \u5f3a\u5927\u7684\u517c\u5bb9\u6027\uff1a Zend\u7684 session clustering \u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u96c6\u6210\u7279\u6027\uff0c\u53ef\u4ee5\u517c\u5bb9\u73b0\u6709\u7684\u4ee3\u7801\u548cPHP\u5e94\u7528\u3002\u73b0\u6709\u7684PHP\u9879\u76ee\u53ef\u4ee5\u76f4\u63a5\u79fb\u690d\u5230session clustering \u89e3\u51b3\u65b9\u6848\u5f53\u4e2d\u5e94\u7528\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"\n\n\n
\u4ecb\u7ecd<\/a><\/p>\n

\u8fd9\u7bc7\u767d\u76ae\u4e66\u4ecb\u7ecd\u7684\u662fZend Platform \u5173\u4e8esession clustering\u7684\u65b0\u7684\u6a21\u5757\u3002Zend\u7684\u89e3\u51b3\u65b9\u6848\u662f\u552f\u4e00\u80fd\u4e3a\u4e0d\u65ad\u589e\u52a0\u7684\u96c6\u7fa4\u63d0\u4f9b\u7ebf\u6027\u5347\u7ea7\u7684\u65b9\u6848\uff0c\u540c\u65f6\u5b83\u8fd8\u63d0\u4f9b\u7a7a\u524d\u7684\u6027\u80fd\u548c\u6570\u636e\u5b8c\u6574\u6027\u3002<\/p>\n

\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u4ecb\u7ecd\u76ee\u524d\u53ef\u9009\u7684\u51e0\u79cd\u65b9\u6848\u3002\u7136\u540e\uff0c\u5c06\u5b83\u4eec\u4e0eZend\u63d0\u4f9b\u7684\u65b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1057"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1057"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1057\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}