How to run two or more versions of Firebird simultaneously?


By Paul Reeves 18 June 2007

http://www.ibphoenix.com/resources/documents/search/doc_43

Notes and Prerequisites

* This document uses the term Firebird to refer to all versions since v1.5.0. It does not include v1.0.
* Firebird v2.1 supports running multiple firebird services. This feature is not discussed here. If you're running Firebird 2.1, read the section "Installation with a different service name" in file install_windows_manually.txt in "doc" directory of your Firebird installation
* This document discusses running Firebird on Windows only. Similar principles allow running multiple versions in a posix environment, but the details of this are not discussed.
* This discussion assumes you are logged in as administrator.
* An underlying premise of this document is that you want install and run two different versions of Firebird. See point 7 for info on how to run two instances of the same version.

Firebird does not currently support running multiple instances as Windows services. This fetaure will come with V2.1. However, secondary instances may be run as applications. Here is how to proceed:

1. Stop your primary installed Firebird service (if any.)
You can use the control panel applet, or you can open a console window and use instsvc:

instsvc q

will show you if Firebird is currently running. Type:

instsvc sto

to stop the service.

2. The server and the client library uses the FIREBIRD variable to locate various resources. This is undesirable if we run multiple instances. To check your environment for the FIREBIRD environment variable type at the console prompt:

set FI

If FIREBIRD is defined then press [Windows Key + PAUSE] to bring up the system properties dialog, switch to the advanced tab and click on the 'Environment Variables' button. Delete the FIREBIRD env var.

3. Check for fbclient.dll and gds32.dll in your Windows system directory. Placing the client library in <sys> is useful to simplify installation of a single engine. Like the FIREBIRD variable it can get in the way of running multiple servers. At the command prompt type:

instclient q f

If installed then type:

instclient r f

to remove it. Then repeat for gds32.dll:

instclient q g

instclient r g

If something goes wrong at this point it will be necessary to remove the files by hand and manually edit the registry entries for shared libraries.

4. Install a second version of Firebird using the binary installer.

* DO NOT accept the default directory.
* DO NOT install Firebird as a service. (ie, run as an application.)
* DO NOT install the guardian.
* DO NOT install the control panel applet.
* DO NOT copy gds32.dll to the system dir.
* DO NOT start Firebird at the end of the installation session.

5. Edit the newly installed firebird.conf file in your favourite text editor. Some or all of the following settings need to be modified from the defaults. (Remember to remove the # - all text after it is considered a comment.)

tcp/ip
------
#RemoteServiceName = gds_db
#RemoteServicePort = 3050


You can use a different RemoteServiceName, but if you do it needs to be added to the services file. (Typically found in <sys>\drivers\etc). Generally, it is easier and quicker to just use a port number, ie, change the value assigned to RemoteServicePort.

NetBeui and pipes
-----------------
#RemotePipeName = interbas
#CreateInternalWindow = 1
#IpcName = FirebirdIPI


Not discussed in this document.

Other settings of possible interest

#RemoteAuxPort = 0

This is used for events. It should not need changing unless you are behind a firewall. ie, if you have changed the value used by your primary installation you should also set it (to a different value) for secondary installations. And don't forget to open the port on the firewall.

#RemoteBindAddress =

Allows you to specify the network interface that the server listens on. The default is all.

6. Restart your primary server as a service or application as desired. You can use the control panel applet for this, or else instsvc.

7. Start your secondary server from the console prompt, or create a shortcut and place it somewhere convenient. The important point is to use the -a switch to start Firebird as an application.

c:\mysecondfirebird\bin\fbserver.exe -a

8. Connect to your server with syntax similar to the following:

isql localhost/30500:c:\path\to\my\database.fdb

or

isql localhost/fb_db:c:\path\to\my\database.fdb

if you have defined a service name.

9. Alternatives

The Firebird V1.5 release notes documents a method of specifying a port number when launching a server. This is useful if you want to run two instances of the same server from a single installation. No modifications of the firebird.conf file are required.


Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.



All contents are copyright © 2007-2024 FirebirdFAQ.org unless otherwise stated in the text.


Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

Categories
 Newbies
 SQL
 Installation and setup
 Backup and restore
 Performance
 Security
 Connectivity and API
 HOWTOs
 Errors and error codes
 Miscellaneous