Published February 25, 2023 by

How to launch Linux OS from EC2-instance as GUI ?

 

In this article, I will set up a GUI environment from AWS EC2 services AMI Linux Images which is Deafut as CLI.

Let's go through each step to find the way to launch in GUI mode.

  1. AWS Account
  2. MATE desktop environment
  3. Any VNC Services (TigerVNC)
  4. Tiger VNC Client Software On your Host Windows OS
  5. For a Better hands-on, Use Putty as a Remote login via SSH to access the Linux

Here, I have Guided you with the Steps to be followed,

Launch an instance with the Configuration of AWS

If you have already launched an Instance and want to proceed with manual GUI installation, then do the following:

  1. Install the MATE desktop environment, a lightweight GUI based on GNOME 2 available as an extra for Amazon Linux 2
  2. Install the MATE desktop environment manually.
  3. Install a VNC service like TigerVNC. To download Check Out the tigervnc.org website.
  4. Connect to the GUI using the VNC.

Here we use the Pre-Setup configured MATE desktop environment.

  1. Open putty, Enter your instance Public IP in the Hostname and connection type SSH type.
  2. Now go to Connection > SSH > Auth > Credentials.
    Upload your ppk file, which we have downloaded from Amazon in Step-3.
  3. Select Open.
#grep PRETTY_NAME /etc/os-release
sudo yum updates

This is to Update the Sofware programs as a whole.

The Packages are updated.

sudo amazon-linux-extras install mate-desktop1.x
sudo bash -c ‘echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop’
sudo yum install tigervnc-server

Configure a VNC-specific password, then limit VNC network access to the local host, so that VNC can only be accessed via a secure SSH tunnel.

Then, create a mandatory configuration file that includes the localhost option.

Create the tigerVNC configuration directory

vncpasswd
sudo mkdir /etc/tigervnc
sudo bash -c 'echo localhost > /etc/tigervnc/vncserver-config-mandatory'
sudo cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service

Replace all occurrences of USER in the new unit with ec2-user using the sed command. Reload the systemd manager configuration after that.

Start the service.

sudo sed -i 's/<USER>/ec2-user/' /etc/systemd/system/vncserver@.service
sudo systemctl daemon-reload
sudo systemctl enable vncserver@:1
  • Enter your Instance public IP in the Hostname and “connection type” SSH type.
  • Now go to Connection > SSH > Tunnel
  • In Source port, Add 5091 and Destination- “ localhost:5091” then click on add.

Click on Open.
Now Start the service with the following command —

sudo systemctl start vncserver@:1 
sudo systemctl status vncserver@:1
sudo systemctl enable vncserver@:1

Now, When Going to the tigerVNC client which,asks for the VNC server hostname, enter “localhost:1” and then click on connect button.

Enter the VNC password that you set up previously.

Here is your GUI running on the Amazon Linux2 image.

Thank you !!

Read More
Published November 27, 2022 by

Microservices Architecture and Companies getting benefited from Microservices

Nowadays, many companies, such as Netflix, Amazon, and eBay, have migrated their applications and systems to the cloud, because the cloud computing model allows these companies to scale their computing resources as per their usage.

Monolithic vs Microservices

Monolithic architecture is an application with a single code base that includes multiple services. These services communicate with external systems or consumers via different interfaces like Web services, HTML pages, or REST API

Microservices Architecture is an approach to developing a suite of small services working as a single application. The services are communicating through lightweight mechanisms, such as an HTTP resource API and each service is running independently in its own process

Monolithic: Brief

Build an application with a monolithic architecture application with a single code base that includes multiple services.

For example:

  • a single Java WAR file.
  • a single directory hierarchy or NodeJS code




Here, we have designed an e-commerce application with Monolithic Architecture.

We have added the big e-commerce box; those are the components of our e-commerce application: (Modules)

  • Flights
  • Hotels
  • Trains
  • Buses
  • Cabs

As you can see, all modules of this traditional web application are single artifacts in the container.

This monolithic application has a massive codebase that includes all modules that are tightly coupled in a monolith codebase.

→ Simply like, All Program code of modules in one File (.jar).

Once the application becomes huge and the team Clients grow in size, this approach has a number of drawbacks that become increasingly significant



Drawbacks in Monolithic Architecture

  1. Difficult to understand code and Update new features
  2. Slower the Deployment
  3. The scaling of the Application is DIFFICULT.
  4. If any one of the modules (Like Cabs alone, ) gets Clients to hit in massive simultaneously then for scalability, the Entire App needs to be Deployed in the Container
  5. The entire Application needs to develop in the Same programming language for the Whole Application. As it cannot be possible or if any new module needs to create in another Programming language.
  6. Infrastructure development will be difficult
  7. Dependencies cause errors in the entire app if any changes are done in another module. (Fights — —> CoupounCode)
  8. The performance of one module will impact other

Monolithic architecture has many disadvantages, but for building a small application, monolithic architecture is one of the best architectures you can apply to your project.

Microservices

Microservices architecture will ease the Monolith drawbacks processes such as maintainability, reusability, scalability, Dependencies, availability, and automated deployment when it will be utilized, and these are considered the advantages of microservices architecture

So, Now Microservice is like,


Here, It is not a Monolith, as we have Independent services/Modules among them, Some of the Points in Microservices are given below.

