Database(Mysql)发版控制二

Database(Mysql)发版控制二

大家好,又见面了,我是全栈君。

author:skate
time:2014/08/18

 

Database(Mysql)发版控制

 

The Liquibase Tool related Database

一.Installation & Configration
二.Advanced Usage of the Liquibase
三.Frequently Questions

二.Advanced Usage of the Liquibase

 

1.实际场景模拟
实际需求:须要把不同环境的不同分支的数据库变更合并,并按需求应用或回滚到不同的DB环境中。实现对DB发版的管理

DB的环境:dev,qa,sandbox,prod

规划DB发版文件夹。如:

database
        Release-2014-05
                       db.Changelog-master.xml
                       000_CreateTable.sql
                       001_Init.sql
                       ….
                       032_Update.sql
        Release-2014-06
                       db.Changelog-master.xml       
                       000_CreateTable.sql
                       001_Init.sql
                       ….
                       192_Update.sql      
        Release-2014-07
                       db.Changelog-master.xml       
                       000_CreateTable.sql
                       001_Init.sql
                       ….
                       132_Update.sql       
                      
                      
db.Changelog-master.xml是数据库变更的主文件,其包含每个数据库的changeset文件,这样能够控制每个changeset的运行顺序和大小,例如以下是一个样例:

# more db.Changelog-master.xml
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<databaseChangeLog xmlns=”http://www.liquibase.org/xml/ns/dbchangelog” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd“>

  <preConditions>
            <dbms type=”oracle”/>
  </preConditions>

  <include file=”database/Release-2014-05/000_CreateTable.sql”/>
  <!– include file=”database/Release-2014-05/001_Init.sql”/ –>
  <!– include file=”database/Release-2014-05/032_Update.sql”/ –>

</databaseChangeLog>     

# more 000_CreateTable.sql
–liquibase formatted sql 

–changeset skate:Release-2014-05_000_CreateTable.sql context:test

CREATE TABLE table3 ( 
 id int(11) NOT NULL, 
  name varchar(255) NOT NULL, 
  PRIMARY KEY (id) 
) ENGINE=Innodb; 

ALTER TABLE  table3 CHANGE  id  id INT( 11 ) AUTO_INCREMENT; 
ALTER TABLE  table3 CHANGE  name  firstname VARCHAR( 255 ); 
INSERT INTO table3 (id, firstname) VALUES (NULL, ‘name1’),(NULL, ‘name2’), (NULL, ‘name3’); 

–rollback drop table table3;

 

或者用xml文件

# more 000_CreateTable.xml
<?

xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<databaseChangeLog xmlns=”http://www.liquibase.org/xml/ns/dbchangelog” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd“>
    <changeSet author=”Skate” id=”Release-2014-05_000_CreateTable.sql context:test “>
        <createTable tableName=”testtab”>
            <column autoIncrement=”true” name=”id” type=”INT(10)”>
                <constraints primaryKey=”true”/>
            </column>
            <column name=”firstname” type=”VARCHAR(50)”/>
            <column name=”lastname” type=”VARCHAR(50)”>
                <constraints nullable=”false”/>
            </column>
            <column name=”state” type=”VARCHAR(2)”/>
        </createTable>
    </changeSet>
</databaseChangeLog>     
  

每一个developer能够通过自己本机的liquibase把数据库的changset同步到dev环境

 

首先检查changelog是否有错误
[root@skatedb55 liquibase30]# sh liquibase –contexts=dev –defaultSchemaName=test5 –logLevel=debug –changeLogFile=/tmp/db.Changelog-master.xml –driver=com.mysql.jdbc.Driver –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate validate
Liquibase Home: /mysql/software/liquibase30
DEBUG 8/19/14 2:45 PM:liquibase: Connected to skate@127.0.0.1@jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8
DEBUG 8/19/14 2:45 PM:liquibase: Setting auto commit to false from true
INFO 8/19/14 2:46 PM:liquibase: Reading from test5.DATABASECHANGELOG
DEBUG 8/19/14 2:46 PM:liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE,DESCRIPTION,COMMENTS FROM test5.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
DEBUG 8/19/14 2:46 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for inputStream as 00ba919fb68564b7f5f8dab227e4f6a8
DEBUG 8/19/14 2:46 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for 7:00ba919fb68564b7f5f8dab227e4f6a8: as 283384b19a5c2734d153462833903290
No validation errors found
Liquibase ‘validate’ Successful
[root@skatedb55 liquibase30]#

