Skip to main content

Endpoints

Locale Dropdown

The Endpoints feature at the platform refers to the possibility of TCP/UDP ports mapping via the Shared Load Balancer, which is intended to simplify the instances' collaboration with third-party tools and resources.

This is achieved through providing the ability to establish the direct connection (over either raw TCP or UDP protocol) to the corresponding node, without the mandatory public IP address attached.

Such linking can be used to enable a great variety of different tasks, like remote database management, direct apps' deployment from IDE (for IIS), running multiple project copies on a single instance, accessing a server’s admin panel with no external address bound, etc.

tip

Beside the increased convenience, with endpoints you can cut your spends for the External IP usage, which, otherwise, would be required for such operations. Obviously, endpoints can’t completely replace them, but may become useful in some elementary jobs, and being combined with other platform features (like automatic vertical and horizontal scaling, discounts tiers, etc.) such an approach can help you to significantly save your money.

Follow the instruction below to find out how to work with endpoints at the platform and discover a few interesting use-cases to try them by yourself.

Endpoints Managing

The list of endpoints can be accessed via the environment Settings menu, that opens through selecting the same-named button for a particular environment.

Locale Dropdown

Within the opened tab, switch to the Endpoints menu item. Now you can start working with your mapping’s list:

Adding Endpoints

To create a new endpoint, click the Add button from the top tools' pane and fill in the appeared Add Endpoint form with the relevant data:

Locale Dropdown

  • Node - select the instance you’d like to set the endpoint for (here only the comprised in the chosen environment nodes are displayed)
  • Name - either type the title for a new endpoint or choose one of the preconfigured options (the corresponding list is provided just down the page)
  • Private port - specify the preferred local node’s port to be used for mapping (it’s substituted automatically in case the predefined Name was selected)
  • Protocol - select either TCP or UDP

The rest of fields, i.e. Public port and Access URL, will be configured by the platform automatically.

Select Add when ready.

tip

For more convenience, we provide the embedded list of predefined endpoint configurations, based on the protocol or purpose implied:

Connection Name

Private Port

Remote Desktop
3389
PowerShell
5986
SMTP
25
FTP
21
DNS
53
HTTP
80
POP3
110
IMAP
143
LDAP
389
HTTPS
443
SMTPS
587
POP3S
995
IMAPS
993

Optional*

RDP
3389
DEPLOY
8172
{database_name}
{database_port}

*Optional values availability depends on the type of the chosen node:

  • database nodes are provided with the default endpoint, named after themselves and with the appropriate port stated
  • Windows-based containers have the additional RDP (3389) connection
  • IIS application server has the DEPLOY (8172) connection for the direct project deployment from IDE

Locale Dropdown

Here you’ll find the Public port and Access URL actual values already displayed. You can use these parameters to perform the required operations - just click on a particular string to get the opportunity to easily copy it.

Note

that for linking functionality to work properly with the VPS and Docker® containers, the corresponding private ports (stated during the endpoint addition) at these nodes should be opened by the owner manually.

Edit/Remove Endpoint

Any existing endpoint can be easily edited or removed in case of further unnecessity. For that, just select the desired connection within the endpoints list and click the Edit (either use double-click on the required line) or Remove button, located at the tools' pane above.

Locale Dropdown

Depending on the option chosen, you’ll see the following:

  • Edit - in the appeared Edit Endpoint form (which is completely similar to the Add one) you can modify all the abovementioned settings except the Node choosing (as this makes no sense - you could just add a new similar endpoint to the required instance).

Locale Dropdown

Once the required changes are made, just Apply them with the same-named button at the bottom of the frame.

  • Remove - the special pop-up frame will appear, where you need to confirm your decision:

Locale Dropdown

Just after that, the corresponding endpoint will be removed from the list.

Endpoints Use-Cases

Once the required mappings are configured, you can apply them for running different tasks. To make it easier to start, below we’ll describe a few most common endpoints' use-cases that you can benefit from.

As an example, we will use an environment with the Apache application server and MySQL database (you can create the similar one following this guide):

Locale Dropdown

Now, let’s learn how to use endpoints for:

Database Management

With endpoints, gaining remote access to your DB instance becomes pretty easy, as using this feature eliminates the necessity to acquire any additional options like a Public IP. To show this, we’ll consider two simple ways of performing this operation: through embedded OS terminal and third-party DB client.

Connection via Terminal

