Working with U2 Clients against U2 unirpc Daemon using a different port

Overview

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 Version
UniVerse (Windows) 11.3.1.6018 or later
UniVerse (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.

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.

 

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.

 [root@den-vm-t15]# ./unirpcd -p32438

[root@den-vm-t15]# netstat -na|grep 32438

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

 

[root@den-vm-t15]# 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

Avatar

Paul Chang 9 Posts

Paul Chang is a Principal Technical Support Engineer at Rocket Software. He is responsible for supporting all U2 common middleware client products, Java products and .NET clients. He has 35 years of experience in computing and holds a master’s degree in Computer Science with an emphasis on Relational Database Design.

6 Comments

  • Avatar

    Doug Averch Reply

    June 12, 2019 at 10:04 am

    If as I understand that UOJ is not thread-safe, this may solve that problem. Additionally, It looks like by splitting off processes on to other ports you solve a problem when an errand process takes down UniRPC server daemon and we have to restart Universe/Unidata.

    • Kathy Larson

      Kathy Larson Reply

      June 12, 2019 at 1:12 pm

      The UOJ driver is based on Java. And, while it is thread safe, our UOJ runs in single-thread mode. If you’re running the latest U2 server, the unirpcd daemon has been upgraded to multi-threaded. So, if one thread failed that would no longer take down the unirpcd daemon.

  • Avatar

    Howman Gonzalez Reply

    July 9, 2019 at 5:51 pm

    Hi,

    Try to start unirpc daemon suing port 31439 but you are not listening in the S.O.

    root@siserep1 bin]# ./showuv
    USER PID TIME COMMAND
    root 32728 0:00 /uv/bin/uvcleanupd -config
    root 313 0:00 /uv/bin/uvdlockd -config
    root 32592 0:00 /uv/bin/uvsmm -t 15
    root 32643 0:00 /uv/unishared/unirpc/unirpcd
    root 5327 0:24 /uv/unishared/unirpc/unirpcd -p 31439
    root 32679 0:00 bin/usd /uvspool
    [root@siserep1 bin]# netstat -na | egrep -i ‘31438|31439’
    tcp6 0 0 :::31438 :::* LISTEN

    >CT VOC RELLEVEL

    RELLEVEL
    0001 X
    0002 11.3.1
    0003 PICK
    0004 PICK.FORMAT
    0005 11.3.1
    >
    [root@siserep1 RHLINUX11316022]# ll -rt
    total 391308
    -rw-r–r– 1 root root 12318720 ago 28 2018 XD
    -rw-r–r– 1 root root 189440 ago 28 2018 STARTUP
    -rw-r–r– 1 root root 6819840 ago 28 2018 NLS
    -rw-r–r– 1 root root 225280 ago 28 2018 CVTB
    -rw-r–r– 1 root root 404480 ago 28 2018 UVODBC
    -rw-r–r– 1 root root 1689600 ago 28 2018 UCI
    -rw-r–r– 1 root root 156615680 ago 28 2018 SCA
    -rw-r–r– 1 root root 107520 ago 28 2018 QA
    -rw-r–r– 1 root root 1008640 ago 28 2018 PORTING
    -rw-r–r– 1 root root 208583680 ago 28 2018 MAIN
    -rw-r–r– 1 root root 332800 ago 28 2018 IC
    -rw-r–r– 1 root root 271360 ago 28 2018 GCI
    -rw-r–r– 1 root root 230400 ago 28 2018 FILESIZE
    -rw-r–r– 1 root root 1259520 ago 28 2018 DOC
    -rw-r–r– 1 root root 9912320 ago 28 2018 DEVELOP
    -rw-r–r– 1 root root 697328 ago 31 2018 universe_hotfix_v1131.6022.pdf

  • Avatar

    Howman Gonzalez Reply

    July 10, 2019 at 10:47 am

    Hi!!!

    Try starting another unirpc Daemon using port 31439 but I do not see it listening in the S.O.
    This is using the version of UniVerse 11.3.1 “universe_hotfix_v1131.6020”

    [root@siserep1 bin]# ./showuv
    USER PID TIME COMMAND
    root 32728 0:02 /uv/bin/uvcleanupd -config
    root 313 0:00 /uv/bin/uvdlockd -config
    root 32592 0:04 /uv/bin/uvsmm -t 15
    root 32643 0:00 /uv/unishared/unirpc/unirpcd
    root 20509 9:23 /uv/unishared/unirpc/unirpcd -p 31439
    root 32679 0:00 bin/usd /uvspool

    [root@siserep1 bin]# netstat -na | egrep “31438|31439”
    tcp6 0 0 :::31438 :::* LISTEN
    [root@siserep1 bin]#

    uvrpc 31438/tcp # uvNet rpc port
    uvrpc-2 31439/tcp # uvNet rpc port
    [root@siserep1 bin]#

    What could I be doing wrong?
    Regards!!!!

    Howman Gonzalez
    DBA Universe

  • Avatar

    Howman Gonzalez Reply

    July 10, 2019 at 10:52 am

    I update, I’m using the version “universe_hotfix_v1131.6022”

    • Kathy Larson

      Kathy Larson Reply

      July 12, 2019 at 1:33 pm

      Hi Howman, I shared your comments with Paul. Here’s his reply:
      On UNIX unirpcd command syntax, it is a little different from Windows. The “-p” parameter with the port number cannot be separated with any space.

      Here is an example.

      # ./unirpcd -p31439
      # netstat -an|grep 31439
      tcp 0 0 :::31439 :::* LISTEN

Leave a Comment

Your email address will not be published. Required fields are marked *