为本次更新创建tag(方便以后按须要回滚)
[root@skatedb55 liquibase30]# sh liquibase –contexts=dev –defaultSchemaName=test5 –logLevel=debug –changeLogFile=/tmp/db.Changelog-master.xml –driver=com.mysql.jdbc.Driver –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate tag Release-2014-05_000_CreateTable
Liquibase Home: /mysql/software/liquibase30
DEBUG 8/19/14 2:54 PM:liquibase: Connected to skate@127.0.0.1@jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8
DEBUG 8/19/14 2:39 PM:liquibase: Setting auto commit to false from true
DEBUG 8/19/14 2:39 PM:liquibase: Executing QUERY database command: select count(*) from test5.DATABASECHANGELOGLOCK
DEBUG 8/19/14 2:39 PM:liquibase: Executing QUERY database command: SELECT LOCKED FROM test5.DATABASECHANGELOGLOCK WHERE ID=1
DEBUG 8/19/14 2:39 PM:liquibase: Lock Database
DEBUG 8/19/14 2:39 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = ‘skatedb55 (fe80:0:0:0:218:51ff:fe85:562a%3)’, LOCKGRANTED = ‘2014-08-19 14:39:26.745’ WHERE ID = 1 AND LOCKED = 0
INFO 8/19/14 2:39 PM:liquibase: Successfully acquired change log lock
DEBUG 8/19/14 2:39 PM:liquibase: Executing QUERY database command: SELECT MD5SUM FROM test5.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
INFO 8/19/14 2:39 PM:liquibase: Reading from test5.DATABASECHANGELOG
DEBUG 8/19/14 2:39 PM:liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE,DESCRIPTION,COMMENTS FROM test5.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
INFO 8/19/14 2:39 PM:liquibase: Reading from test5.DATABASECHANGELOG
DEBUG 8/19/14 2:39 PM:liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE,DESCRIPTION,COMMENTS FROM test5.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
DEBUG 8/19/14 2:39 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for inputStream as 00ba919fb68564b7f5f8dab227e4f6a8
DEBUG 8/19/14 2:39 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for 7:00ba919fb68564b7f5f8dab227e4f6a8: as 283384b19a5c2734d153462833903290
DEBUG 8/19/14 2:39 PM:liquibase: Release Database Lock
DEBUG 8/19/14 2:39 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 8/19/14 2:39 PM:liquibase: Successfully released change log lock
Liquibase Update Successful
You have new mail in /var/spool/mail/root

2.Liquibase的一些高级使用方法

按指定tag rollback
[root@skatedb55 liquibase30]# sh liquibase –contexts=dev –defaultSchemaName=test5 –logLevel=debug –changeLogFile=/tmp/db.Changelog-master.xml –driver=com.mysql.jdbc.Driver –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test2?

useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate rollback Release-2014-05_000_CreateTable
Liquibase Home: /mysql/software/liquibase30
DEBUG 8/19/14 3:06 PM:liquibase: Connected to skate@127.0.0.1@jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8
DEBUG 8/19/14 3:06 PM:liquibase: Setting auto commit to false from true
DEBUG 8/19/14 3:06 PM:liquibase: Executing QUERY database command: select count(*) from test5.DATABASECHANGELOGLOCK
DEBUG 8/19/14 3:06 PM:liquibase: Executing QUERY database command: SELECT LOCKED FROM test5.DATABASECHANGELOGLOCK WHERE ID=1
DEBUG 8/19/14 3:06 PM:liquibase: Lock Database
DEBUG 8/19/14 3:06 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = ‘skatedb55 (fe80:0:0:0:218:51ff:fe85:562a%3)’, LOCKGRANTED = ‘2014-08-19 15:06:55.866’ WHERE ID = 1 AND LOCKED = 0
INFO 8/19/14 3:06 PM:liquibase: Successfully acquired change log lock
DEBUG 8/19/14 3:07 PM:liquibase: Executing QUERY database command: SELECT MD5SUM FROM test5.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
INFO 8/19/14 3:07 PM:liquibase: Reading from test5.DATABASECHANGELOG
DEBUG 8/19/14 3:07 PM:liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE,DESCRIPTION,COMMENTS FROM test5.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
DEBUG 8/19/14 3:07 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for inputStream as 00ba919fb68564b7f5f8dab227e4f6a8
DEBUG 8/19/14 3:07 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for 7:00ba919fb68564b7f5f8dab227e4f6a8: as 283384b19a5c2734d153462833903290
DEBUG 8/19/14 3:07 PM:liquibase: Release Database Lock
DEBUG 8/19/14 3:07 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 8/19/14 3:07 PM:liquibase: Successfully released change log lock
Liquibase Rollback Successful
You have new mail in /var/spool/mail/root

按给定时间rollback
[root@skatedb55 liquibase30]# sh liquibase –contexts=dev –defaultSchemaName=test5 –logLevel=debug –changeLogFile=/tmp/db.Changelog-master.xml –driver=com.mysql.jdbc.Driver –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test2?useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate rollbackToDate 2014-08-19 14:01:28
Liquibase Home: /mysql/software/liquibase30
DEBUG 8/19/14 3:14 PM:liquibase: Connected to skate@127.0.0.1@jdbc:mysql://localhost/test2?

useUnicode=true&characterEncoding=UTF-8
DEBUG 8/19/14 3:14 PM:liquibase: Setting auto commit to false from true
DEBUG 8/19/14 3:14 PM:liquibase: Executing QUERY database command: select count(*) from test5.DATABASECHANGELOGLOCK
DEBUG 8/19/14 3:14 PM:liquibase: Executing QUERY database command: SELECT LOCKED FROM test5.DATABASECHANGELOGLOCK WHERE ID=1
DEBUG 8/19/14 3:14 PM:liquibase: Lock Database
DEBUG 8/19/14 3:14 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = ‘skatedb55 (fe80:0:0:0:218:51ff:fe85:562a%3)’, LOCKGRANTED = ‘2014-08-19 15:14:46.132’ WHERE ID = 1 AND LOCKED = 0
INFO 8/19/14 3:14 PM:liquibase: Successfully acquired change log lock
DEBUG 8/19/14 3:14 PM:liquibase: Executing QUERY database command: SELECT MD5SUM FROM test5.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
INFO 8/19/14 3:14 PM:liquibase: Reading from test5.DATABASECHANGELOG
DEBUG 8/19/14 3:14 PM:liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE,DESCRIPTION,COMMENTS FROM test5.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for inputStream as 00ba919fb68564b7f5f8dab227e4f6a8
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/db.Changelog-master.xml: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for 7:00ba919fb68564b7f5f8dab227e4f6a8: as 283384b19a5c2734d153462833903290
INFO 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Rolling Back Changeset:/tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Rolling Back ChangeSet: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Executing EXECUTE database command: drop table table3
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: ChangeSet /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate has been successfully rolled back.
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Executing EXECUTE database command: DELETE FROM test5.DATABASECHANGELOG  WHERE ID=’Release-2014-05_000_CreateTable.sql’ AND AUTHOR=’skate’ AND FILENAME=’/tmp/database/Release-2014-05/000_CreateTable.sql’
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for inputStream as 00ba919fb68564b7f5f8dab227e4f6a8
DEBUG 8/19/14 3:14 PM:liquibase: /tmp/database/Release-2014-05/000_CreateTable.sql::Release-2014-05_000_CreateTable.sql::skate: Computed checksum for 7:00ba919fb68564b7f5f8dab227e4f6a8: as 283384b19a5c2734d153462833903290
DEBUG 8/19/14 3:14 PM:liquibase: Release Database Lock
DEBUG 8/19/14 3:14 PM:liquibase: Executing UPDATE database command: UPDATE test5.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 8/19/14 3:14 PM:liquibase: Successfully released change log lock
Liquibase Rollback Successful
You have new mail in /var/spool/mail/root
[root@skatedb55 liquibase30]#

 

