Specifying the Command Port to be used by a Smart Data Streaming Project
I’ve been working with some cloud based HANA Smart Data Streaming servers lately and learning more about the TCP ports that are used by various components in the system and how to configure them.
One of the luxuries of using an on premise installations inside a corporate network is that you don’t usually have to worry about configuring specific ports on your servers. As long as the software is using a common network protocol such as TCP, then generally speaking all traffic is allowed within the secured corporate network. When you transition to working with cloud based servers that reside outside of your corporate network, then industry standard best practices are to limit the number of open ports both for outbound traffic from within your corporate network and for inbound traffic to your server instance running on the cloud platform.
Several of the ports used by HANA and Smart Data Streaming are configured and set at a server level. For example the port used to connect from the SAP HANA Streaming Run-Test perspective in HANA Studio to the Smart Data Streaming server has the form 3XX26 where XX = the instance # of your HANA system. However there are also three ports required for each project which have to be allocated on a per project basis. These are the Command Port, SQL Port and Gateway Port. By default these ports are allocated dynamically each time you start an instance of the project. The benefit of having these ports dynamically allocated is that if you are running several different projects, you don’t have to worry about manually tracking and configuring the ports used by each project to avoid conflicts between 2 different projects. Instead, the streaming server will pick any available ports at the time the project is started.
Dynamically allocating the TCP ports used by each project works great inside a corporate network, where the full range of TCP ports is normally accessible. In contrast, when you have your streaming server hosted in a cloud environment then having the project allocate different port #s for the Command, SQL and Gateway ports each time the project is stopped and started would be really painful. The good news is that Smart Data Streaming allows you to specify the exact port #s to use for each of the Command, SQL and Gateway ports in the project configuration (.ccr) file.
To set the port #’s, you need to go to the SAP HANA Streaming Development perspective and open the project configuration file which has a .ccr extension. Then you need to click on the “Advanced” tab and the “Project Deployment” item. You can then scroll down through the list of “Project Deployment Details” until you get to the settings for the Command Port, SQL Port and Gateway Port.
Suggested values are shown for each of the ports, but these aren’t active until you check the box next to each option, save the configuration file and redeploy the project.
Now when you start the project, it will specifically use the specified port #s for the Command, SQL and Gateway ports. This means that you only need to open these specific port #s on your streaming server for your project. Keep in mind though, that if you are running multiple streaming projects on the same server, then each project will need a distinct set of ports and that as you add projects to the server you will need to open the additional ports for the new project.
For detailed technical information, see: ESP Client Connectivity