472,796 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,796 software developers and data experts.

NLB, IIS 6.0, .NET ASP Web App Randomly Changing URL From Hostname

I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB (single
Affinity, also using SQLServer session state) that are hosting a few .NET ASP
web applications under the Default Website in IIS, and accessing via a
Intranet LAN (this is not publicly available).

NETWEB1:
NIC1 172.16.17.220
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.221
NETWEB2:
NIC1 172.16.17.222
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.223
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix
The problem is... (referring to a session running on NETWEB1)...

Using Virtual Hostname FQDN (http://nlb.domain.com): Randomly, the a link
will change from the NLB Virtual Hostname to the NLB Virtual IP address, and
clicking on the link will start a new session, requiring re-login (the URL is
now http://172.16.17.244).

Using Virtual Hostname (http://nlb): Randomly, the a link will change from
the NLB Virtual Hostname to the Non-NLB Server IP address, and clicking on
the link will start a new session, requiring re-login (the URL becomes
http://172.16.17.221).
This seems to be completely random in timing, but does happen after a few
minutes of navigating around the website.

Any Ideas??? :(
--------------------------------
From: James M
Jul 21 '05 #1
2 5537
Hello James,
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix
Why?

If your links are relative links, you never need to do this.

..Net is fully capable of being hosted under load balancing without your help
in assigning the URL directly to the host. In fact, the behavior that you
are seeing is probably normal, in that a load balancer using single affinity
will, on its own accord and outside of your control, act as a proxy,
reissuing the request from the proxy FQDN to the actual server. Your
statement above captures the name used by the load balancer and reinserts it
in front of the current page name.

It's as though you WANT to circumvent the load balancer... and I can't
understand why you would want to do that.

Simply make all of your URLs relative, or absolute using the NLB's FQDN and
this issue goes away.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"James M." <Ja****@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB
(single
Affinity, also using SQLServer session state) that are hosting a few .NET
ASP
web applications under the Default Website in IIS, and accessing via a
Intranet LAN (this is not publicly available).

NETWEB1:
NIC1 172.16.17.220
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.221
NETWEB2:
NIC1 172.16.17.222
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.223
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix
The problem is... (referring to a session running on NETWEB1)...

Using Virtual Hostname FQDN (http://nlb.domain.com): Randomly, the a link
will change from the NLB Virtual Hostname to the NLB Virtual IP address,
and
clicking on the link will start a new session, requiring re-login (the URL
is
now http://172.16.17.244).

Using Virtual Hostname (http://nlb): Randomly, the a link will change from
the NLB Virtual Hostname to the Non-NLB Server IP address, and clicking on
the link will start a new session, requiring re-login (the URL becomes
http://172.16.17.221).
This seems to be completely random in timing, but does happen after a few
minutes of navigating around the website.

Any Ideas??? :(
--------------------------------
From: James M

Jul 21 '05 #2
Thank you Nick!
I have relayed the information to the programming team to implement and
test. That seems to be the only issue we have had so far with NLB.
Take Care,
James M.

"Nick Malik [Microsoft]" wrote:
Hello James,
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix


Why?

If your links are relative links, you never need to do this.

..Net is fully capable of being hosted under load balancing without your help
in assigning the URL directly to the host. In fact, the behavior that you
are seeing is probably normal, in that a load balancer using single affinity
will, on its own accord and outside of your control, act as a proxy,
reissuing the request from the proxy FQDN to the actual server. Your
statement above captures the name used by the load balancer and reinserts it
in front of the current page name.

It's as though you WANT to circumvent the load balancer... and I can't
understand why you would want to do that.

Simply make all of your URLs relative, or absolute using the NLB's FQDN and
this issue goes away.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"James M." <Ja****@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB
(single
Affinity, also using SQLServer session state) that are hosting a few .NET
ASP
web applications under the Default Website in IIS, and accessing via a
Intranet LAN (this is not publicly available).

NETWEB1:
NIC1 172.16.17.220
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.221
NETWEB2:
NIC1 172.16.17.222
172.16.17.244 (NLB Virtual IP)

NIC2 172.16.17.223
I'm using the following code in my .NET ASP web applications for all links
on the webpages:

urlSuffix = Context.Request.Url.Host & Context.Request.ApplicationPath
pageUrlBase = "http://" & urlSuffix
The problem is... (referring to a session running on NETWEB1)...

Using Virtual Hostname FQDN (http://nlb.domain.com): Randomly, the a link
will change from the NLB Virtual Hostname to the NLB Virtual IP address,
and
clicking on the link will start a new session, requiring re-login (the URL
is
now http://172.16.17.244).

Using Virtual Hostname (http://nlb): Randomly, the a link will change from
the NLB Virtual Hostname to the Non-NLB Server IP address, and clicking on
the link will start a new session, requiring re-login (the URL becomes
http://172.16.17.221).
This seems to be completely random in timing, but does happen after a few
minutes of navigating around the website.

Any Ideas??? :(
--------------------------------
From: James M


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lukas Schnieper | last post by:
Hi How can i get the hostname of my Linux PC? I tried os.system('hostname') but i cant save the hostname in a variable like hostname = os.system('hostname') thanks Lukas Schnieper
2
by: Walti | last post by:
Hi I stumbled over a strange problem in A2K concerning the Tab Order of 60 textboxes placed on a tab control: whenever I change the TabIndex of any one of these textboxes the other 59 change...
1
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
0
by: James M via .NET 247 | last post by:
(I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup withNLB (single Affinity, also using SQLServer session state) thatare hosting a few .NET ASP web applications under the DefaultWebsite in...
2
by: James M. | last post by:
I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup with NLB (single Affinity, also using SQLServer session state) that are hosting a few .NET ASP web applications under the Default Website...
3
by: Mark Delaney | last post by:
When using the MS SQL 2005 JDBC driver, I now need to have the DNS name resolution to the client correctly set up. If not I get the following error: SQLState: 08S01 SQLError: 0 Message:...
1
by: PaulReddin | last post by:
Hi, We have several instances & Databases on an AIX5.3 Server. We need to change the hostname of the Server, will this break DB2? The only reference to hostname I can "see" is in the Global...
10
by: 7stud | last post by:
Hi, I'm experimenting with a basic socket program(from a book), and both the client and server programs are on my computer. In both programs, I call socket.gethostname(), but I discovered that...
1
by: ksuralta | last post by:
Hi everyone, Hope somebody can help me with this. I have a framed window. -------------------------------- Frame 1 -------------------------------- | 2 | Frame 3
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.