生成当前数据库状态的文档
[root@skatedb55 liquibase30]# sh liquibase –driver=com.mysql.jdbc.Driver –changeLogFile=/tmp/mysql_liquibase_changelog.xml –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test5?useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate dbDoc /tmp/dbdoc/
Liquibase Home: /mysql/software/liquibase30
Liquibase ‘dbDoc’ Successful
You have new mail in /var/spool/mail/root

 

产生数据库的changelog
sh liquibase –driver=com.mysql.jdbc.Driver –changeLogFile=/tmp/mysql_liquibase_changelog.xml –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test5?

useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate generateChangeLog

 

对照两个数据库
[root@skatedb55 liquibase30]#  sh liquibase  –logLevel=debug  –driver=com.mysql.jdbc.Driver –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://10.10.0.117/test1?useUnicode=true&characterEncoding=UTF-8″ –username=test –password=test@df  diff –referenceUrl=”jdbc:mysql://10.20.0.55/test5?useUnicode=true&characterEncoding=UTF-8″ –referenceUsername=skate –referencePassword=skate
Liquibase Home: /mysql/software/liquibase30
DEBUG 8/21/14 9:24 AM:liquibase: Connected to test@10.20.0.55@jdbc:mysql://10.10.0.117/test1?useUnicode=true&characterEncoding=UTF-8
DEBUG 8/21/14 9:24 AM:liquibase: Setting auto commit to false from true
DEBUG 8/21/14 9:24 AM:liquibase: Connected to skate@10.20.0.55@jdbc:mysql://10.20.0.55/test5?useUnicode=true&characterEncoding=UTF-8
DEBUG 8/21/14 9:24 AM:liquibase: Setting auto commit to false from true

Diff Results:
Reference Database: skate@10.20.0.55 @ jdbc:mysql://10.20.0.55/test5?useUnicode=true&characterEncoding=UTF-8 (Default Schema: test5)
Comparison Database: test@10.20.0.55 @ jdbc:mysql://10.10.0.117/test1?useUnicode=true&characterEncoding=UTF-8 (Default Schema: test1)
Product Name: EQUAL
Product Version: EQUAL
Missing Catalog(s):
     test5
Unexpected Catalog(s):
     test1
Changed Catalog(s): NONE
Missing Column(s):
     t2.a
     t2.b
Unexpected Column(s): NONE
Changed Column(s): NONE
Missing Foreign Key(s): NONE
Unexpected Foreign Key(s): NONE
Changed Foreign Key(s): NONE
Missing Index(s): NONE
Unexpected Index(s): NONE
Changed Index(s): NONE
Missing Primary Key(s): NONE
Unexpected Primary Key(s): NONE
Changed Primary Key(s): NONE
Missing Schema(s): NONE
Unexpected Schema(s): NONE
Changed Schema(s): NONE
Missing Sequence(s): NONE
Unexpected Sequence(s): NONE
Changed Sequence(s): NONE
Missing Table(s):
     t2
Unexpected Table(s): NONE
Changed Table(s): NONE
Missing Unique Constraint(s): NONE
Unexpected Unique Constraint(s): NONE
Changed Unique Constraint(s): NONE
Missing View(s): NONE
Unexpected View(s): NONE
Changed View(s): NONE
Liquibase ‘diff’ Successful
You have new mail in /var/spool/mail/root
[root@skatedb55 liquibase30]#

