ProxySQL讀寫分離測試(續)

来源:https://www.cnblogs.com/aaron8219/archive/2018/08/10/9458301.html
-Advertisement-
Play Games

Preface I've implemented ProxySQL on PXC yesterday but got some errors when configured query rules.I'm gonna do it again in my master-slave environmen ...


  Preface       I've implemented ProxySQL on PXC yesterday but got some errors when configured query rules.I'm gonna do it again in my master-slave environment again.Let's see the procedure.   Procedure   Start ProxySQL.
1 [root@zlm1 17:22:46 /var/lib]
2 #service proxysql start
3 Starting ProxySQL: ProxySQL is already running.
4 
5 [root@zlm1 17:23:16 /var/lib]
6 #ps aux|grep proxysql
7 root       666  0.0  0.5  58180  5180 ?        S    15:06   0:00 proxysql -c /etc/proxysql.cnf -D /var/lib/proxysql
8 root       667  0.0  2.0 104152 21068 ?        Sl   15:06   0:02 proxysql -c /etc/proxysql.cnf -D /var/lib/proxysql
9 root      5523  0.0  0.0 112640   960 pts/1    R+   15:55   0:00 grep --color=auto proxysql

 

Login ProxySQL configure the hostgroups.
 1 [root@zlm1 17:27:11 ~]
 2 #mysql -uadmin -padmin -h127.0.0.1 -P6032
 3 mysql: [Warning] Using a password on the command line interface can be insecure.
 4 Welcome to the MySQL monitor.  Commands end with ; or \g.
 5 Your MySQL connection id is 1
 6 Server version: 5.5.30 (ProxySQL Admin Module)
 7 
 8 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
 9 
10 Oracle is a registered trademark of Oracle Corporation and/or its
11 affiliates. Other names may be trademarks of their respective
12 owners.
13 
14 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
15 
16 admin@127.0.0.1:6032 [(none)]>select * from mysql_replication_hostgroups;
17 Empty set (0.00 sec)
18 
19 admin@127.0.0.1:6032 [(none)]>insert into mysql_replication_hostgroups(writer_hostgroup,reader_hostgroup) values(10,20);
20 Query OK, 1 row affected (0.00 sec)
21 
22 admin@127.0.0.1:6032 [(none)]>select * from mysql_replication_hostgroups;
23 +------------------+------------------+---------+
24 | writer_hostgroup | reader_hostgroup | comment |
25 +------------------+------------------+---------+
26 | 10               | 20               |         |
27 +------------------+------------------+---------+
28 1 row in set (0.00 sec)
29 
30 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_replication_hostgroups;
31 Empty set (0.00 sec)
32 
33 admin@127.0.0.1:6032 [(none)]>select * from disk.mysql_replication_hostgroups;
34 Empty set (0.00 sec)
35 
36 admin@127.0.0.1:6032 [(none)]>load mysql servers to runtime;save mysql servers to disk;
37 Query OK, 0 rows affected (0.00 sec)
38 
39 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_replication_hostgroups;
40 +------------------+------------------+---------+
41 | writer_hostgroup | reader_hostgroup | comment |
42 +------------------+------------------+---------+
43 | 10               | 20               |         |
44 +------------------+------------------+---------+
45 1 row in set (0.00 sec)
46 
47 admin@127.0.0.1:6032 [(none)]>select * from disk.mysql_replication_hostgroups;
48 +------------------+------------------+---------+
49 | writer_hostgroup | reader_hostgroup | comment |
50 +------------------+------------------+---------+
51 | 10               | 20               |         |
52 +------------------+------------------+---------+
53 1 row in set (0.00 sec)

 

Configure the mysql servers.
  1 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
  2 Empty set (0.00 sec)
  3 
  4 admin@127.0.0.1:6032 [(none)]>insert into mysql_servers(hostgroup_id,hostname,max_connections,max_replication_lag) values(10,'192.168.56.100',100,300);
  5 Query OK, 1 row affected (0.00 sec)
  6 
  7 admin@127.0.0.1:6032 [(none)]>insert into mysql_servers(hostgroup_id,hostname,max_connections,max_replication_lag) values(20,'192.168.56.101',100,300);
  8 Query OK, 1 row affected (0.00 sec)
  9 
 10 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
 11 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 12 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
 13 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 14 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 15 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 16 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 17 2 rows in set (0.00 sec)
 18 
 19 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_servers;
 20 Empty set (0.00 sec)
 21 
 22 admin@127.0.0.1:6032 [(none)]>select * from disk.mysql_servers;
 23 Empty set (0.00 sec)
 24 
 25 admin@127.0.0.1:6032 [(none)]>load mysql servers to runtime;save mysql servers to disk;
 26 Query OK, 0 rows affected (0.00 sec)
 27 
 28 Query OK, 0 rows affected (0.05 sec)
 29 
 30 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_servers;
 31 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 32 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
 33 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 34 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 35 | 20           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 36 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 37 2 rows in set (0.00 sec)
 38 
 39 //Why does the hostgroup_id in table "runtime_mysql_servers" still "20"?
 40 
 41 admin@127.0.0.1:6032 [(none)]>select * from disk.mysql_servers;
 42 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 43 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
 44 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 45 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 46 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 47 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 48 2 rows in set (0.00 sec)
 49 
 50 //The hostgroup_id in table "disk.mysql_servers" has taken effect.
 51 
 52 //Check the variables of "read_only" and "super_read_only".
 53 zlm@192.168.56.100:3306 [(none)]>show variables like '%read_only%';
 54 +-----------------------+-------+
 55 | Variable_name         | Value |
 56 +-----------------------+-------+
 57 | innodb_read_only      | OFF   |
 58 | read_only             | OFF   |
 59 | super_read_only       | OFF   |
 60 | transaction_read_only | OFF   |
 61 | tx_read_only          | OFF   |
 62 +-----------------------+-------+
 63 5 rows in set (0.00 sec)
 64 
 65 admin@127.0.0.1:6032 [(none)]>load mysql servers to runtime;
 66 Query OK, 0 rows affected (0.00 sec)
 67 
 68 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_servers;
 69 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 70 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
 71 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 72 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 73 | 20           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 74 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 75 2 rows in set (0.00 sec)
 76 
 77 //It's still "20".
 78 
 79 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
 80 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 81 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
 82 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 83 | 20           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 84 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
 85 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
 86 2 rows in set (0.00 sec)
 87 
 88 //The "hostgroup_id" in mysql_serves also turned to be "20".Why does it happen?It's the reason why my query rule did not take effect yesterday.
 89 
 90 admin@127.0.0.1:6032 [(none)]>SELECT * FROM monitor.mysql_server_connect_log ORDER BY time_start_us DESC LIMIT 10;
 91 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
 92 | hostname       | port | time_start_us    | connect_success_time_us | connect_error                                                 |
 93 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
 94 | 192.168.56.100 | 3306 | 1533999241153417 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
 95 | 192.168.56.101 | 3306 | 1533999240299607 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
 96 | 192.168.56.101 | 3306 | 1533999181251828 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
 97 | 192.168.56.100 | 3306 | 1533999180299465 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
 98 | 192.168.56.101 | 3306 | 1533999120959376 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
 99 | 192.168.56.100 | 3306 | 1533999120299350 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
100 | 192.168.56.100 | 3306 | 1533999061361175 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
101 | 192.168.56.101 | 3306 | 1533999060299292 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
102 | 192.168.56.100 | 3306 | 1533999001472876 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
103 | 192.168.56.101 | 3306 | 1533999000299091 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
104 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
105 10 rows in set (0.00 sec)
106 
107 //It seems the privileges was configurated abnormally.
108 
109 zlm@192.168.56.100:3306 [(none)]>select user,host from mysql.user;
110 +---------------+--------------+
111 | user          | host         |
112 +---------------+--------------+
113 | repl          | 192.168.56.% |
114 | zlm           | 192.168.56.% |
115 | bkuser        | localhost    |
116 | monitor       | localhost    |
117 | mysql.session | localhost    |
118 | mysql.sys     | localhost    |
119 | root          | localhost    |
120 +---------------+--------------+
121 7 rows in set (0.00 sec)
122 
123 zlm@192.168.56.100:3306 [(none)]>drop user monitor@localhost;
124 Query OK, 0 rows affected (0.00 sec)
125 
126 zlm@192.168.56.100:3306 [(none)]>grant all privileges on *.* to monitor@'%' identified by 'monitor';
127 ERROR 1045 (28000): Access denied for user 'zlm'@'192.168.56.%' (using password: YES)
128 zlm@192.168.56.100:3306 [(none)]>exit
129 Bye
130 
131 [root@zlm1 17:59:50 /data/backup]
132 #mysql -uroot -pPassw0rd -hlocalhost -S /tmp/mysql3306.sock
133 mysql: [Warning] Using a password on the command line interface can be insecure.
134 Welcome to the MySQL monitor.  Commands end with ; or \g.
135 Your MySQL connection id is 2758
136 Server version: 5.7.21-log MySQL Community Server (GPL)
137 
138 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
139 
140 Oracle is a registered trademark of Oracle Corporation and/or its
141 affiliates. Other names may be trademarks of their respective
142 owners.
143 
144 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
145 
146 root@localhost:mysql3306.sock [(none)]>grant all privileges on *.* to monitor@'%' identified by 'monitor';
147 Query OK, 0 rows affected, 1 warning (0.00 sec)
148 
149 root@localhost:mysql3306.sock [(none)]>select user,host from mysql.user;
150 +---------------+--------------+
151 | user          | host         |
152 +---------------+--------------+
153 | monitor       | %            |
154 | repl          | 192.168.56.% |
155 | zlm           | 192.168.56.% |
156 | bkuser        | localhost    |
157 | mysql.session | localhost    |
158 | mysql.sys     | localhost    |
159 | root          | localhost    |
160 +---------------+--------------+
161 7 rows in set (0.00 sec)
162 
163 admin@127.0.0.1:6032 [(none)]>SELECT * FROM monitor.mysql_server_connect_log ORDER BY time_start_us DESC LIMIT 10;
164 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
165 | hostname       | port | time_start_us    | connect_success_time_us | connect_error                                                 |
166 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
167 | 192.168.56.101 | 3306 | 1533999721321021 | 1040                    | NULL                                                          |
168 | 192.168.56.100 | 3306 | 1533999720303754 | 441                     | NULL                                                          |
169 | 192.168.56.100 | 3306 | 1533999661174268 | 370                     | NULL                                                          |
170 | 192.168.56.101 | 3306 | 1533999660302486 | 1468                    | NULL                                                          |
171 | 192.168.56.100 | 3306 | 1533999601377823 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
172 | 192.168.56.101 | 3306 | 1533999600302394 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
173 | 192.168.56.101 | 3306 | 1533999541205310 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
174 | 192.168.56.100 | 3306 | 1533999540302168 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
175 | 192.168.56.101 | 3306 | 1533999480925661 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
176 | 192.168.56.100 | 3306 | 1533999480302043 | 0                       | Access denied for user 'monitor'@'zlm1' (using password: YES) |
177 +----------------+------+------------------+-------------------------+---------------------------------------------------------------+
178 10 rows in set (0.00 sec)
179 
180 //The monitor became normal.
181 
182 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
183 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
184 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
185 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
186 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
187 | 20           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
188 | 10           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
189 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
190 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
191 4 rows in set (0.00 sec)
192 
193 admin@127.0.0.1:6032 [(none)]>delete from mysql_servers;
194 Query OK, 4 rows affected (0.00 sec)
195 
196 admin@127.0.0.1:6032 [(none)]>insert into mysql_servers(hostgroup_id,hostname,max_connections,max_replication_lag) values(10,'192.168.56.100',100,300),(20,'192.168.56.101',100,300);
197 Query OK, 2 rows affected (0.00 sec)
198 
199 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
200 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
201 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
202 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
203 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
204 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
205 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
206 2 rows in set (0.00 sec)
207 
208 admin@127.0.0.1:6032 [(none)]>load mysql servers to runtime;save mysql servers to disk;
209 Query OK, 0 rows affected (0.00 sec)
210 
211 Query OK, 0 rows affected (0.02 sec)
212 
213 admin@127.0.0.1:6032 [(none)]>select * from mysql_servers;
214 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
215 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
216 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
217 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
218 | 10           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
219 | 20           | 192.168.56.101 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
220 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
221 3 rows in set (0.00 sec)
222 
223 //Why there're three records in table "mysql_servers"?
224 
225 admin@127.0.0.1:6032 [(none)]>select * from runtime_mysql_servers;
226 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
227 | hostgroup_id | hostname       | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
228 +--------------+----------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
229 | 10           | 192.168.56.100 | 3306 | ONLINE | 1      | 0           | 100             | 300                 | 0       | 0              |         |
230 | 20           |

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

-Advertisement-
Play Games
更多相關文章
  • 差異備份 (differential backup)定義 一種數據備份,基於完整資料庫或部分資料庫或一組數據文件或文件組(差異基準)的最新完整備份,並且僅包含自確定差異基準以來發生更改的數據。 使用SSMS資料庫管理工具進行資料庫差異備份 1、選擇資料庫-》右鍵點擊-》選擇任務-》選擇備份。 2、在 ...
  • 1.數據 --創建職員表create table tbEmp( eID number primary key, --職員編號 eName varchar2(20) not null, --職員姓名 eSex varchar2(2) not null --職員性別 check(esex in ('男' ...
  • 一.概述 與網路I/O相關的等待的主要是ASYNC_NETWORK_IO,是指當sql server返回數據結果集給客戶端的時候,會先將結果集填充到輸出緩存里(ouput cache),同時網路層會開始將輸出緩存里的數據打包,由客戶端接收。如果客戶端接收數據包慢,sql server沒有地方存放新數 ...
  • 一、問題 今天遇到了一個神奇的問題——表中有數據,但select count( )的結果為0。 這個問題最初的表現形式是“查詢報表沒有分頁”。 最開始還以為是java端的問題。後來才發現,查分頁的sql語句是返回0的。 隨後將該sql語句放到PLSQL里運行,發現也是返回0條。 資料庫版本是 Ora ...
  • 刪除已經創建的topic 刪除toipc主要使用:kafka-topics --delete --zookeeper zkip:zkport --topic topicname命令刪除;但是如果server.properties文件中delete.topic.enable設置的值是false(預設f ...
  • 大數據介紹 大數據本質也是數據,但是又有了新的特征,包括數據來源廣、數據格式多樣化(結構化數據、非結構化數據、Excel文件、文本文件等)、數據量大(最少也是TB級別的、甚至可能是PB級別)、數據增長速度快等。 針對以上主要的4個特征我們需要考慮以下問題: 數據來源廣,該如何採集彙總?,對應出現了S ...
  • 題目:新建一個資料庫ClassManager,包括四個表:學生表(Student)、課程表(Course)、成績表(Score)以及教師信息表(Teacher)。四個表的結構分別如表1-1的表(一)~表(四)所示,數據如表1-2的表(一)~表(四)所示。用SQL語句創建四個表並完成相關題目。 一.表 ...
  • 大數據將徹底顛覆傳統的生產方式生活方式,大數據的蓬勃發展,使許多人想從事大數據相關的工作。就0基礎入門的初學者們最關心的問題進行整理回答。 一、大數據的發展前景 1、人才稀缺:未來3至5年,中國需要200萬+大數據人才,目前大數據從業人數不足50萬,市場需求遠遠得不到滿足; 2、需求增長快速:大數據 ...
一周排行
    -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.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...