[Cloud Native|DevOps] DevOps Tools Introduction

1. Introduction to DevOps

Software development initially consisted of two teams:

  • The development plan consists of 开发团队the design and construction of the overall system from scratch. The system requires constant iterative updates.
  • 运维团队Test the code of the development team and deploy it online. Hope the system runs stably and safely.

It seems that two teams with different goals need to work together to complete the development of a software. After 开发团队specifying the plan and completing the coding, you need to provide it 运维团队. The operation and maintenance team reports the bugs that need to be fixed and some tasks that need to be reworked to the development team.

At this time, the development team often needs to wait for feedback from the operation and maintenance team. This undoubtedly prolongs the event and delays the entire software development cycle.

There will be a way to 在开发团队等待的时候,让开发团队转移到下一个项目中。wait for the ops team to provide feedback on previous code. But this means that a complete project requires a longer cycle to develop the final code.

Based on the current Internet status, agile development is more popular, which leads to faster iteration of the project. However, due to the communication problem between the development team and the operation and maintenance team, the time cost for the new version to go online is very high. This again defeats the original purpose of agile development.

So 如果让开发团队和运维团队整合到成一个团队,协同应对一套软件呢?这就被称为DevOps。

DevOps, which literally means the abbreviation of Development & Operations, that is, development & operations. Although the literal meaning only involves the development team and the operation and maintenance team, it QA测试团队is actually involved.

DevOps
[External link image transfer failed, the source site may have an anti-leech mechanism, it is recommended to save the image and upload it directly (img-wJqS3SY7-1661737294480)(Pictures/image-20211124130409521.png)]

This shows that DevOps is a process of continuous improvement in efficiency and continuous work.

DevOpsThe way that companies can respond to updates and market development changes faster, development can be delivered quickly, and deployments are more stable. The core is to simplify the process between Dev and Ops teams and make the overall software development process faster.

The overall software development process includes:

  • PLAN: The development team develops a development plan based on the client's goals
  • CODE: To start the coding process according to the PLAN, different versions of the code need to be stored in a library.
  • BUILD: After coding is complete, the code needs to be built and run.
  • TEST: After successfully building the project, you need to test the code for bugs or errors.
  • DEPLOY: After the code has been manually tested and automated, it is determined that the code is ready for deployment and handed over to the operation and maintenance team.
  • OPERATE: The operations team deploys the code to production.
  • MONITOR: After the project is deployed and launched, it is necessary to continuously monitor the product.
  • INTEGRATE: The feedback received in the monitoring phase is then sent back to the PLAN phase. The overall iterative process is the core of DevOps , namely continuous integration and continuous deployment.

In order to ensure that the overall process can be completed efficiently, there are more common tools at each stage, as shown below:

Software development process & tools involved
[External link image transfer failed, the source site may have anti-leech mechanism, it is recommended to save the image and upload it directly (img-kfgzuRsQ-1661737294481)(Pictures/2021-11-23_175935.png)]

Ultimately , the DevOpsnext definition can be given: DevOps emphasizes how efficient organizational teams can collaborate and communicate with each other through automated tools to complete software lifecycle management, thereby delivering more stable software faster and more frequently.

Automated tools for collaboration and communication to complete software lifecycle management.

Second, the Code stage tools

In the codestage, we need to store different versions of the code in a warehouse, the common version control tool is SVNor Git, here we use Git as the version control tool and GitLab as the remote warehouse.

2.1 Git installation

https://git-scm.com/

2.2 GitLab installation

Prepare the server separately, using the Dockerinstallation

Check out GitLabthe mirror:

docker search gitlab

Pull the GitLabimage:

docker pull gitlab/gitlab-ce

Prepare docker-compose.ymldocuments:

version: '3.1'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.11.11:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '2224:2224'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'

Start the container:

docker-compose up -d

Visit GitLabthe home page:

front page
[External link image transfer failed, the source site may have an anti-leech mechanism, it is recommended to save the image and upload it directly (img-UxSHuuQC-1661737294482)(Pictures/image-20211124182140596.png)]

View the initial password of the root user:

docker exec -it gitlab cat /etc/gitlab/initial_root_password
initial password
[External link image transfer failed, the origin site may have anti-leech mechanism, it is recommended to save the image and upload it directly (img-XMqrqZMG-1661737294483)(Pictures/image-20211124182921234.png)]

Login as root user:

Jump to the page after successful login
[External link image transfer failed, the source site may have anti-leech mechanism, it is recommended to save the image and upload it directly (img-g73wB01A-1661737294484)(Pictures/image-20211124183003858.png)]

After the first login, you need to change the password:

change Password
[External link image transfer failed, the source site may have an anti-leech mechanism, it is recommended to save the image and upload it directly (img-PrBblciq-1661737294485)(Pictures/image-20211124193444561.png)]

Once done, you can use it like Gitee and GitHub.

3. Build stage tools

Tools for building Java projects generally have two choices, one is Mavenand the other is Gradle. Here we choose Maven as the compilation tool for the project.

Maven installation and configuration process:

  1. Install Maven
  2. Configure environment variables
  3. Configure local repository
  4. Configure mirroring
  5. Configure JDK

The specific installation and configuration process will be explained in detail later. Here, you must ensure that the Maven repository private server and the JDK compiled version are configured.

Fourth, the Operate stage tool

During the deployment process, Docker will be used for deployment. For the time being, only Docker will be installed, and Kubenetes will need to be installed in the future.

4.1 Docker installation

Prepare test environment & production environment

Download Docker dependencies:

yum -y install yum-utils device-mapper-persistent-data lvm2

Set the image source for downloading Docker to Alibaba Cloud:

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install the Docker service:

yum -y install docker-ce

After the installation is successful, start Docker and set the boot to start automatically:

# 启动Docker服务
systemctl start docker
# 设置开机自动启动
systemctl enable docker

The test installation was successful:

docker version
Effect
[External link image transfer failed, the source site may have anti-leech mechanism, it is recommended to save the image and upload it directly (img-jD9WR23v-1661737294485)(Pictures/image-20211124200317795.png)]

4.2 Docker-Compose installation

Download Docker/Compose:https://github.com/docker/compose

Move the downloaded docker-compose-Linux-x86_64file to the Linux operating system:  …

Set docker-compose-Linux-x86_64file permissions and move into the $PATH directory:

# 设置文件权限
chmod a+x docker-compose-Linux-x86_64
# 移动到/usr/bin目录下,并重命名为docker-compose
mv docker-compose-Linux-x86_64 /usr/bin/docker-compose

The test installation was successful:

docker-compose version
Effect
[External link image transfer failed, the source site may have an anti-leech mechanism, it is recommended to save the image and upload it directly (img-Sx6CibBa-1661737294486)(Pictures/image-20211124200658107.png)]

Guess you like

Origin blog.csdn.net/zhangxia_/article/details/126717273