on 2012 Oct 12 1:46 PM
I have the following problem: Our software is deployed to several machines. Each deployment of our software installs an SQL Anywhere 10 server instance which is registered to start as a service with the following network parameters:
-n MyServer -x tcpip(PORT=2638,8200-8205) -z -sb 0 -o d:serverlg.txt
We do not currently have a way to know if a given port is taken, and it happenned to us that the port 2638 is taken by another process. According to the documentation of the PORT option, giving a range of ports when registering the service was meant to indicate to the engine to keep trying the ports defined in the range, until it found one that is free. This is sadly not the case.
As it stands, there is no point in providing a range of ports to start, since if the first port is not free, the engine will not start at all.
Is there any workaround for this issue?
Request clarification before answering.
The PORT TCP/IP option on the server indicates that the server is to listen to all of the listed port numbers. This should not be confused with the PORT TCP/IP option that is specified in a client connection string which specifies a list of ports that are tried, in turn, to connect to the server.
Please see this page in the documentation that describes the above.
In your specific case, you should choose a port that is not assigned to any application from tne IANA Ports List and then start your server using that port. Better yet, apply to IANA for a port to be assigned your application since this should guarentee that your port number will not be in use on the computer.
An alternative is to not specify a port number at all and let the server randomly pick one. Your client application can then connect to the server by specifying the host name, server name, and database name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem with letting the Server pick a random port is that we also need to open this port in the firewall during Installation. This was the reason for providing only a range of ports for the engine,so that we just opened a few ports in the firewall. Is there a way to find out which port the engine has taken?
The following should to the trick - it lists all the addresses (including ports) the server is listening on:
SELECT property('TcpipAddresses');
Adding to Volker's comment you can inquiry the addresses via dbping (using additional parms if needed to connect):
dbping -c "UID=dba;PWD=xxxxx;ENG=servername" -ps TcpIpAddresses
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.