Setting fixed port for Orbix Naming service
We are using Orbix Iona 6.3 server configured using itconfigure. Recently we migrated our clients to different eviornments where we have many firewall constraints due to which only a few set of ports are open.
So the problem is that the Naming Service listens on a random port each time it is started. Is there any way to use fixed ports for naming service.
If your Naming Service (NS) is starting on a random port then it must be indirect persistent, which means that the port of the locator is stored in the IORs. This would be 3075 by default. Requests go to the locator for the initial connection establishment and are then redirected to the NS. All subsequent requests go directly to the NS. The benefit of this approach is that the NS can be started on demand as needed and does not require ports to be reserved for it. However, as you have seen the ports assigned are random.
You have a couple of options here. You can reconfigure your domain to start the NS standalone at domain start-up on a persistent port and repopulate the contexts in the NS. If you do this you can simply configure the port that the NS listens on at that time. However, you do need to check how easily you can rebuild the context tree. The benefit of this would be you only need to make the port of the NS available through the firewall.
If you want to keep your current setup and make the Locator's port (3075) and the port of the NS available then you need to update your configuration and have the NS always listen on a persistent port. The config for this is:
By default this is set to 0, which means pick a random port. Note you will need to ensure no other process takes this port or else your NS will not be able to start.
Finally don't forget that the services registered in the NS will also need their ports available through the firewall.
Hope that helps!
Which configuration file do we need to set this value.
In my domains directory ,I can see two cfg files
and another cfr-<domain>.cfg
Also is this the way to set it
plugins:naming:iiop:port = "55234"
I tried to set the value as above in bothe above cfg files but still itnaming is listening to a different port.
I set the port using below itadmin command
itadmin variable modify -scope iona_services.naming.omisX -type string -value 55425 plugins:naming:iiop:port
but still client is getting a different port other than the one I set ,After analyzing the itnaming process I could see naming service is listening to 6 other ports apart from the port which I set. and server is giving one of those ports.
Is there any way to set at least the range of ports for the naming service.
Thanks a lot for your time.
How are you distributing the IOR to the clients you may also need to update the new IOR for the NS in the configuration plugins:NameService:initial_reference.
You can find the IOR you should update this with by doing an itadmin ns resolve
This will return the IOR for the root context. You can double check with iordump that this is updated with the new port.
Are you certain your NS is starting using -ORBname iona_services.naming.omisX ?
Check your start_<domain>_services script to be sure of this.
I assume you have restarted your NS? You need to do this to get it to pick up any new configuration.
Are you certain that the NS was restarted after you made this change? What is the exact Service Pack of Orbix that you are on? The latest is Service Pack 7.
I tested this on my side and it is working fine for me.
I am using Iona 6.3.3. I modified the ports used by naming using itadmin
itadmin variable modify -scope iona_services.naming.omis277 -type string -value "53000:53100" policies:iiop:server_address_mode_policy:port_range
THen I restarted the iona services and I could see NS comming in the range of 53000-53100 ......
BUT now i am in different issue....when i started my application ...it is started in different port outside my range.
so now when client is trying to connect to server ,it is failing creation of naming context by saing it is not able to connect to my application port.
what could be the possible issue.
Thanks for your time.
The -scope argument that you pass in matches the -ORBname parameter passed to any Orbix application. In this case you will only set the port_range for the NS and not for any of your other Orbix applications. If you want you can set this at the global scope by not passing in the -scope argument to the itadmin variable command. This will then set it for all applications not just the NS.