实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离

采用Sharding-JDBC实现c_order表分库分表+读写分离



要求:

  1. 搭建 两套一主二从 主从集群 架构,如下图
  2. 基于user_id对c_order表进行数据分片(分库)
  3. 基于id对c_order表进行数据分表,分别是:c_order1和c_order2
  4. 基于master1和master2 实现 读写分离

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第1张图片

建表语句:

CREATE TABLE c_order2(
id bigint(20) NOT NULL AUTO_INCREMENT,
is_del bit(1) NOT NULL DEFAULT 0 ,
user_id int(11) NOT NULL ,
company_id int(11) NOT NULL ,
publish_user_id int(11) NOT NULL ,
position_id int(11) NOT NULL ,
resume_type int(2) NOT NULL DEFAULT 0 ,
status varchar(256) NOT NULL ,
create_time datetime NOT NULL ,
update_time datetime NOT NULL ,

PRIMARY KEY (id),
KEY index_userId_positionId (user_id, position_id),
KEY idx_userId_operateTime (user_id, update_time)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;



一、环境搭建

1. 软件版本

环境&软件 版本
虚拟机&VMware Workstation 15 Pro
服务器&CentOS CentOS-7-x86_64-DVD-1810.iso
数据库&Mysql 5.7.28
远程文件传输&WinSCP、Xftp 5
远程连接&Xshell 5
Sharding-jdbc 4.1.0

2. 架构介绍

机器名称 角色 权限 IP
Master1 数据库Master1 可读写、主库 192.168.80.128
Slave1 数据库Slave1 只读、从库 192.168.80.55
Slave2 数据库Slave2 只读、从库 192.168.80.56
机器名称 角色 权限 IP
Master2 数据库Master 2 可读写、主库 192.168.80.129
Slave3 数据库Slave3 只读、从库 192.168.80.57
Slave4 数据库Slave4 只读、从库 192.168.80.58

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第2张图片


3. 软件下载地址:

  1. 操作系统:centos7下载地址 提取码:yrem
  2. MySQL数据库:mysql5.7下载地址 提取码:pb3c
  3. Xshell:xshell5下载地址 提取码:xdao

4. 主从搭建:

搭建两套一主两从架构:

  • master1,slave1,slave2
  • master2,slave3,slave4

具体搭建步骤,参考:基于CentOS7,MySQL5.7的主从复制架构搭建实战


测试:

	分别在两台主节点master1和master2上创建数据表c_order1和c_order2,检测从库是否同步

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第3张图片



二、编码(使用sharding-jdbc实现:c_order表分库分表+读写分离)


1. 创建maven工程:sharding-jdbc-order

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第4张图片


2. Maven依赖

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <version>${springboot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${springboot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${springboot.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.48</version>
        </dependency>

        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
            <version>${shardingsphere.version}</version>
        </dependency>

    </dependencies>

2.1 Order 实体类

@Entity
@Table(name = "c_order")
public class Order implements Serializable {

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    @Column(name = "is_del")
    private Boolean isDel;

    @Column(name = "company_id")
    private Integer companyId;

    @Column(name = "position_id")
    private long positionId;

    @Column(name = "user_id")
    private Integer userId;

    @Column(name = "publish_user_id")
    private Integer publishUserId;

    @Column(name = "resume_type")
    private Integer resumeType;

    @Column(name = "status")
    private String status;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "update_time")
    private Date updateTime;
    
    public long getId() {
        return id;
    }
    
    public void setId(long id) {
        this.id = id;
    }
    
    public Boolean getDel() {
        return isDel;
    }
    
    public void setDel(Boolean del) {
        isDel = del;
    }
    
    public Integer getCompanyId() {
        return companyId;
    }
    
    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }
    
    public long getPositionId() {
        return positionId;
    }
    
    public void setPositionId(long positionId) {
        this.positionId = positionId;
    }
    
    public Integer getUserId() {
        return userId;
    }
    
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    
    public Integer getPublishUserId() {
        return publishUserId;
    }
    
    public void setPublishUserId(Integer publishUserId) {
        this.publishUserId = publishUserId;
    }
    
    public Integer getResumeType() {
        return resumeType;
    }
    
    public void setResumeType(Integer resumeType) {
        this.resumeType = resumeType;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", isDel=" + isDel +
                ", companyId=" + companyId +
                ", positionId=" + positionId +
                ", userId=" + userId +
                ", publishUserId=" + publishUserId +
                ", resumeType=" + resumeType +
                ", status='" + status + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}

2.2 OrderRepository 类

import cn.dabing.entity.Order;
import org.springframework.data.jpa.repository.JpaRepository;

public interface OrderRepository extends JpaRepository<Order,Long> {
}

2.3 RunBoot 启动类

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
public class RunBoot {
}

2.4 TestShardingDatabase 测试类

@RunWith(SpringRunner.class)
@SpringBootTest(classes = RunBoot.class)
public class TestShardingDatabase {

    @Resource
    private OrderRepository orderRepository;

    @Test
    @Repeat(100)
    public void testInsertDB_TB() {
            Random random = new Random();
            int userId = random.nextInt(10);
            Order order = new Order();
            //order.setId(i);
            order.setDel(false);
            order.setCompanyId(2222);
            order.setPositionId(3242342);
            order.setUserId(userId);
            order.setPublishUserId(1111);
            order.setResumeType(1);
            order.setStatus("AUTO");
            order.setCreateTime(new Date());
            order.setUpdateTime(new Date());
            orderRepository.save(order);
    }

    /**
     * 测试查找
     */
    @Test
    public void testQueryFromSlave() {
        List<Order> list = orderRepository.findAll();
        list.forEach(cOrder -> {
            System.out.println(cOrder.toString());
        });
    }

3. 分库分表策略

配置文件:application.properties

#spring.profiles.active=sharding-master-slaves
spring.shardingsphere.props.sql.show=true

#数据源
spring.shardingsphere.datasource.names=master1,master2,slave1,slave2,slave3,slave4

spring.shardingsphere.datasource.master1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master1.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.master1.jdbc-url=jdbc:mysql://192.168.80.128:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.master1.username=root
spring.shardingsphere.datasource.master1.password=root

#一主两从1:master1/slave1/slave2---------------------
spring.shardingsphere.datasource.master2.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master2.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.master2.jdbc-url=jdbc:mysql://192.168.80.129:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.master2.username=root
spring.shardingsphere.datasource.master2.password=root
#slave1---------------
spring.shardingsphere.datasource.slave1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave1.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.slave1.jdbc-url=jdbc:mysql://192.168.80.55:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.slave1.username=root
spring.shardingsphere.datasource.slave1.password=root
#slave2---------------
spring.shardingsphere.datasource.slave2.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave2.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.slave2.jdbc-url=jdbc:mysql://192.168.80.56:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.slave2.username=root
spring.shardingsphere.datasource.slave2.password=root


#一主两从2:master2/slave3/slave4---------------------
#slave1---------------
spring.shardingsphere.datasource.slave3.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave3.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.slave3.jdbc-url=jdbc:mysql://192.168.80.57:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.slave3.username=root
spring.shardingsphere.datasource.slave3.password=root
#slave2---------------
spring.shardingsphere.datasource.slave4.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave4.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.slave4.jdbc-url=jdbc:mysql://192.168.80.58:3306/sharding_jdbc_db?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.shardingsphere.datasource.slave4.username=root
spring.shardingsphere.datasource.slave4.password=root


#分库,根据user_id字段进行分库
spring.shardingsphere.sharding.tables.c_order.database-strategy.inline.sharding-column=user_id
### 分库规则:对user_id取模2,奇偶分库
spring.shardingsphere.sharding.tables.c_order.database-strategy.inline.algorithm-expression=master$->{user_id % 2 + 1}


#分表,将写入统一主库的数据,根据id进行分表处理,分别存储到c_order1和c_order2中
## 实际操作节点,具体操作的库和表
spring.shardingsphere.sharding.tables.c_order.actual-data-nodes=master${1..2}.c_order${1..2}

### 分表规则:对id取模2,奇偶分表
spring.shardingsphere.sharding.tables.c_order.table-strategy.inline.sharding-column=id
spring.shardingsphere.sharding.tables.c_order.table-strategy.inline.algorithm-expression=c_order${id % 2 + 1}


#id生成策略,使用雪花算法生成id
spring.shardingsphere.sharding.tables.c_order.key-generator.column=id
spring.shardingsphere.sharding.tables.c_order.key-generator.type=SNOWFLAKE


#读写分离
spring.shardingsphere.sharding.master-slave-rules.master1.master-data-source-name=master1
spring.shardingsphere.sharding.master-slave-rules.master1.slave-data-source-names=slave1, slave2
spring.shardingsphere.sharding.master-slave-rules.master2.master-data-source-name=master2
spring.shardingsphere.sharding.master-slave-rules.master2.slave-data-source-names=slave3, slave4


三、测试

3.1 运行测试方法:testInsertDB_TB,查看核心运行日志

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)
 
2020-09-23 15:44:48.192  INFO 15340 --- [           main] o.a.s.core.log.ConfigurationLogger       : ShardingRuleConfiguration:
masterSlaveRules:
  master1:
    masterDataSourceName: master1
    name: master1
    slaveDataSourceNames:
    - slave1
    - slave2
  master2:
    masterDataSourceName: master2
    name: master2
    slaveDataSourceNames:
    - slave3
    - slave4
tables:
  c_order:
    actualDataNodes: master${1..2}.c_order${1..2}
    databaseStrategy:
      inline:
        algorithmExpression: master$->{user_id % 2 + 1}
        shardingColumn: user_id
    keyGenerator:
      column: id
      type: SNOWFLAKE
    logicTable: c_order
    tableStrategy:
      inline:
        algorithmExpression: c_order${id % 2 + 1}
        shardingColumn: id

2020-09-23 15:44:48.192  INFO 15340 --- [           main] o.a.s.core.log.ConfigurationLogger       : Properties:
sql.show: 'true'

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第5张图片

查看master1中添加的数据:

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第6张图片

查看master2中添加的数据:

实战:采⽤Sharding-JDBC实现订单表的(两主四从) 分库分表 和 读写分离_第7张图片


3.2 运行测试方法:testQueryFromSlave,查看核心运行日志

masterSlaveRules:
  master1:
    masterDataSourceName: master1
    name: master1
    slaveDataSourceNames:
    - slave1
    - slave2
  master2:
    masterDataSourceName: master2
    name: master2
    slaveDataSourceNames:
    - slave3
    - slave4
tables:
  c_order:
    actualDataNodes: master${1..2}.c_order${1..2}
    databaseStrategy:
      inline:
        algorithmExpression: master$->{user_id % 2 + 1}
        shardingColumn: user_id
    keyGenerator:
      column: id
      type: SNOWFLAKE
    logicTable: c_order
    tableStrategy:
      inline:
        algorithmExpression: c_order${id % 2 + 1}
        shardingColumn: id

2020-09-23 16:58:11.596  INFO 4356 --- [           main] o.a.s.core.log.ConfigurationLogger       : Properties:
sql.show: 'true'

2020-09-23 16:58:11.661  INFO 4356 --- [           main] ShardingSphere-metadata                  : Loading 1 logic tables' meta data.
2020-09-23 16:58:11.696  INFO 4356 --- [           main] ShardingSphere-metadata                  : Meta data load finished, cost 100 milliseconds.
2020-09-23 16:58:11.906  INFO 4356 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-09-23 16:58:11.976  INFO 4356 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.12.Final
2020-09-23 16:58:12.109  INFO 4356 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-09-23 16:58:12.439  INFO 4356 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
2020-09-23 16:58:12.937  INFO 4356 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-09-23 16:58:12.941  INFO 4356 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-09-23 16:58:13.278  INFO 4356 --- [           main] test.TestShardingDatabase                : Started TestShardingDatabase in 3.925 seconds (JVM running for 4.776)
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : Logic SQL: select order0_.id as id1_0_, order0_.company_id as company_2_0_, order0_.create_time as create_t3_0_, order0_.is_del as is_del4_0_, order0_.position_id as position5_0_, order0_.publish_user_id as publish_6_0_, order0_.resume_type as resume_t7_0_, order0_.status as status8_0_, order0_.update_time as update_t9_0_, order0_.user_id as user_id10_0_ from c_order order0_
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@6771fc29, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@1f370472), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@1f370472, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=344, distinctRow=false, projections=[ColumnProjection(owner=order0_, name=id, alias=Optional[id1_0_]), ColumnProjection(owner=order0_, name=company_id, alias=Optional[company_2_0_]), ColumnProjection(owner=order0_, name=create_time, alias=Optional[create_t3_0_]), ColumnProjection(owner=order0_, name=is_del, alias=Optional[is_del4_0_]), ColumnProjection(owner=order0_, name=position_id, alias=Optional[position5_0_]), ColumnProjection(owner=order0_, name=publish_user_id, alias=Optional[publish_6_0_]), ColumnProjection(owner=order0_, name=resume_type, alias=Optional[resume_t7_0_]), ColumnProjection(owner=order0_, name=status, alias=Optional[status8_0_]), ColumnProjection(owner=order0_, name=update_time, alias=Optional[update_t9_0_]), ColumnProjection(owner=order0_, name=user_id, alias=Optional[user_id10_0_])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@50d91a0f, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@3ace65df, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@52b6561b, containsSubquery=false)
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : Actual SQL: slave1 ::: select order0_.id as id1_0_, order0_.company_id as company_2_0_, order0_.create_time as create_t3_0_, order0_.is_del as is_del4_0_, order0_.position_id as position5_0_, order0_.publish_user_id as publish_6_0_, order0_.resume_type as resume_t7_0_, order0_.status as status8_0_, order0_.update_time as update_t9_0_, order0_.user_id as user_id10_0_ from c_order1 order0_
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : Actual SQL: slave2 ::: select order0_.id as id1_0_, order0_.company_id as company_2_0_, order0_.create_time as create_t3_0_, order0_.is_del as is_del4_0_, order0_.position_id as position5_0_, order0_.publish_user_id as publish_6_0_, order0_.resume_type as resume_t7_0_, order0_.status as status8_0_, order0_.update_time as update_t9_0_, order0_.user_id as user_id10_0_ from c_order2 order0_
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : Actual SQL: slave3 ::: select order0_.id as id1_0_, order0_.company_id as company_2_0_, order0_.create_time as create_t3_0_, order0_.is_del as is_del4_0_, order0_.position_id as position5_0_, order0_.publish_user_id as publish_6_0_, order0_.resume_type as resume_t7_0_, order0_.status as status8_0_, order0_.update_time as update_t9_0_, order0_.user_id as user_id10_0_ from c_order1 order0_
2020-09-23 16:58:14.000  INFO 4356 --- [           main] ShardingSphere-SQL                       : Actual SQL: slave4 ::: select order0_.id as id1_0_, order0_.company_id as company_2_0_, order0_.create_time as create_t3_0_, order0_.is_del as is_del4_0_, order0_.position_id as position5_0_, order0_.publish_user_id as publish_6_0_, order0_.resume_type as resume_t7_0_, order0_.status as status8_0_, order0_.update_time as update_t9_0_, order0_.user_id as user_id10_0_ from c_order2 order0_
Order{id=515553321667264512, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:50.0, updateTime=2020-09-23 15:44:50.0}
Order{id=515553322636148736, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553322715840512, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553322929750016, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323026219008, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323240128512, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323684724736, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323768610816, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323923800064, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324347424768, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324414533632, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324494225408, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324708134912, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324804603904, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324871712768, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324955598848, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325119176704, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325182091264, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325446332416, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325723156480, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325999980544, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326067089408, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326134198272, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326197112832, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326247444480, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326314553344, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:52.0, updateTime=2020-09-23 15:44:52.0}
Order{id=515553322682286081, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553322766172161, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323189796865, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323307237377, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323403706369, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323659558913, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323718279169, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323797970945, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323978326017, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324070600705, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324167069697, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324234178561, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324380979201, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324527779841, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324611665921, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324758466561, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325148536833, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325232422913, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325412777985, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325475692545, isDel=false, companyId=2222, positionId=3242342, userId=4, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325773488129, isDel=false, companyId=2222, positionId=3242342, userId=6, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325836402689, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325903511553, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325970620417, isDel=false, companyId=2222, positionId=3242342, userId=2, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326033534977, isDel=false, companyId=2222, positionId=3242342, userId=8, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326100643841, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326163558401, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326280998913, isDel=false, companyId=2222, positionId=3242342, userId=0, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:52.0, updateTime=2020-09-23 15:44:52.0}
Order{id=515553322816503808, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323143659520, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323353374720, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323454038016, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323525341184, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323617615872, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323848302592, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324020269056, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324116738048, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324200624128, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324267732992, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324578111488, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324641026048, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325035290624, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325265977344, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325328891904, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325379223552, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325509246976, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325593133056, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325656047616, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325807042560, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325869957120, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325937065984, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326377467904, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:52.0, updateTime=2020-09-23 15:44:52.0}
Order{id=515553322275438593, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553322862641153, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553322980081665, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323076550657, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323487592449, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323575672833, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553323894439937, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324313870337, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324460670977, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324674580481, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324838158337, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553324922044417, isDel=false, companyId=2222, positionId=3242342, userId=9, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325001736193, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325085622273, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325295337473, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325362446337, isDel=false, companyId=2222, positionId=3242342, userId=5, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325542801409, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325626687489, isDel=false, companyId=2222, positionId=3242342, userId=7, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553325689602049, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326213890049, isDel=false, companyId=2222, positionId=3242342, userId=1, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:51.0, updateTime=2020-09-23 15:44:51.0}
Order{id=515553326343913473, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:52.0, updateTime=2020-09-23 15:44:52.0}
Order{id=515553326411022337, isDel=false, companyId=2222, positionId=3242342, userId=3, publishUserId=1111, resumeType=1, status='AUTO', createTime=2020-09-23 15:44:52.0, updateTime=2020-09-23 15:44:52.0}
2020-09-23 16:58:14.137  INFO 4356 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-09-23 16:58:14.141  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2020-09-23 16:58:14.152  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2020-09-23 16:58:14.152  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown initiated...
2020-09-23 16:58:14.159  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown completed.
2020-09-23 16:58:14.159  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown initiated...
2020-09-23 16:58:14.163  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown completed.
2020-09-23 16:58:14.163  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-4 - Shutdown initiated...
2020-09-23 16:58:14.163  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-4 - Shutdown completed.
2020-09-23 16:58:14.163  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-5 - Shutdown initiated...
2020-09-23 16:58:14.167  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-5 - Shutdown completed.
2020-09-23 16:58:14.167  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-6 - Shutdown initiated...
2020-09-23 16:58:14.171  INFO 4356 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-6 - Shutdown completed.

在这里插入图片描述

3.3 测试案例:

测试代码下载:测试代码 提取码:4as5

你可能感兴趣的:(大型分布式存储系统架构,mysql,数据库,sharding,spring,boot)