{"id":1468,"date":"2014-04-16T08:32:30","date_gmt":"2014-04-16T07:32:30","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1468"},"modified":"2014-04-16T08:32:30","modified_gmt":"2014-04-16T07:32:30","slug":"site-id-load-balancing-kornyezetben","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2014\/04\/16\/site-id-load-balancing-kornyezetben\/","title":{"rendered":"Site id load balancing k\u00f6rnyezetben"},"content":{"rendered":"<p>Az k\u00f6zismert, hogy ha t\u00f6bb ASP.NET-et kiszolg\u00e1l\u00f3 IIS van load balancer m\u00f6g\u00f6tt, akkor a machineKey-eket egyform\u00e1ra kell venni a machine.configban, illetve k\u00fcls\u0151, osztott session state t\u00e1rol\u00f3t kell haszn\u00e1lni:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;configuration&gt;\r\n  &lt;system.web&gt;\r\n    &lt;machineKey validationKey=&quot;ugyanaz az \u00e9rt\u00e9k minden szerverre&quot; decryptionKey=&quot;ugyanaz az \u00e9rt\u00e9k minden szerverre&quot; validation=&quot;SHA256&quot; decryption=&quot;AES&quot; \/&gt;\r\n    &lt;sessionState mode=&quot;SQLServer&quot; stateNetworkTimeout=&quot;30&quot; stateConnectionString=&quot;...&quot; allowCustomSqlDatabase=&quot;true&quot; sqlConnectionString=&quot;...&quot; cookieless=&quot;false&quot; timeout=&quot;1441&quot; \/&gt;\r\n  &lt;\/system.web&gt;\r\n&lt;\/configuration&gt;\r\n<\/pre>\n<p>Azonban ez nem el\u00e9g, \u00e9s a k\u00f6vetkez\u0151 dolog nincs agyondokument\u00e1lva. Minden egyes sitenak azonosnak kell lenni az id-j\u00e1nak:<\/p>\n<p><a href=\"http:\/\/soci.hu\/blog\/wp-content\/uploads\/2014\/04\/AppId.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/soci.hu\/blog\/wp-content\/uploads\/2014\/04\/AppId-245x300.png\" alt=\"AppId\" width=\"245\" height=\"300\" class=\"alignnone size-medium wp-image-1469\" srcset=\"https:\/\/soci.hu\/blog\/wp-content\/uploads\/2014\/04\/AppId-245x300.png 245w, https:\/\/soci.hu\/blog\/wp-content\/uploads\/2014\/04\/AppId.png 450w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/a><\/p>\n<p>&#8220;In short: under Advanced Settings of each site in IIS, there&#8217;s a numeric ID which is configurable but apparently auto-incremented from 1 in order of site creation on that server. These IDs are used in the ASPStateTempApplications table, and were different between our servers, resulting in different Session IDs.&#8221;<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/9773125\/net-applications-behind-load-balancer-generating-different-session-ids\">Itt<\/a> \u00edrnak r\u00f3la, meg <a href=\"http:\/\/serverfault.com\/questions\/288981\/load-balanced-iis-7-5-web-server-asp-net-session-state-problem\">itt<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Az k\u00f6zismert, hogy ha t\u00f6bb ASP.NET-et kiszolg\u00e1l\u00f3 IIS van load balancer m\u00f6g\u00f6tt, akkor a machineKey-eket egyform\u00e1ra kell venni a machine.configban, illetve k\u00fcls\u0151,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1468","post","type-post","status-publish","format-standard","hentry","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":1,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1468\/revisions"}],"predecessor-version":[{"id":1470,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1468\/revisions\/1470"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}