The most common approach is to use the embedded terminal of your local machine, as this does not require any additional installations or configurations and provides sufficient functionality for a simple connection establishment - just a single command is required:

mysql -h {host} -P {port} -u {user} -p

Locale Dropdown

where:

  • {host} - endpoint Access URL without the port suffix specified (node30292-env-with-endpoints.jelastic.com in our case)
  • {port} - public port number assigned (10011 in this example)
  • {user} - database user name (the platform has sent it to you via email during the environment creation - by default it stands for root for all the new MySQL servers)

After the connection validation, you’ll be requested for the appropriate DB user’s password (it can also be found in the abovementioned email) in order to access your database.

That’s all! Now you can start working with your database through executing the required SQL queries.

Connection via Local Client

In the case you require advanced functionality or if you are used to managing the data stored within your database with more convenience, a type of database desktop client may come in handy here. It will provide you with a user-friendly graphic interface and the variety of included features to accelerate your work.

For an example of such a client, that will help to establish the remote connection to our database through the created endpoint, we’ll use one of the most popular DB management tools - MySQL Workbench.

  1. Run the abovementioned application and click the New Connection button.

Locale Dropdown

  1. In the appeared Setup New Connection frame, fill in the following fields at the top:
  • Connection Name - set an appellation for your connection (e.g. jelastic-db)

  • Connection Method - choose the Standard (TCP/IP) method

Locale Dropdown

Then, specify the required DB data inside the Parameters tab beneath:

  • Hostname - endpoint URL without the port number specified at the end (node30292-endpoints.jelastic.com in our case)

  • Port - the endpoint’s public port (we got port 10011 assigned during its addition)

  • Username - name of the admin DB user (the platform has sent it to you via email during the environment creation - by default it stands for root for all the new MySQL servers)

  • Password - either click Store in Keychain to enter and save your pass (which can be found within the same email) or skip this field to specify it during each connection attempt

  • Default Schema - the database schema to be used by default (can be also left blank) Click OK to complete.

  1. Double-click on the newly appeared connection record to initiate its establishment and specify your password in the appeared frame (if you haven’t saved it before).

Locale Dropdown

You can also tick Save password in keychain if you don’t want to enter it manually each time you need to access your database. Click the OK button to proceed.

  1. In a minute, you’ll be connected to your DB.

Locale Dropdown

Great! Now you can start organizing your data using all the provided benefits of the full-featured management client.

Just in the same way you can connect to any other database server within the platform or, for example, backup and restore your data within dump files.

Multiple Development Stages at a Single App Server

Beside the elementary operations of DB management, endpoints also give the ability to implement a variety of useful and interesting solutions for other servers. Below we’ll examine one of such beneficial possibilities this feature ensures - how to use a single application server as your production and development environment simultaneously (with the Apache instance from our environment as an example).

  1. So, map the endpoint to your Apache server with the preferred unused private port opened.

Locale Dropdown

note

Do not choose port 80 as private port for this task, as Apache uses it by default for the incoming HTTP-requests handling. Otherwise, the whole process, described below, will become pointless.

  1. Now, deploy your application twice to different contexts (e.g. prod and dev).

Locale Dropdown

  1. The next step is configuring Apache itself - thus, click the Config button next to this server and open its main configuration file (the conf > httpd.conf one).

Locale Dropdown

  1. Scroll down and add the following string to the registry of listened ports:
Listen 0.0.0.0:{port}

Locale Dropdown

Here, the {port} parameter should be substituted with the private port number you’ve stated during the addition of the endpoint (we’ve chosen the 81st one).

  1. After that, move to the end of the file and duplicate the VirtualHost section, specifying the corresponding port number (the same as in the step above - 81st in our case) within its heading.

Locale Dropdown

Then adjust the appropriate DocumentRoot locations for both virtual hosts with the corresponding projects (prod - for the default one and dev - for the custom section beneath).

  1. Save the performed changes and Restart the Apache server to apply them.

Locale Dropdown

  1. Now you can connect to your prod project as usual, e.g. using the Open in browser button (or entering the external custom domain if one was additionally bound to your app), while for accessing its dev version, you just need to specify the used endpoint’s Access URL.

Locale Dropdown

As a result, you’ve got two connection points to your two projects, which allow you to perform any desired testing or development tasks at one of the copies, with zero influence on the another one. Moreover, they can be swapped in a few clicks if necessary.

Stay tuned for more useful examples of practical endpoints' usage in the nearest future.