1 --- DevOps DevOps Getting Detailed Introduction

1 --- DevOps DevOps Getting Detailed Introduction

Detailed entry DevOps 2 --- sustainable integrated jenkins

Detailed entry DevOps 3 --- container management platform Rancher

1 DevOps Introduction

  1.1 What is DevOps

      DevOps is Development and Operations abbreviation of two words, reference definition Baidu Encyclopedia:

       DevOps is a method or concept, which covers development, testing, operation and maintenance of the entire process. DevOps is to improve communication and collaboration methods and processes of the various departments of quality software development, testing, operation and maintenance, and operation, DevOps emphasis on software developers and software testing, software operation and maintenance, quality assurance ( QA effective communication between) departments and cooperation, stressed by automated approach to software change management, software integration, from the software built into the test, release faster and more reliable, and ultimately deliver software on time.

       

 1.2 DevOps toolchain

        DevOps rise in 2009 year in recent years because of cloud computing, development of the Internet to promote the DevOps development of infrastructure and tool chains, the emergence of a large number of excellent tools, including development, testing, operation and maintenance of various fields, such as : GitHub , the Git / SVN , Docker , Jenkins , Hudson, the Ant / Maven / the Gradle , the Selenium , QUnit , the JMeter like. The figure is DevOps set of tools associated with:

     

 

2 Docker

  2.1 virtualization technology

     2.1.1 Description of the problem

        The software development of the Internet industry has undergone tremendous changes, one notable change is the increasing size of software, service-based micro-architecture software encountered such challenges in production deployments:

1 , the configuration of the micro-services development language, operating system, dependent libraries in different environments, how quick installation, migration, configuration software?

2 , a software composed by a number of micro-services, how to quickly deploy micro-volume service?

3 , how to effectively conducive to computer resources?

    Thoughts for the first two questions:

        Traditional software deployment process is: install the operating system -> Installation depends software / Library -> Install the software (Micro Services) -> configuration software -> on line running final software, services and face a large number of micro-micro-cluster service use this program is not only inefficient, but also the environmental compatibility problems may occur, it is clear this scheme is not suitable for use in micro-service deployment.

    Imagine: If you have a technology that can quickly and software required for various environment configuration package, bulk copy above will solve the problem.

    Thoughts for the third question:

        In a computer only to install a micro computer service great waste of resources, if you can install multiple micro-services effectively conducive to computer resources, but for software installation and deployment batch or face 1 , 2 problem.

    Envisaged: a plurality of micro-computer installation service, the service uses a micro-packaging technique, replication deployment, independently of each other, and isolation between the micro service.

    2.1.2 virtualization technology

     References Baidu Encyclopedia ( https://baike.baidu.com/item/%E8%99%9A%E6%8B%9F%E5%8C%96/547949 )

     

        Summary: Virtualization is a software technology infrastructure, operating systems, software and other IT resources for effective management, so users no longer limited by physical resources, improve the utilization of computer resources. Virtualization technology is the foundation for cloud computing, such as Ali cloud cloud host, so Tencent cloud application virtualization technology.

        Including virtualization technology as a whole two areas: hardware virtualization and software virtualization, specifically divided into: network virtualization, storage virtualization, desktop virtualization, server virtualization, we usually say most is server virtualization.

        Server virtualization is to run multiple virtual machines on the same physical server so that's the CPU , memory, disk, the I / O and other hardware facilities to service each virtual machine running different software on each virtual machine, the virtual is the isolation between the machine.

        There are two main server virtualization technologies:

. 1 , Hypervisor also called the VMM ( Virtual Machine Monitor ) The method of virtual machine monitor i.e. Hypervisor is an operating system and hardware abstraction separated host implemented ( Host Machine can run simultaneously) a plurality of clients (Guest Machine ) each client is a virtual machine, the virtual machine to efficiently share hardware resources of the host. As shown below:

       Installed on the server (host) operating system, and install the hypervisor virtual machine management software, such as VMware , VirtualBox , etc., by the hypervisor to manage multiple virtual machines, you need to install a guest operating system on each virtual machine, dependent libraries, application software.

    2 , Containers container Technology

    

       Container technology docker engine replaces the hypervisor , docker engine is running a process on the accommodation of the operating system, the process of managing multiple docker containers, each docker container integrates applications software, dependencies, isolated from each container.

 

  3 , technical comparison:

      Resource consumption:

      Because the virtual machine is independent of the operating system footprint than docker and more.

      Start speed :

      Including virtual machine operating system, start the virtual machine to start the equivalent of an operating system, not the same container, the container includes only the operating system kernel, start a container instance is equivalent to starting a process to start faster than the speed of the vessel virtual machine.

      volume:

      Container including the operating system kernel, software and dependent libraries, virtual machine software and includes not only dependent libraries will be packaged into a complete operating system, the virtual machine is larger than the volume of the container and more.

    2.1.3 Docker Introduction

See another article: Docker Introduction and Installation

 

 2.2  deployment services to micro Docker

   2.2.1 What is Dockerfile

    Dockerfile is the script by a series of commands and parameters constituted these commands to the base image and ultimately create a new image.

    1 , for developers: provide a consistent development environment for the development team;

    2 , for the testers: You can take a direct mirror image constructed by the development or Dockerfile to build a new image file to start work;

    3 , for the operation and maintenance personnel: At deployment time, enables seamless migration of applications.

   2.2.2 Dockerfile commonly used commands

  The following springboot to project as an example, the preparation of DockFile in the project directory

FROM openjdk:8-jre-alpine
MAINTAINER wolter <[email protected]>
VOLUME /tmp
COPY target/live-service-2.0.0.jar /usr/local
EXPOSE 8099
ENTRYPOINT ["java", "-jar", "-Ddubbo.application.logger=slf4j","/usr/local/live-service-2.0.0.jar"]

  pom.xml increased docker-maven-plugin plug, whose role is to construct docker mirror and mirror push Docker private repository (here, ignoring the docker build a private library);

<build>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.0.0</version>
                <!--docker镜像相关的 配置 信息-->
                <configuration>
                    <!--Dockerfile文件所在目录-->
                    <dockerDirectory>${project.basedir}</dockerDirectory>
                    <dockerHost>http://ip:2375</dockerHost>
                    <!--TAG,这里用工程版本号-->
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                    </imageTags>
                    <!--镜像名,这里用工程名-->
                    <imageName>ip:5000/${project.artifactId}:${project.version}</imageName>
                    <!--构建镜像的配置信息-->
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.artifactId}-${project.version}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

  docker idea to install plug-ins 

Docker engine configuration address

 Terminal into the project directory, run the compiler command

  After the build is completed, the mirror can be seen on the server docker

  So far boot image has been uploaded successfully.

Published 41 original articles · won praise 47 · views 30000 +

Guess you like

Origin blog.csdn.net/u014526891/article/details/94603950