Creating an alias

  • We're in the process of consolidating our 2 db servers down to 1. To facilitate the process I wanted to create an alias from server B to sever A so that any and all requests for server B are routed to server A. I followed the steps in the article below:

    http://www.mssqltips.com/tip.asp?tip=1620

    ... but my ColdFusion web app is failing.

    The data source ColdFusion is using refers to 127.0.0.1\myDB (the db and web server are on the same server :pinch: ). I created the alias with the following parameters:

    ALIAS NAME: 127.0.0.1

    PORT: 1433

    PROTOCOL: TCP/IP

    SERVER: 192.168.1.114\myDB

    ... I also tried it without specifying the "\myDB" part as well. This is the error I get:

    Cannot open database "siteadmin" requested by the login. The login failed.

    127.0.0.1 = the old server

    192.168.1.114 - the new server

  • You can't use an IP address as the alias, and especially not the loopback address (127.0.0.1). The loopback address is a TCP/IP reserved address meaning "this machine I am on", so it can't be redirected/changed/pointed elsewhere.

    Sorry to say - but you're going to need to change your app a little.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Thanks for the quick reply Matt. I didn't think that the local IP address as the alias looked right but it was the last of many iterations. I am still unclear as to what the alias should be so that the app continues to function. I need all requests to go to a specific database on the new server.

    I know this is a stretch but... Is there some piece of information I can provide that will make it easier for you to tell me what the alias should be?

    Thanks in advance...

  • Personally - I'd put the server name in the web.Config (or some include file allowed by ColdFusion) instead of hard-coding it everywhere. When you need to connect to the DB, you go look the server name first, then set up your query. That way you're not playing with SQL aliases at all (this is ultimately not a game your Web App should need to play).

    Otherwise - look at possibly putting an entry into the HOSTS file. Lots of help on the from a Google search (that's how I remind myself how to do them when I need one).

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Doesn't coldfusion use DSN's to connect to the database servers? As such could you not just change the DSN to point to the other database server?



    Shamless self promotion - read my blog http://sirsql.net

  • Yes, I could do that and will. However, there are other processes that connect to the old server that I can't easily modify.

  • Hi LOS,

    We, too, use CF (7.0.1)

    CF *does* use DNS to connect to databases by server nane *or* by IP, but unfortunately it stores the info in an XML file (look for "C:\CFusionMX7\libeo-query.xml" or the like.) and does NOT use the DNS info stored by the OS.

    Therefore, CF doesn't look to the data stored in your Alias configuration.

    What I've done on occasion is to make a copy of the XML file, edit the various entries to point to the different server, then swap the XML files when I need to switch. BUT: you'll need to restart CF when swapping the files since CF caches the connection.

    Hope that helps,

    Mark

    Mark
    Just a cog in the wheel.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply