MySQL 5.7基於GTID的主從複製

来源:https://www.cnblogs.com/aaron8219/archive/2018/06/05/9141914.html
-Advertisement-
Play Games

since i've broken down the replication enviornment by "reset master;" yesterday.therefore,i'd like to reconfigure it again,there're several simple ste ...


        since i've broken down the replication enviornment by "reset master;" yesterday.therefore,i'd like to reconfigure it again,there're several simple steps below:
  I. Master node operations:
 1 1.Check the necessary parameter is surely spedified.
 2 (root@localhost mysql3306.sock)[(none)]04:04:00>show variables like 'server_id';
 3 +---------------+---------+
 4 | Variable_name | Value   |
 5 +---------------+---------+
 6 | server_id     | 1023306 |
 7 +---------------+---------+
 8 1 row in set (0.00 sec)
 9 
10 (root@localhost mysql3306.sock)[(none)]04:04:22>show variables like 'log_bin';
11 +---------------+-------+
12 | Variable_name | Value |
13 +---------------+-------+
14 | log_bin       | ON    |
15 +---------------+-------+
16 1 row in set (0.00 sec)
17 
18 (root@localhost mysql3306.sock)[(none)]04:04:22>show variables like 'gtid_mode';
19 +---------------+-------+
20 | Variable_name | Value |
21 +---------------+-------+
22 | gtid_mode     | ON    |
23 +---------------+-------+
24 1 row in set (0.00 sec)
25 
26 This two parameter below is not necessary but still recommended:
27 
28 (root@localhost mysql3306.sock)[(none)]04:04:23>show variables like 'enforce_gtid_consistency';
29 +--------------------------+-------+
30 | Variable_name            | Value |
31 +--------------------------+-------+
32 | enforce_gtid_consistency | ON    |
33 +--------------------------+-------+
34 1 row in set (0.00 sec)
35 
36 (root@localhost mysql3306.sock)[(none)]04:04:30>show variables like 'log_slave_updates';
37 +-------------------+-------+
38 | Variable_name     | Value |
39 +-------------------+-------+
40 | log_slave_updates | ON    |
41 +-------------------+-------+
42 1 row in set (0.00 sec)
43 
44 (root@localhost mysql3306.sock)[(none)]04:04:31>
45 
46 2.Create replication user and grant imperative privileges. 
47 (root@localhost mysql3306.sock)[(none)]04:12:49>create user 'repl'@'%' identified by 'repl4slave';
48 Query OK, 0 rows affected (0.01 sec)
49 
50 (root@localhost mysql3306.sock)[(none)]04:12:57>grant replication slave on *.* to 'repl'@'%';
51 Query OK, 0 rows affected (0.00 sec)
52 
53 (root@localhost mysql3306.sock)[(none)]04:13:06>
54         
55 3.Backup the full database of master by mysqldump and send to the purpose Slave node.
56 [root@zlm3 04:20:52 /data/backup]
57 #pwd
58 /data/backup
59 
60 [root@zlm3 04:23:54 /data/backup]
61 #/usr/local/mysql/bin/mysqldump -S /tmp/mysql3306.sock -p --master-data=2 --single-transaction -A > db3306-`date +%Y%m%d`.sql
62 Enter password: 
63 Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events. 
64 
65 [root@zlm3 04:24:05 /data/backup]
66 #ls -l
67 total 1016
68 -rw-r--r-- 1 root root 1038595 Jun  6 04:24 db3306-20180606.sql
69 
70 using the "-E","-R" to add events and routines into the dumpfile of backup can eliminate above warning messages.why not using "--trigger" parameter?'cause its default value is "true" in my MySQL version(5.7.21),there's no need to explicitly specify.
71 
72 [root@zlm3 04:24:21 /data/backup]
73 #/usr/local/mysql/bin/mysqldump -S /tmp/mysql3306.sock -p --master-data=2 --single-transaction -A -E -R > db3306-`date +%Y%m%d`-full.sql
74 Enter password: 
75 
76 [root@zlm3 04:24:32 /data/backup]
77 #ls -l
78 total 2036
79 -rw-r--r-- 1 root root 1040952 Jun  6 04:24 db3306-20180606-full.sql
80 -rw-r--r-- 1 root root 1038595 Jun  6 04:24 db3306-20180606.sql
81 
82 [root@zlm3 04:24:36 /data/backup]
83 #scp db3306-20180606-full.sql zlm4:/data/backup
84 root@zlm4's password: 
85 db3306-20180606-full.sql                                                                                           100% 1017KB   1.0MB/s   00:00    
86 
87 [root@zlm3 04:24:56 /data/backup]
88 #

 