列出当前数据库的lock
[root@skatedb55 liquibase30]# sh liquibase –driver=com.mysql.jdbc.Driver  –classpath=/usr/share/java/mysql-connector-java-5.1.17.jar –url=”jdbc:mysql://localhost/test5?

useUnicode=true&characterEncoding=UTF-8″ –username=skate –password=skate listLocks
Liquibase Home: /mysql/software/liquibase30
Database change log locks for skate@127.0.0.1@jdbc:mysql://localhost/test5?

useUnicode=true&characterEncoding=UTF-8
Liquibase ‘releaseLocks’ Successful
[root@skatedb55 liquibase30]#

 

——–end———

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/115982.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • ASP.NET MVC商城网站

    ASP.NET MVC商城网站本项目使用了大量的插件,所有的商品数据皆为动态加载,全部从数据库中读取呈现在界面上,具备商品评论,添加/移除购物车商品,邮箱发送验证码进行注册等功能。同时本项目配备商品后台管理系统,用来对商品信息和用户信息进行管理,同时还可查看商品的相关数据汇总。本项目仅用于学习参考,作为练习或者是实训项目也是刚刚好。界面展示(部分)代码太多了,就不进行部分展示了。…

  • win10-linux双系统安装教程

    win10-linux双系统安装教程需要的工具UltralSO:制作启动盘DiskGenius:划分磁盘空间EasyUEFI:修改启动引导,Windows自带引导不能修改,因此要用Linux的引导(一般默认就是linux的)1、制作启动U盘用UltralSO做,教程很多2、划分磁盘空间用DiskGenius将匀出一块空间做linux系统空间100MBESP分区8GB交换分区自定义容量:根目录分区自定义容量:\home分区3、安装系统U盘启动,安装操作系统4、修改启动顺序…

  • sm4加密和sm3加密

    sm4加密和sm3加密sm4加密有32位key值加密和16位key值加密加粗样式sm4中32位加密:可以参考:https://www.npmjs.com/package/@haici/gmsm4sm4中16位加密:可以参考:https://blog.csdn.net/qq_34574204/article/details/107961807?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162501640416780366595087%2522%252C%

  • PXE 批量安装 Ubuntu 20.04

    PXE 批量安装 Ubuntu 20.04原文链接:https://www.cpweb.top/1698一、介绍  Ubuntu20.04的服务器安装程序支持新的操作模式:自动安装(automatedinstallation)。自动安装可以通过自动安装配置提前回答所有这些配置问题,并使安装过程无需任何交互即可运行。  在Ubuntu18.04中,用的应答文件是preseeds(预配置文件),它基于debian-installer(akadi)来实现自动安装的。需要注意的是,如果你使用的是cobbler,那你应…

  • mavlink协议解析_jlink 串口

    mavlink协议解析_jlink 串口MAVLink是为微型飞行器MAV(MicroAirVehicle)设计的(LGPL)开源的通讯协议。是无人飞行器和地面站(GroundControlStation,GCS)之间,以及无人飞行器之间通讯常用的协议。APM、PIXHAWK飞控,MissionPlanner、QGroundControl地面站均使用了MAVLink协议进行通讯。MAVLink源码下载地址(现已更新至v2.0):https://github.com/mavlink/qgroundcontrol 用户手册:ht

  • TCP拥塞控制算法的演进

    TCP拥塞控制算法的演进TCP拥塞控制算法的演进TCP协议仅定义框架,也就是发送端和接收端需要遵循的“规则”。TCP协议的实现经过多年的改进,有了多个不同的版本。比较重要的有Tahoe、Reno、NewReno、SACK、Vegas等,有些已经成为了影响广泛的RFC文档,有些则成为了Unix/Linux操作系统的标准选项。以下简要介绍各个实现版本的主要区别和联系。1 早期的TCP实现最早的

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号