Comprehensive Practice of 2020 System (1)

(1) Course survey

Before taking this course, I thought it was a practical course similar to an operating system. After the class, I felt a little bit of soft work practice. I do n’t have a deep understanding yet. I just hope to follow the teacher ’s rhythm and learn some practical techniques.

(2) Microservices

When microservices

Microservices was originally proposed by Martin Fowler. His understanding is as follows: The microservice architecture is to develop a single program into a microservice, each microservice runs in its own process, and uses a lightweight mechanism to communicate, usually HTTP RESTFUL API. These services are divided around business capabilities and deployed independently through automated deployment mechanisms. These services can use different programming languages ​​and different databases to ensure the minimum centralized management.
In general, microservices are an architectural style. A large and complex software application consists of one or more microservices. Each microservice in the system can be deployed independently, and each microservice is loosely coupled. Each microservice is only focused on completing one task and accomplishing it well. In all cases, each task represents a small business capability.

Features of microservices:

1. Small granularity and focus on one thing
2. Separate process
3. Lightweight application communication mechanism
4. Loosely coupled and independently deployable

Compared with traditional software architecture, the advantages and disadvantages of microservices

Advantages
1. Improve development communication, each service is cohesive enough, small enough, and the code is easy to understand;
2. Service independent testing, deployment, upgrade, release;
3. Customized DFX, resource utilization, each service can be individual Carry out x expansion and z expansion, and each service can be deployed to the appropriate hardware server according to its own needs;
4. Each service selects the HA mode according to the needs, and selects the number of instances receiving the service;
5. Easy to expand development Teams can develop teams for each service component.
6. Improve fault isolation. A service memory leak does not paralyze the entire system.
Disadvantages
1. There is no silver bullet. Microservices improve the system ’s performance. Complexity;
2. Developers must deal with the complexity of distributed systems;
3. Distributed communication between services;
4. Registration and discovery of
services ; 5. Distributed transaction between services;
6. Data Isolate the problem of report processing;
7. Distributed consistency between services;
8. The complexity of service management and the arrangement of services.

(3), learn docker technology

Related concepts

Docker is an open platform for developing, delivering, and running applications. Ability to separate applications from infrastructure, so software can be delivered quickly.

docker compose is a tool for defining and running multi-container Docker applications. With Compose, you can use YML files to configure all the services your application needs. Then, with a single command, you can create and start all services from the YML file configuration.

Dockerfile is a text file used to build an image. The text contains a series of instructions and instructions needed to build an image.

Docker Machine is a tool that allows you to install Docker on a virtual host, and you can use the docker-machine command to manage the host.

Docker Machine can also centrally manage all docker hosts, such as quickly installing docker on 100 servers.

Docker Swarm is Docker's cluster management tool. It turns the Docker host pool into a single virtual Docker host.

K8S is a container-based cluster management platform. Its full name is kubernetes.

Virtual machine Ubuntu installation docker environment

1. Uninstall the old version

$sudo docker run -itd --name ubuntu-test ubuntu /bin/bash

2. Update apt

$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

3. Add Docker's official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

4. Verification key

$ sudo apt-key fingerprint 0EBFCD88

5. Set up a stable repository

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

6. Update apt and install docker engine

 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

7. Verify the installation is complete

 $ sudo docker run hello-world

Container creation, deletion, update, query

Load image

Start and exit

query

Create your own mirror repository

Implement upload


Guess you like

Origin www.cnblogs.com/ycj202595/p/12694441.html