As the demand for PaaS and DevOps solutions grows, we can see that legacy applications running on virtual machines or running directly on bare metal encounter a series of obstacles in practice. The process of decomposition and migration is very complex. Often, in order to get the benefits of PaaS or CaaS mode, application owners must redesign their application architecture.
In this article, we'll analyze the specific challenges of migrating Java legacy applications running on virtual machines to container-based platforms. Using Oracle WebLogic Server as a case, we will show the specific steps of the decomposition process and the results of the migration.
Motion to migrate to container
Comparing Java EE applications running in the era of bare metal, hardware virtualization has been a big step forward. It gives us the ability to resolve isolation between multiple applications and improve hardware utilization. However, Hypervisors use a lot of CPU and memory on the host, and each virtual machine requires a full operating system
, TCP stack, and file system.
Each virtual machine has fixed memory, and only a subset of hypervisors can redistribute memory for running virtual machines with the help of a memory ballooning mechanism. So in order to scale the future of the application, we reserve some resources in each virtual machine, but these resources are not fully utilized. At the same time, these resources cannot be shared by other programs due to the lack of proper isolation between instances within a virtual machine.
The container can be run with only a small amount of resources and CPU through the OS kernel, TCP stack, file system and other system resources of the shared host, further improving performance and resource utilization. .
There are two types of containers —— application containers and system containers. Typically, an application container runs as a single process. A system container is like a complete operating system, which can perform all the functions of the operating system in a single container, such as systemd, SysVinit, and other processes like openssh, crond and syslogd generated by openrc. Both types of containers are very useful in different usage scenarios, and do not waste memory on redundant management processes, typically consuming less memory than virtual machines. However, the migration of Java legacy applications can only require a large amount of application refactoring using system containers.
Different from virtual machines, it is easy to modify the restrictions on the container resources of the running instance without restarting. Moreover, these resources that are not consumed within the restricted boundaries are automatically shared with other containers on the same physical node.
In addition, containers are also very useful for development, using an agile approach to creating, packaging, and testing applications to speed up application start-up and increase application scalability.
These resources that are not utilized on physical machines can be easily extended or used by new application containers. Given the increased isolation of containers, different types of applications can run on the same physical node without affecting each other. These can average 3-10 times the utilization of existing infrastructure resources.
What is decomposition?
In the migration process, program decomposition is the basic part, which can help to break large single-block applications into small, logical blocks, and can run independently. program.
The figure shows a simple decomposition process applied when migrating from a virtual machine to a container:
Running Java legacy in a virtual machine Applications
There is an old saying in software development: legacy software is good, just old software that is still running. Let's take a closer look at how it works on Oracle Weblogic Server.
Structure of Oracle Weblogic Server in Virtual Machines
When running in a virtual machine, Weblogic Server contains three types of instances:
The management server is the central node through which you can configure and manage the cluster. All resources in . It adds or removes managed nodes by connecting to the Node Manager. The managed node runs web applications, EJBs, web services, and other resources.
Typically, one node manager and multiple managed service servers are running on each virtual machine, and one management server manages all instances on all virtual machines.
Extending WebLogic with Virtual Machines
Now imagine that you will need to scale your cluster when traffic spikes occur, and new managed servers will be added to the virtual machine to handle the growing load until There is no resource allocation.
But when traffic is still growing and the number of instances of currently managed services is insufficient to handle the load, a new virtual machine is needed to handle the further growth of the program.
Typical extension of WebLogic through multiple virtual machines involves three steps:
Then, this extension The steps are repeated, and the newly added virtual boot starts more managed servers until the resource is restricted.
The disadvantage of running WebLogic in a virtual machine
Running Oracle WebLogic in this way is a very low resource utilization method. Here are a few resources waste. Or unused points:
Migrating from a virtual machine to a container
These days, we found several excellent application servers and frameworks designed to run microservices in containers, such as Spring Boot, WildFly Swarm. , Payara Micro, etc. In any case, there are a series of server designs running on virtual machines, such as Oracle WebLogic Server, and the task of migrating instances of this type into containers is more complicated. This is why we are more concerned about this topic.
WebLogic Server Decomposition
The decomposition of these days is a fairly easy task with the help of Docker containers. First, we need to prepare a container image with WebLogic Server. (Mirroring is available from Oracle's official repository).
When the Docker template is ready, we specify each instance in a separate container: a management server and the required number of managed servers.
Here, we gave up the node manager for adding and removing managed nodes.
After migrating to a container, the managed server instance can be automatically added and removed through the container orchestration platform and a series of WSLT scripts, just like the management node.
This way, we get a very simple Weblogic Server Cluster structure.
Because containers are easier to configure or clone from scratch, the horizontal expansion process becomes very fine-grained and smooth. Also, each container can be quickly started or stopped with almost no downtime. Containers are much lighter when compared to virtual machines, so scheduling containers is less time consuming than scheduling virtual machines.
The benefits of running WebLogic in a container
While migrating an application to a container is a challenge, but if you know how to manage it, you can get the following benefits:
You can use the same way to help break down other layers of your application, or apply other Java EE application services. In the next topic, we will describe how to handle the entire process of decomposed data through a specific case.
According to the bus structure, it can be divided into a bus type and a non-bus type. As we often
Think about it, what if you want to change the size of an image to a smaller size? Of course, I will
Download Compile and install is very simple, several common dependencies must be installed first, so
I. Manually compile and install 1, download the installation package, wget https://ohse.de/uwe/rele
How to view the operation record after user login under Linux
Detailed Linux system startup process and system initialization
Linux environment programming - ftok () function detailed
Squid3 reverse proxy installation and configuration basic tutorial
10 tips on command line autocompletion in Linux
Example of initialization file for rom under ISE
View file encoding, file encoding format conversion and file name encoding conversion under Linux
Sleep function under Linux, fflush function and buffer problem
Teach you how to complete Linux network address configuration
How to solve the NIC under Win10 system?
Microsoft decided to optimize the Win8 installation process through Web download
View your computer's ip external network address diagram tutorial
Windows 7 system font display is not normal how to solve?
What can I do if the Win10 app store can't download the app?
Win 10 store adds new, added "film" channel