视频版
https://www.bilibili.com/video/BV1H24y117uh/
1.安装mysql-apt-config并准备基础环境
channel选mysql8, apt update后就能安装 mysql-shell了
获取debian-sys-maint的密码备用
使用/etc/hosts尝试模拟域名或者自行配置DNS
mysqld下的配置增加report_host=mysql1.db,
0 1 2 3 |
#/etc/mysql/mysql.conf.d/ report_host=mysql1.db #/etc/hosts 192.168.2.190 mysql1.db |
2.创建账户
2.1.一个InnoDB Cluster server configuration账户用于配置集群的实例
使用dba.configureInstance()创建
2.2.一个或多个InnoDB Cluster administrator账户可以在集群安装后被用来管理服务器实例
在所有节点加入集群后,使用
,这个命令会创建指定的账号并赋予所需的权限,创建这个账号的事务会写入binlog并发送给集群的其他服务器cluster
.setupAdminAccount()
2.3一个或多个MySQL Router账户可以被MySQL Router用来连接集群
以上每个账户必须在所有InnoDB Cluster节点同时存在, 并使用相同的用户名和相同的密码
mysqlsh进入终端,在三个机器重复这个过程
0 1 2 3 |
mysqlsh> dba.configureInstance('debian-sys-maint@localhost:3306',{clusterAdmin:"'icadmin'@'localhost'"}) dba.configureInstance('debian-sys-maint@localhost:3306',{clusterAdmin:"'icadmin'@'192.168.2.%'"}) |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
MySQL JS > dba.configureInstance('root@localhost:3306',{clusterAdmin:"'icadmin'@'localhost'"}) Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster... This instance reports its own address as mysql1.db:3306 Password for new account: ******** Confirm password: ******** applierWorkerThreads will be set to the default value of 4. NOTE: Some configuration options need to be fixed: +----------------------------------------+---------------+----------------+--------------------------------------------------+ | Variable | Current Value | Required Value | Note | +----------------------------------------+---------------+----------------+--------------------------------------------------+ | binlog_transaction_dependency_tracking | COMMIT_ORDER | WRITESET | Update the server variable | | enforce_gtid_consistency | OFF | ON | Update read-only variable and restart the server | | gtid_mode | OFF | ON | Update read-only variable and restart the server | | server_id | 1 | <unique ID> | Update read-only variable and restart the server | +----------------------------------------+---------------+----------------+--------------------------------------------------+ Some variables need to be changed, but cannot be done dynamically on the server. Do you want to perform the required configuration changes? [y/n]: y Do you want to restart the instance after configuring it? [y/n]: y Cluster admin user 'icadmin'@'localhost' created. Configuring instance... The instance 'mysql1.db:3306' was configured to be used in an InnoDB cluster. Restarting MySQL... NOTE: MySQL server at mysql1.db:3306 was restarted. |
3.检查机器
使用dba.checkInstanceConfiguration(
可以检查节点是否满足 Section 7.1, “InnoDB Cluster Requirements” 提到的前置条件,详见 Checking Instance Stateinstance
)
使用dba.configureInstance()
来自动配置节点
连接服务器所用的账户必须有这里要求的权限 Configuring InnoDB Cluster Administrator Accounts Manually
三个机器分别检查自己本地和对方
0 1 2 3 4 5 6 |
mysqlsh> dba.checkInstanceConfiguration('icadmin@localhost:3306') dba.checkInstanceConfiguration('icadmin@mysql1.db:3306') dba.checkInstanceConfiguration('icadmin@mysql2.db:3306') dba.checkInstanceConfiguration('icadmin@mysql3.db:3306') 换官方源安装mysql就不报错了,ubuntu的源会有错。。。。 |
成功会输出这样的
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
MySQL JS > dba.checkInstanceConfiguration('icadmin@mysql3.db:3306') Please provide the password for 'icadmin@mysql3.db:3306': ******** Save password for 'icadmin@mysql3.db:3306'? [Y]es/[N]o/Ne[v]er (default No): Y Validating MySQL instance at mysql3.db:3306 for use in an InnoDB cluster... This instance reports its own address as mysql3.db:3306 Checking whether existing tables comply with Group Replication requirements... No incompatible tables detected Checking instance configuration... Instance configuration is compatible with InnoDB cluster The instance 'mysql3.db:3306' is valid to be used in an InnoDB cluster. { "status": "ok" } |
4.创建集群并添加节点
使用\connect 连接主节点
0 1 2 3 4 5 6 7 |
MySQL JS > \connect icadmin@mysql1.db:3306 Creating a session to 'icadmin@mysql1.db:3306' Fetching schema names for auto-completion... Press ^C to stop. Your MySQL connection id is 18 Server version: 8.0.31 MySQL Community Server - GPL No default schema selected; type \use <schema> to set one. MySQL mysql1.db:3306 ssl JS > |
使用dba.createCluster()
使用当前 MySQL Shell 连接的节点作为集群的种子
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
MySQL mysql1.db:3306 ssl JS > dba.createCluster('testCluster', {replicationAllowedHost:'192.168.2.0/24'}) A new InnoDB Cluster will be created on instance 'mysql1.db:3306'. Validating instance configuration at mysql1.db:3306... This instance reports its own address as mysql1.db:3306 Instance configuration is suitable. NOTE: Group Replication will communicate with other members using 'mysql1.db:3306'. Use the localAddress option to override. Creating InnoDB Cluster 'testCluster' on 'mysql1.db:3306'... Adding Seed Instance... Cluster successfully created. Use Cluster.addInstance() to add MySQL instances. At least 3 instances are needed for the cluster to be able to withstand up to one server failure. <Cluster:testCluster> |
使用setupAdminAccount广播管理账号,生产环境的话要注意下安全,这里测试没限定网段
0 1 2 3 4 5 6 7 8 9 10 11 12 13 |
MySQL mysql1.db:3306 ssl JS > var cluster = dba.getCluster() MySQL mysql1.db:3306 ssl JS > cluster <Cluster:testCluster> MySQL mysql1.db:3306 ssl JS > cluster.setupAdminAccount("icadmin") Missing the password for new account icadmin@%. Please provide one. Password for new account: ******** Confirm password: ******** Creating user icadmin@%. Account icadmin@% was successfully created. MySQL mysql1.db:3306 ssl JS > |
使用cluster.addInstance()向当前集群内增加节点,C选择完全量复制,I选择增量复制,默认是全量
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
MySQL mysql1.db:3306 ssl JS > cluster.addInstance('icadmin@mysql2.db:3306') NOTE: The target instance 'mysql2.db:3306' has not been pre-provisioned (GTID set is empty). The Shell is unable to decide whether incremental state recovery can correctly provision it. The safest and most convenient way to provision a new instance is through automatic clone provisioning, which will completely overwrite the state of 'mysql2.db:3306' with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'. The incremental state recovery may be safely used if you are sure all updates ever executed in the cluster were done with GTIDs enabled, there are no purged transactions and the new instance contains the same GTID set as the cluster or a subset of it. To use this method by default, set the 'recoveryMethod' option to 'incremental'. Please select a recovery method [C]lone/[I]ncremental recovery/[A]bort (default Clone): C Validating instance configuration at mysql2.db:3306... This instance reports its own address as mysql2.db:3306 Instance configuration is suitable. NOTE: Group Replication will communicate with other members using 'mysql2.db:3306'. Use the localAddress option to override. A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Adding instance to the cluster... Monitoring recovery process of the new cluster member. Press ^C to stop monitoring and let it continue in background. Clone based state recovery is now in progress. NOTE: A server restart is expected to happen as part of the clone process. If the server does not support the RESTART command or does not come back after a while, you may need to manually start it back. * Waiting for clone to finish... NOTE: mysql2.db:3306 is being cloned from mysql1.db:3306 ** Stage DROP DATA: Completed ** Clone Transfer FILE COPY ############################################################ 100% Completed PAGE COPY ############################################################ 100% Completed REDO COPY ############################################################ 100% Completed NOTE: mysql2.db:3306 is shutting down... * Waiting for server restart... ready * mysql2.db:3306 has restarted, waiting for clone to finish... ** Stage RESTART: Completed * Clone process has finished: 73.65 MB transferred in 2 sec (36.83 MB/s) State recovery already finished for 'mysql2.db:3306' The instance 'mysql2.db:3306' was successfully added to the cluster. |
使用
查看当前集群状态cluster
.status()
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
MySQL mysql1.db:3306 ssl JS > cluster.status() { "clusterName": "testCluster", "defaultReplicaSet": { "name": "default", "primary": "mysql1.db:3306", "ssl": "REQUIRED", "status": "OK_NO_TOLERANCE", "statusText": "Cluster is NOT tolerant to any failures.", "topology": { "mysql1.db:3306": { "address": "mysql1.db:3306", "memberRole": "PRIMARY", "mode": "R/W", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.31" }, "mysql2.db:3306": { "address": "mysql2.db:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.31" } }, "topologyMode": "Single-Primary" }, "groupInformationSourceMember": "mysql1.db:3306" } |
重复这个过程,添加mysql3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
MySQL mysql1.db:3306 ssl JS > cluster.addInstance('icadmin@mysql3.db:3306') NOTE: The target instance 'mysql3.db:3306' has not been pre-provisioned (GTID set is empty). The Shell is unable to decide whether incremental state recovery can correctly provision it. The safest and most convenient way to provision a new instance is through automatic clone provisioning, which will completely overwrite the state of 'mysql3.db:3306' with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'. The incremental state recovery may be safely used if you are sure all updates ever executed in the cluster were done with GTIDs enabled, there are no purged transactions and the new instance contains the same GTID set as the cluster or a subset of it. To use this method by default, set the 'recoveryMethod' option to 'incremental'. Please select a recovery method [C]lone/[I]ncremental recovery/[A]bort (default Clone): Validating instance configuration at mysql3.db:3306... This instance reports its own address as mysql3.db:3306 Instance configuration is suitable. NOTE: Group Replication will communicate with other members using 'mysql3.db:3306'. Use the localAddress option to override. A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Adding instance to the cluster... Monitoring recovery process of the new cluster member. Press ^C to stop monitoring and let it continue in background. Clone based state recovery is now in progress. NOTE: A server restart is expected to happen as part of the clone process. If the server does not support the RESTART command or does not come back after a while, you may need to manually start it back. * Waiting for clone to finish... NOTE: mysql3.db:3306 is being cloned from mysql1.db:3306 ** Stage DROP DATA: Completed ** Clone Transfer FILE COPY ############################################################ 100% Completed PAGE COPY ############################################################ 100% Completed REDO COPY ############################################################ 100% Completed NOTE: mysql3.db:3306 is shutting down... * Waiting for server restart... ready * mysql3.db:3306 has restarted, waiting for clone to finish... ** Stage RESTART: Completed * Clone process has finished: 73.65 MB transferred in 2 sec (36.83 MB/s) State recovery already finished for 'mysql3.db:3306' The instance 'mysql3.db:3306' was successfully added to the cluster. |
再次查看集群状态,可以看到mysql1是主,mysql2和3是从
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
MySQL mysql1.db:3306 ssl JS > cluster.status() { "clusterName": "testCluster", "defaultReplicaSet": { "name": "default", "primary": "mysql1.db:3306", "ssl": "REQUIRED", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": { "mysql1.db:3306": { "address": "mysql1.db:3306", "memberRole": "PRIMARY", "mode": "R/W", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.31" }, "mysql2.db:3306": { "address": "mysql2.db:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.31" }, "mysql3.db:3306": { "address": "mysql3.db:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.31" } }, "topologyMode": "Single-Primary" }, "groupInformationSourceMember": "mysql1.db:3306" } |
使用 cluster.checkInstanceState() 检查集群内节点状态
0 1 2 3 4 5 6 |
MySQL mysql1.db:3306 ssl JS > cluster.checkInstanceState('icadmin@mysql1.db:3306') Cluster.checkInstanceState: The instance 'mysql1.db:3306' already belongs to the cluster: 'testCluster'. (RuntimeError) MySQL mysql1.db:3306 ssl JS > cluster.checkInstanceState('icadmin@mysql2.db:3306') Cluster.checkInstanceState: The instance 'mysql2.db:3306' already belongs to the cluster: 'testCluster'. (RuntimeError) MySQL mysql1.db:3306 ssl JS > cluster.checkInstanceState('icadmin@mysql3.db:3306') Cluster.checkInstanceState: The instance 'mysql3.db:3306' already belongs to the cluster: 'testCluster'. (RuntimeError) |
5.集群测试
5.1.写入测试
连上mysql1,往mysql1里写下数据测试下,在mysql2和3上查看
0 1 2 3 4 5 6 7 8 9 |
mysql> SELECT * FROM performance_schema.replication_group_members; +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | group_replication_applier | 11036483-680c-11ed-932f-000c2956aa71 | mysql1.db | 3306 | ONLINE | PRIMARY | 8.0.31 | MySQL | | group_replication_applier | 12c67576-680c-11ed-b216-000c2924d927 | mysql2.db | 3306 | ONLINE | SECONDARY | 8.0.31 | MySQL | | group_replication_applier | 12e569b4-680c-11ed-b942-000c29409b22 | mysql3.db | 3306 | ONLINE | SECONDARY | 8.0.31 | MySQL | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ 3 rows in set (0.00 sec) |
0 1 2 3 4 5 6 7 8 9 10 11 |
mysql> CREATE DATABASE test; E test; CREATE TABLE t1 (c1Query OK, 1 row affected (0.02 sec) mysql> USE test; INT PRIMARY KEY, c2 TEXT NOTDatabase changed mysql> CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL); NSERT INTO t1 VALUES (1, 'Luis');Query OK, 0 rows affected (0.04 sec) mysql> INSERT INTO t1 VALUES (1, 'Luis'); Query OK, 1 row affected (0.01 sec) |
0 1 2 3 4 5 6 7 |
mysql> select * from test.t1; +----+------+ | c1 | c2 | +----+------+ | 1 | Luis | +----+------+ 1 row in set (0.00 sec) |
5.2 灾备测试
我们尝试直接停掉mysql1的服务来模拟主库挂掉,在两外两个机器上查看集群状态,可以看到mysql2自动成为了PRIMARY
0 1 2 3 4 5 6 7 8 |
mysql> SELECT * FROM performance_schema.replication_group_members; +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | group_replication_applier | 12c67576-680c-11ed-b216-000c2924d927 | mysql2.db | 3306 | ONLINE | PRIMARY | 8.0.31 | MySQL | | group_replication_applier | 12e569b4-680c-11ed-b942-000c29409b22 | mysql3.db | 3306 | ONLINE | SECONDARY | 8.0.31 | MySQL | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ 2 rows in set (0.00 sec) |
向mysql2写入数据测试
0 1 2 3 4 |
mysql> INSERT INTO test.t1 VALUES (2, 'HylTest'); Query OK, 1 row affected (0.00 sec) mysql> |
到mysql3查看,可以看到数据正常
0 1 2 3 4 5 6 7 8 |
mysql> select * from test.t1; +----+---------+ | c1 | c2 | +----+---------+ | 1 | Luis | | 2 | HylTest | +----+---------+ 2 rows in set (0.00 sec) |
重新把mysql1启动,在mysql2也就是当前的主节点查看集群,可以看到mysql1自动成为了SECONDARY
0 1 2 3 4 5 6 7 8 9 |
mysql> SELECT * FROM performance_schema.replication_group_members; +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ | group_replication_applier | 11036483-680c-11ed-932f-000c2956aa71 | mysql1.db | 3306 | ONLINE | SECONDARY | 8.0.31 | MySQL | | group_replication_applier | 12c67576-680c-11ed-b216-000c2924d927 | mysql2.db | 3306 | ONLINE | PRIMARY | 8.0.31 | MySQL | | group_replication_applier | 12e569b4-680c-11ed-b942-000c29409b22 | mysql3.db | 3306 | ONLINE | SECONDARY | 8.0.31 | MySQL | +---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+ 3 rows in set (0.00 sec) |
到mysql1检查下c1=2也就是宕机期间的数据还在不在,可以发现mysql1重新加入集群后会自动恢复宕机期间的数据
0 1 2 3 4 5 6 7 8 |
mysql> select * from test.t1; +----+---------+ | c1 | c2 | +----+---------+ | 1 | Luis | | 2 | HylTest | +----+---------+ 2 rows in set (0.00 sec) |
附录:用到的命令
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
mysql1 192.168.2.192 mysql2 192.168.2.171 mysql3 192.168.2.219 scp .\mysql-apt-config_0.8.24-1_all.deb mysql1@192.168.2.192:/home/mysql1 scp .\mysql-apt-config_0.8.24-1_all.deb mysql2@192.168.2.171:/home/mysql2 scp .\mysql-apt-config_0.8.24-1_all.deb mysql3@192.168.2.219:/home/mysql3 sudo dpkg -i mysql-apt-config_0.8.24-1_all.deb sudo apt install -y net-tools mysql-apt-config #https://mirrors.tuna.tsinghua.edu.cn sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list sudo apt update sudo apt install -y mysql-server mysql-shell root bqRnG3iP mysql -u root -p MySQL 8 uses a new authentication based on improved SHA256-based password methods. It is recommended that all new MySQL Server installations use this method going forward. This new authentication plugin requires new versions of connectors and clients, with support for this new authentication method (caching_sha2_password). Currently MySQL 8 Connectors and community drivers built with libmysqlclient21 support this new method. Clients built with older versions of libmysqlclient may not be able to connect to the new server. To retain compatibility with older client software, the default authentication plugin can be set to the legacy value (mysql_native_password) This should only be done if required third-party software has not been updated to work with the new authentication method. The change will be written to the file /etc/mysql/mysql.conf.d/default-auth-override.cnf After installation, the default can be changed by setting the default_authentication_plugin server setting. #for ubuntu default mysql source sudo cat /etc/mysql/debian.cnf debian-sys-maint sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf report_host=mysql1.db report_host=mysql2.db report_host=mysql3.db sudo service mysql restart #/etc/hosts 192.168.2.192 mysql1.db 192.168.2.171 mysql2.db 192.168.2.219 mysql3.db icadmin bqRnG3iP dba.configureInstance('root@localhost:3306',{clusterAdmin:"'icadmin'@'localhost'"}) dba.configureInstance('root@localhost:3306',{clusterAdmin:"'icadmin'@'192.168.2.%'"}) dba.checkInstanceConfiguration('icadmin@localhost:3306') dba.checkInstanceConfiguration('icadmin@mysql1.db:3306') dba.checkInstanceConfiguration('icadmin@mysql2.db:3306') dba.checkInstanceConfiguration('icadmin@mysql3.db:3306') \connect icadmin@mysql1.db:3306 dba.createCluster('testCluster', {replicationAllowedHost:'192.168.2.0/24'}) var cluster = dba.getCluster() cluster.setupAdminAccount("icadmin") cluster.addInstance('icadmin@mysql2.db:3306') cluster.addInstance('icadmin@mysql3.db:3306') SELECT * FROM performance_schema.replication_group_members; CREATE DATABASE test; USE test; CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL); INSERT INTO t1 VALUES (1, 'Luis'); INSERT INTO t1 VALUES (2, 'HylTest'); INSERT INTO t1 VALUES (3, 'HylTest3'); INSERT INTO t1 VALUES (4, 'HylTest4'); select * from test.t1; |
ubuntu安装速度测试
安系统时候在均使用清华源情况下居然发现有错,顺便测下怎么给资源能装的快点
#https://mirrors.tuna.tsinghua.edu.cn
都是40G预分配硬盘
是否联网|核数内存|单个CPU核数*CPU个数|测试结果 虚拟磁盘名
联网|8c1g| 1c*8 不开启VT-x| 反复安装失败 从未见过,可能是CPU内存给少了
联网|8c2g| 1c*8 不开启VT-x| 将近25min,怀疑是CPU给少了 mysql1.vmdk
联网|8c2g| 4c*2 不开启VT-x| 18min,大概10min装完,但是自动升级花了8min mysql1-0.vmdk
断网|8c2g| 4c*2 不开启VT-x| 6min,果然还是断网大法最好,后面都断网装系统好了。这样首次启动联网即可有DHCP下发的IP不影响测试 mysql1-1.vmdk
继续尝试增加核心数看看能否更快
断网|8c2g| 8c*1 不开启VT-x| 5min45s,基本持平,所以CPU数量并不影响这个速度,尝试削减核数 mysql1-2.vmdk
断网|4c2g| 4c*1 不开启VT-x|5min51s,基本持平,所以CPU核数并不影响这个速度,怀疑是单线程,因此试试1c*1 mysql1-3.vmdk
断网|1c2g| 1c*1 不开启VT-x|7min23s,明显下滑,说明不是单线程,至少是2个线程,不然不会这么长时间 mysql1-4.vmdk
断网|2c2g| 2c*1 不开启VT-x|6min22s,回归6min上下了,说明安装的过程确实是2个线程 mysql1-5.vmdk
断网|2c2g| 2c*1 开启VT-x|TODO 有闲心再测 估计不会再快了
参考文档
https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install-linux-quick.html
https://dev.mysql.com/doc/mysql-shell/8.0/en/configuring-router-user.html
https://dev.mysql.com/doc/mysql-shell/8.0/en/innodb-cluster-user-accounts.html#admin-api-configuring-users
https://dev.mysql.com/doc/mysql-shell/8.0/en/check-instance-configuration.html
https://dev.mysql.com/doc/mysql-shell/8.0/en/creating-user-accounts-for-admin-api.html
0 Comments