II. Slave node operations:

  1 1.clean the enviornment.(here i'll use the "rm -rf" to delete all the original files on it.)
  2 [root@zlm4 04:36:34 /data/mysql/mysql3306/data]
  3 #pwd
  4 /data/mysql/mysql3306/data
  5 
  6 [root@zlm4 04:36:37 /data/mysql/mysql3306/data]
  7 #ls -l
  8 total 410524
  9 -rw-r----- 1 mysql mysql        56 Apr 28 14:40 auto.cnf
 10 -rw-r----- 1 mysql mysql    847926 Jun  4 11:23 error.log
 11 -rw-r----- 1 mysql mysql      2144 Jun  4 11:23 ib_buffer_pool
 12 -rw-r----- 1 mysql mysql 104857600 Jun  4 11:23 ibdata1
 13 -rw-r----- 1 mysql mysql 104857600 Jun  4 11:23 ib_logfile0
 14 -rw-r----- 1 mysql mysql 104857600 May 28 03:27 ib_logfile1
 15 -rw-r----- 1 mysql mysql 104857600 Jun  4 11:23 ib_logfile2
 16 -rw-r----- 1 mysql mysql      3821 Apr 28 20:57 innodb_status.5065
 17 -rw-r----- 1 mysql mysql       136 Jun  4 11:23 master.info
 18 drwxr-x--- 2 mysql mysql      4096 Apr 28 14:40 mysql
 19 drwxr-x--- 2 mysql mysql      8192 Apr 28 14:40 performance_schema
 20 -rw-r----- 1 mysql mysql       201 Jun  4 06:49 relay-bin.000063
 21 -rw-r----- 1 mysql mysql       390 Jun  4 11:23 relay-bin.000064
 22 -rw-r----- 1 mysql mysql        38 Jun  4 06:49 relay-bin.index
 23 -rw-r----- 1 mysql mysql        65 Jun  4 11:23 relay-log.info
 24 -rw-r----- 1 mysql mysql     14064 Jun  4 06:46 slow.log
 25 drwxr-x--- 2 mysql mysql      8192 Apr 28 14:40 sys
 26 drwxr-x--- 2 mysql mysql      8192 May  2 04:59 zabbix
 27 drwxr-x--- 2 mysql mysql        97 May 29 04:28 zlm
 28 
 29 [root@zlm4 04:36:39 /data/mysql/mysql3306/data]
 30 #rm -rf *
 31 
 32 [root@zlm4 04:36:48 /data/mysql/mysql3306/data]
 33 #ls -l
 34 total 0
 35 
 36 [root@zlm4 04:36:51 /data/mysql/mysql3306/data]
 37 #cd ..
 38 
 39 [root@zlm4 04:36:52 /data/mysql/mysql3306]
 40 #cd logs
 41 
 42 [root@zlm4 04:37:07 /data/mysql/mysql3306/logs]
 43 #ls -l
 44 total 42944
 45 -rw-r----- 1 mysql mysql 8611664 May 25 11:31 mysql-bin.000015
 46 -rw-r----- 1 mysql mysql     257 May 25 11:31 mysql-bin.000016
 47 -rw-r----- 1 mysql mysql 2019506 May 28 04:49 mysql-bin.000017
 48 -rw-r----- 1 mysql mysql 5654926 May 28 11:37 mysql-bin.000018
 49 -rw-r----- 1 mysql mysql 7148106 May 29 11:27 mysql-bin.000019
 50 -rw-r----- 1 mysql mysql 7010806 May 30 11:29 mysql-bin.000020
 51 -rw-r----- 1 mysql mysql   73339 May 31 03:16 mysql-bin.000021
 52 -rw-r----- 1 mysql mysql 7646943 May 31 11:28 mysql-bin.000022
 53 -rw-r----- 1 mysql mysql 1126469 Jun  1 11:38 mysql-bin.000023
 54 -rw-r----- 1 mysql mysql 4626287 Jun  4 11:23 mysql-bin.000024
 55 -rw-r----- 1 mysql mysql     440 Jun  4 06:46 mysql-bin.index
 56 
 57 [root@zlm4 04:37:08 /data/mysql/mysql3306/logs]
 58 #rm -f *
 59 
 60 [root@zlm4 04:37:12 /data/mysql/mysql3306/logs]
 61 #ls -l
 62 total 0
 63 
 64 [root@zlm4 04:45:39 /data/mysql/mysql3306/logs]
 65 #
 66                          
 67 2.Start the mysqld and check the necessary parameter in mysql client.                       
 68 [root@zlm4 04:34:50 ~]
 69 #sh mysqld.sh
 70 
 71 [root@zlm4 04:40:50 ~]
 72 #ps aux|grep mysqld
 73 mysql     4012 25.1 15.8 896948 161060 pts/1   Sl   04:40   0:01 mysqld --defaults-file=/data/mysql/mysql3306/my.cnf
 74 root      4042  0.0  0.0 112640   960 pts/1    R+   04:40   0:00 grep --color=auto mysqld
 75 
 76 [root@zlm4 04:40:55 ~]
 77 #mysql
 78 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 79 
 80 [root@zlm4 04:40:58 ~]
 81 #ps aux|grep mysqld
 82 root      4053  0.0  0.0 112640   960 pts/1    R+   04:41   0:00 grep --color=auto mysqld
 83 
 84 The mysqld cannot be started,let's check the "error.log" to findout what has happened.
 85 
 86 [root@zlm4 04:41:10 ~]
 87 #cd /data/mysql/mysql3306/data/
 88 
 89 [root@zlm4 04:41:32 /data/mysql/mysql3306/data]
 90 #ls -l
 91 total 409624
 92 -rw-r----- 1 mysql mysql        56 Jun  6 04:40 auto.cnf
 93 -rw-r----- 1 mysql mysql      9361 Jun  6 04:40 error.log
 94 -rw-r----- 1 mysql mysql       215 Jun  6 04:40 ib_buffer_pool
 95 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:40 ibdata1
 96 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:40 ib_logfile0
 97 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:40 ib_logfile1
 98 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:40 ib_logfile2
 99 -rw-r----- 1 mysql mysql       173 Jun  6 04:40 slow.log
100 
101 [root@zlm4 04:43:05 /data/mysql/mysql3306/data]
102 #cat error.log|grep ERROR
103 2018-06-06T02:40:54.506533Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
104 2018-06-06T02:40:54.516986Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
105 2018-06-06T02:40:54.517028Z 0 [ERROR] Aborting
106 
107 [root@zlm4 04:43:15 /data/mysql/mysql3306/data]
108 #                         
109 
110 It seems the mysql.user table is indispensable.thus,i'll initialize the db first. 
111 
112 [root@zlm4 04:43:15 /data/mysql/mysql3306/data]
113 #/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my.cnf --initialize
114 2018-06-06T02:54:35.627237Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
115 2018-06-06T02:54:35.627308Z 0 [ERROR] Aborting
116 
117 
118 [root@zlm4 04:54:35 /data/mysql/mysql3306/data]
119 #rm -f *
120 
121 [root@zlm4 04:54:47 /data/mysql/mysql3306/data]
122 #/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my.cnf --initialize
123 
124 [root@zlm4 04:54:54 /data/mysql/mysql3306/data]
125 #ls -l
126 total 409644
127 -rw-r----- 1 mysql mysql        56 Jun  6 04:54 auto.cnf
128 -rw-r----- 1 mysql mysql       984 Jun  6 04:54 error.log
129 -rw-r----- 1 mysql mysql       420 Jun  6 04:54 ib_buffer_pool
130 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:54 ibdata1
131 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:54 ib_logfile0
132 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:54 ib_logfile1
133 -rw-r----- 1 mysql mysql 104857600 Jun  6 04:54 ib_logfile2
134 drwxr-x--- 2 mysql mysql      4096 Jun  6 04:54 mysql
135 drwxr-x--- 2 mysql mysql      8192 Jun  6 04:54 performance_schema
136 -rw-r----- 1 mysql mysql       194 Jun  6 04:54 slow.log
137 drwxr-x--- 2 mysql mysql      8192 Jun  6 04:54 sys
138 
139 [root@zlm4 04:54:58 /data/mysql/mysql3306/data]
140 #ps aux|grep mysqld
141 root      4146  0.0  0.0 112640   960 pts/1    R+   04:55   0:00 grep --color=auto mysqld
142 
143 [root@zlm4 04:55:56 /data/mysql/mysql3306/data]
144 #/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my.cnf &
145 [1] 4151
146 
147 [root@zlm4 04:56:11 /data/mysql/mysql3306/data]
148 #ps aux|grep mysqld
149 mysql     4151  9.0 17.3 1069544 176676 pts/1  Sl   04:56   0:00 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my.cnf
150 root      4184  0.0  0.0 112640   956 pts/1    R+   04:56   0:00 grep --color=auto mysqld
151 
152 [root@zlm4 04:56:14 /data/mysql/mysql3306/data]
153 #
154 
155 okay,the mysqld process turned to be normal right now,go on.
156                                               
157 3.check the necessary parameter.(if they're not correct,modify them)
158 [root@zlm4 05:01:32 /data/mysql/mysql3306/data]
159 #mysql
160 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
161 
162 [root@zlm4 05:01:47 /data/mysql/mysql3306/data]
163 #cat error.log | grep temporary password
164 grep: password: No such file or directory
165 
166 [root@zlm4 05:02:19 /data/mysql/mysql3306/data]
167 #cat error.log | grep "temporary password"
168 2018-06-06T02:54:52.457126Z 1 [Note] A temporary password is generated for root@localhost: r?uoNuzqz3oj
169 
170 [root@zlm4 05:02:39 /data/mysql/mysql3306/data]
171 #mysql -p
172 Enter password: 
173 Welcome to the MySQL monitor.  Commands end with ; or \g.
174 Your MySQL connection id is 44
175 Server version: 5.7.21-log
176 
177 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
178 
179 Oracle is a registered trademark of Oracle Corporation and/or its
180 affiliates. Other names may be trademarks of their respective
181 owners.
182 
183 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
184 
185 (root@localhost mysql.sock)[(none)]05:02:57>show variables like 'server_id';
186 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
187 (root@localhost mysql.sock)[(none)]05:08:32>
188 
189 because of the MySQL 5.7 security strategies,using temprary password "r?uoNuzqz3oj" to login after initialization at the first time is imperative and the password must be changed before doing queries.
190 
191 (root@localhost mysql.sock)[(none)]05:12:02>alter user 'root'@'localhost' identified by 'Passw0rd';
192 Query OK, 0 rows affected (0.00 sec)
193 
194 (root@localhost mysql.sock)[(none)]05:12:36>show variables like 'server_id';
195 +---------------+---------+
196 | Variable_name | Value   |
197 +---------------+---------+
198 | server_id     | 1033306 |  --look out,the "server_id" should be different with the one in Maser host.
199 +---------------+---------+
200 1 row in set (0.00 sec)
201 
202 (root@localhost mysql.sock)[(none)]05:13:06>show variables like 'log_bin';
203 +---------------+-------+
204 | Variable_name | Value |
205 +---------------+-------+
206 | log_bin       | ON    |
207 +---------------+-------+
208 1 row in set (0.00 sec)
209 
210 (root@localhost mysql.sock)[(none)]05:13:11>show variables like 'gtid_mode';
211 +---------------+-------+
212 | Variable_name | Value |
213 +---------------+-------+
214 | gtid_mode     | ON    |
215 +---------------+-------+
216 1 row in set (0.01 sec)
217 
218 (root@localhost mysql.sock)[(none)]05:13:16>show variables like 'enforce_gtid_consistency';
219 +--------------------------+-------+
220 | Variable_name            | Value |
221 +--------------------------+-------+
222 | enforce_gtid_consistency | ON    |
223 +--------------------------+-------+
224 1 row in set (0.01 sec)
225 
226 (root@localhost mysql.sock)[(none)]05:13:20>show variables like 'log_slave_updates';
227 +-------------------+-------+
228 | Variable_name     | Value |
229 +-------------------+-------+
230 | log_slave_updates | ON    |
231 +-------------------+-------+
232 1 row in set (0.01 sec)
233 
234 (root@localhost mysql.sock)[(none)]05:13:25>
235                                              
236 4. Import the dumpfile of backup received from the Master node                       
237 [root@zlm4 06:05:18 ~]
238 #cd /data/backup
239 
240 [root@zlm4 06:05:22 /data/backup]
241 #ls -l
242 total 1020
243 -rw-r--r-- 1 root root 1040952 Jun  6 04:24 db3306-20180606-full.sql
244 
245 [root@zlm4 06:05:24 /data/backup]
246 #mysql < db3306-20180606-full.sql
247 ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
248 
249 [root@zlm4 06:05:47 /data/backup]
250 #mysql
251 Welcome to the MySQL monitor.  Commands end with ; or \g.
252 Your MySQL connection id is 446
253 Server version: 5.7.21-log MySQL Community Server (GPL)
254 
255 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
256 
257 Oracle is a registered trademark of Oracle Corporation and/or its
258 affiliates. Other names may be trademarks of their respective
259 owners.
260 
261 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
262 
263 (root@localhost mysql.sock)[(none)]06:08:54>show master status;
264 +------------------+----------+--------------+------------------+----------------------------------------+
265 	   

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 原本以為 正則表達式裡面的特殊\d匹配數字放到sql語句裡面也是適用的,沒想到一直不匹配。但是放到編程語言java或者js裡面又匹配。看了一下原來sql對正則的支持沒有那麼全面。一定要用[0-9]代表數字。原因的話我猜是sql是一門查詢語言,設計原則不應該有和編程語言靠近的東西 ...
  • 第1章 初探大數據 本章將介紹為什麼要學習大數據、如何學好大數據、如何快速轉型大數據崗位、本項目實戰課程的內容安排、本項目實戰課程的前置內容介紹、開發環境介紹。同時為大家介紹項目中涉及的Hadoop、Hive相關的知識 第2章 Spark及其生態圈概述 Spark作為近幾年最火爆的大數據處理技術,是 ...
  • 實驗案例一:驗證索引的作用 1、首先創建一個數據量大的表,名稱為“學生表”,分別有三列,學號,姓名和班級,如下圖所示,學號為自動編號,班級為預設值“一班”。 2、向表中插入大量數據,數據越多,驗證索引的效果越好。 使用語句完成:While 1>0 Insert into 學生表(姓名) values ...
  • 數據中心是智慧保護區的信息倉庫,為整個信息化平臺的高效運營提供豐富的數據源,全面支撐保護區各項應用。數據中心主要是通過保護區基礎資料庫建設工程的實施,通過規範生物多樣性信息分類、採集存儲、處理、交換和服務的標準,建成基礎資料庫。按照統一標準、共建共用、互聯互通的原則,以高端、集約、安全為目標,加強林 ...
  • 佛曰:“不可說,說既是錯”,所以本篇也是錯! 技術人的世界是一塊凈土,也許世界並不該這麼複雜。 ——KK 這篇感悟也許帶著些許悲涼、無奈,也許又帶著激情滿滿,也許還透著辛酸。 技術男 很多人眼裡的技術宅是[傻傻的] [情商低的] [不愛說話的][邋遢的]....當然也有一些好詞 [踏實] [誠實] ...
  • Kafka中存在大量的延遲操作,比如延遲生產、延遲拉取以及延遲刪除等。Kafka並沒有使用JDK自帶的Timer或者DelayQueue來實現延遲的功能,而是基於時間輪自定義了一個用於實現延遲功能的定時器(SystemTimer)。JDK的Timer和DelayQueue插入和刪除操作的平均時間複雜 ...
  • today,i'll using the open source tool named "binlog2sql" which is release by danfengchao to do some flashback test. here's the github address:https:// ...
  • 隨機查詢,方法可以有很多種。比如,查詢出所有記錄,然後隨機從列表中取n條記錄。使用程式便可實現。可是程式實現必須查詢出所有符合條件的記錄(至少是所有符合條件的記錄id),然後再隨機取出n個id,查詢資料庫。但是效率畢竟沒有資料庫中直接查詢得快。下麵介紹mysql中怎樣隨機查詢n條記錄。 1.最簡單的 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...