📜 ⬆️ ⬇️

Jelastic - easy and fast swap domains between environments

Jelastic Easy To Manage When updating the application to a newer version, it is necessary to switch users over to the new version as quickly as possible with minimal delays and loss of requests. To solve this problem, different projects use different approaches. One of these approaches is to change the binding of the main domain to the environment with a newer version of the application.
How is the update process in this case? Very millet - you configure the full-fledged operation of the new version of the application in a separate environment, and then change the domain binding to another IP, or more simply switch the flow of users to the updated environment. Of course in this case will occur
problems with the cache DNS servers. Let's analyze what Jelastic (Java Elastic Cloud Platform) offers for solving the problem of updating applications and how to get around the DNS cache problem.

Below is a step-by-step instruction on how to solve a similar problem with Jelastic.

First, create an environment. Let's call it prod-v1 . In our case, this will be the environment with the server GlassFish 3.1. Let's create a simple HelloWorld.war project. Download it to the Deploy Manager and deploy it to our environment.

Jelastic Production V1
')
We tie an external domain to our application. For example, suppose I bought extdomain.org . linked to the prod-v1.jelastic.com domain

Now we will park the domain in an environment.

Jelastic Bind Ext Domain

We check the binding of the domain to the environment

Jelastic Open in Browser V1

Everything went well.
We did the standard operations to bind the external domain to the application.

Next comes the fun part.
Let's make changes to our application, we will create its newer updated version.
Load it into the deployment manager. Make a clone of the current environment entirely and call it prod-v2 .

Jelastic Clone Environment

We will enclose the new version of our application in the newly cloned environment.

Jelastic Deploy App V2

We check its performance and, if everything is ok, we can start changing the main productive version. To do this, open the environment settings panel and select the environment in the Swap Domains area to change the external domain. In our case, this is prod-v1.

Jelastic Swap Domains

Domain change takes place almost instantly and simultaneously for all users.

Jelastic Updated App V2

The problem with the DNS cache in this case is missing, because internal domain resolver is used, which is updated instantly.
To save resources, you can turn off the previous environment or simply delete it.

Plans for the further development of this functionality.


Next, we plan to implement a gradual (smooth) introduction to the system of the new application. Namely, balancing requests between the two environments, gradually increasing the flow of users to the new environment, while reducing the flow to the old, eventually reducing it completely to zero. Then it will be possible to “put out” the previous environment.

PS: Tomorrow is planned to release the next update Jelastic, in which
- support for JEE6 based on GlassFish 3.1.1 (now GF will be available to everyone)
- significantly improved log manager
- PostgreSQL update to version 8.4
Possible temporary unavailability of the control panel environments. However, this does not apply to your applications. All deployed applications will work without interruption.

Soon we will post the next update of the documentation and video .
You can quickly track our news on Twitter and on the Facebook page.

Source: https://habr.com/ru/post/126443/


All Articles