Working With U2 Clients Against U2 Unirpcd Daemons Using a Different Port

Paul Chang

June 12, 2019

Using multiple unirpcd daemons to balance client requests can have a positive impact on performance. Also, using a different port for a specific application simplifies management. And, if users are on a newer version of UniData or UniVerse, they might want to use a different port specifically for a secure connection.

On newer versions of UniData and UniVerse, multiple Unirpcd Daemons with different port numbers on Microsoft Windows is supported. When you install UniData or UniVerse, the unirpcd daemon uses deaful port # 31438. This allow all U2 clients ti connect to the UniData or UniVerse server without any additional setting. You might want to start two unirpcd daemons with two different ports for shared unirpcd daemon loading. This blog provides details on U2 clients working against the Unirpcd daemon with different port setting., e.g. # 32438.

REQUIREMENTS

Data Server Verson
UniVerse (Windows)

11.3.1.6018 or later

Univers (UNIX) 11.3.1.6022, 12.1.1 or later
UniData (Windows) 8.2.1 or later
UniData (UNIX) 9.0.0 or later

On UniVerse 11.3.1.6018, users can create a new unirpcd daemon with a different port. This feature with more options will be implemented in future UniData and UniVerse versions.

WINDOWS UNIRPC DAEMON SYNTAX

unirpcd -i [-n “name-of-service”] [ -p xxxxx] [-m “Description”]
• -i – install new windows service
• -n name-of-service – Windows service name
• -p xxxxx is the port number of the unirpcd listener
• -m Description – Service name description

The next example is to start another unirpcd daemon on Windows with port # 32438. You must start a command prompt in administrator mode and run the unirpcd command with the option.

C:\U2\unishared\unirpc>unirpcd -i -p 32438 -n “Uni RPC Service – 32438” -m “unirpcd_32438” unirpc-32438 installed.

unirpc1

You can use Windows Service control to start the service or the net start command.

C:\U2\unishared\unirpc>net start “Uni RPC Service – 32438”

The Uni RPC Service – 32438 service is starting.

The Uni RPC Service – 32438 service was started successfully.

If you want to remove a newly created service name, you can use the “-r” parameter to remove it.

C:\U2\unishared\unirpc>unirpcd -r -p 32438

Are you sure you want to remove Uni RPC Service listening on port 32438? [y|n]: y

unirpc-32438 removed.

For other U2 clients, it might be different to set a new port. We will use the following samples to explain the different port setting.

For UniObjects, U2 Toolkit native, uci and JDBC connection, you can specify the port number in the host field using the colon “:” as a delimiter. For example, you could set it to “localhost:32438” for using the port # 32438 daemon.

unirpc2

When using the U2 ODBC client, you can define the port number inside the host field in the U2 ODBC UCI configuration (uci.config) file.

Here is an example for the localuv data source defined in the uci.config file.

< localuv >

DBMSTYPE = UNIVERSE

network = TCP/IP

service = uvserver

host = localhost:32438

In the UO.NET session object, you can specify the port number # 32438 instead of the default # 31438.

Here is the sample UO.NET session syntax.

Uonet_session = UniObjects.OpenSession(“localhost”, 32438, “administrator”, “password”, “HS.SALES”, “uvcs”)

It is similar for UniObjects for Java (UOJ) connection. You need to set the host port in the session object.

Here is another sample syntax for UOJ.

uSession.setConnectionString(“uvcs”);

uSession.setHostName(“localhost”);

uSession.setUserName(“Administrator”);

uSession.setPassword(“password”);

uSession.setAccountPath(“HS.SALES”);

uSession.setHostPort(32438);

UNIX UNIRPC DAEMON SYNTAX

unirpcd -pxxxxx

The next example is to start another unirpcd daemon on UNIX with port # 32438. You must add a new service name in the /etc/services file.

[[email protected]]# ./unirpcd -p32438

[[email protected]]# netstat -na|grep 32438

tcp 0 0 :::32438 :::* LISTEN

 

[[email protected]]# netstat -na|grep 32438

tcp 0 0 :::32438 :::* LISTEN

tcp 0 0 ::ffff:9.72.197.215:32438 ::ffff:10.14.4.50:19288 ESTABLISHED