Aspects of Microservices

  1. Small in size
  2. Single-responsibility
  3. Loosely coupled
  4. Explicitly published interfaces
  5. Lightweight
  6. Communicating via REST and HTTP
  7. Polyglot set of microservices (written in more than one language)
  8. Better performance in terms of throughput when it is used for a large number of requests
  9. A microservice application that will provide the backend capabilities by exposing the API
  10. The microservices gateway is the frontend of the whole system which will include all the APIs of every microservice application in the system
  11. Microservices governance is decentralized.



General overview of microservices architecture

The main advantages of a microservices architecture are

  1. Microservices can rely on technology heterogeneity, which means each service in one system can use different technology than the other services to achieve the desired goals and performance
  2. If one component of the system fails then it does not affect the whole system.
  3. The process of scaling can be more accessible compared to monolithic application scaling because only the services that need actual scaling are scaled in the microservices architecture, contrary to a monolithic application requires to be scaled as a whole unit which may lead to higher hardware usage
  4. The ease of deployment is because with microservices each service can be deployed independently without affecting the performance of other services.
  5. Microservices architecture helps companies to align their architecture with their organizational structure, which will help them to minimize the number of people that are working on a specific codebase.
  6. Consequently, microservices enable organizational alignment. Further advantages are composability and optimizing for replaceability
  7. Each Module Service is independent of the programming language
  8. In this, the servers can communicate with other module servers.
  9. Distributed Software System.
  10. Fault tolerance.
  11. Communicating via REST and HTTP most widely popularly used, but there are other alternatives to REST, such as RPCs as not many are used currently.
  12. On the other hand, in the monolithic architecture, applications can be created of tens or hundreds of different services that are tightly coupled in a monolith codebase. Here, Each service can be maintained by different Dev teams and can build an efficient APP.



MIcroservice In travel Booking App

Here, we have designed an e-commerce application with Microservice Architecture.

We have added the big e-commerce box; those are the components of our e-commerce application: (Modules)

  • Flights
  • Hotels
  • Trains
  • Buses
  • Cabs

Here, all modules are independent of each other in CodeBase, but they can communicate with each other. (Service to Service Communication)

For Example,

  1. If Flight Module is a more engaging module as a result simultaneous clients will be there, so we can accordingly scale out the containers in that Service/Module alone without creating an entire APP in the new System.
  2. Saves Time, Reliability, Scalability, and Space of the System.
  3. It can communicate with other modules to fetch the data.
  4. Flight Module alone has a Load balancer to manage the simultaneous clients coming to the APP only for that service.

Microservice Trend Over the period




Microservice Trend Over the period

In the mid-2000s, microservices began to appear, and a set of popular frameworks based on microservice architectures were developed, After being used at scale and enhanced for 10 years.

Companies benefited from Microservices

Halodoc: (CaseStudy)



Halodoc, a company, and app allow you to interact with a doctor right from your phone. As there are many people living in rural areas. they have restricted access to healthcare facilities

Halodoc is the No.1 health application in Indonesia

An app that makes it possible for a country of 264 million people,
with 50% internet penetration must have some serious technology behind it. And now I’m going to tell you how it works

As they started launching on new business lines it was obvious to a monolith will not cut it and they had to go the micro-service route as soon as possible.

All services were all these new interactions that your users changed to new microservices in your architecture.

  • Each microservice has a couple of compute instances, backed by assistance, we use the RDS MySQL database.
  • So, one group could be buying medicines online,
  • the second group could be talking to a doctor online.
  • And so on, It has 40 to 50 microservices in production
  • Given that each of these microservices has their own databases
  • The users’ data, As a user, could buy medicines or talk to a doctor, and these belong to different microservices .so used DynamoDB in AWS to save all of the user data.





  • All of these services would use identity quite often having a low latency database, and being able to share that across all these microservices is a big benefit.
  • Also, they use SNS(notification) to alert Dev teams between the microservices call they were having unnecessary tight coupling between our microservices.
  • And more technologies are used behind. to maintain the synchronous
  • They connect 22000+ doctors and 1500 pharmaciesacross 50 cities in Southeast Asia.

Ref: AWS Architecture Blog

eBay



eBay, the world’s biggest online marketplace created a powerful platform for selling goods and services.

Enables trade on a local, national, and international basis with customized sites in markets around the globe, ensuring global e-commerce for an ever-growing online community

They started off with a monolithic Perl application, they had a monolithic C++ application that had up to 3.4 million lines of code in a single DLL.

  • On the large-scale app, they move to a distributed and partitioned system in Java.
  • eBay has quite a lot of Java but also functions on a polyglot set of microservices, that is, they are written in more than one language.
  • The eBay system works with over 1000 microservices. For all types of Devices. (Web, Android, iOS)

Amazon

The Amazon.com website calls about 150 services to fetch the data that makes its webpage.

Netflix

Netflix is doing the same for its applications to be able to scale its services to over 80 million subscribers.

Many Tech Giants make ease of Operations with Microservices as a part of their Design.

FINAL

The Microservice architecture in DevOps practices together with the cloud environment is playing an important role in facilitating the implementation of microservices. We have also identified containerization as an effective method to overcome the hardware limitation besides speeding up the delivery process. Due to their smaller size, they shorten the delivery process and make scaling less challenging On the other hand, to use microservices, a highly automated system with an advanced monitoring capability is required

Microservice should be adopted where APPLICATION in monolithic reaches the point where it becomes hard to maintain or scale it.

The microservice architecture allows to use of different technologies for different services and allows to scale and maintain better, but all this comes with an overhead complexity and requires good expertise

Microservices’ governance is decentralized. and handling millions of requests by designing systems for huge availabilityhigh scalability, and low latency.

THANK YOU !!

Read More