redis集群部署 (通過redis工具快速部署,手動部署)

目錄

一、快速部署集群

1、 進入集群目錄,創建集群

2、 查看正常啟動

二、部署集群?

?1、分配集群節點? ? ? ? ?

?2、驗證集群可用性

?3、停止redis進程

三、手動部署集群

1、配置redis.conf配置文件

2、啟動redis集群

3、手動創建redis集群

4、驗證

四、集群操作指令?

#-c 自動跳轉對應的槽位

#把倆個key放道同一個槽位,使用打印標簽的方式{里面的內容隨便,寫什么都可以}

#查看集群信息(可以查看對應的集群里面的keys有多少)

#檢查集群狀態

#查看redis集群槽位分布?


-----------------------------跳過安裝過程---------------------------------------

一、快速部署集群

? ? ? ?1、 進入集群目錄,創建集群

[root@localhost ~]# cd /usr/local/redis-6.2.12/utils/create-cluster
[root@localhost create-cluster]# ./create-cluster start
Starting 30001
Starting 30002
Starting 30003
Starting 30004
Starting 30005
Starting 30006

2、 查看正常啟動

[root@localhost create-cluster]# netstat -pltun
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:30001           0.0.0.0:*               LISTEN      1644/../../src//red
tcp        0      0 0.0.0.0:30002           0.0.0.0:*               LISTEN      1646/../../src//red
tcp        0      0 0.0.0.0:30003           0.0.0.0:*               LISTEN      1648/../../src//red
tcp        0      0 0.0.0.0:30004           0.0.0.0:*               LISTEN      1656/../../src//red
tcp        0      0 0.0.0.0:30005           0.0.0.0:*               LISTEN      1661/../../src//red
tcp        0      0 0.0.0.0:30006           0.0.0.0:*               LISTEN      1666/../../src//red
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1086/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1359/master
tcp        0      0 0.0.0.0:40001           0.0.0.0:*               LISTEN      1644/../../src//red
tcp        0      0 0.0.0.0:40002           0.0.0.0:*               LISTEN      1646/../../src//red
tcp        0      0 0.0.0.0:40003           0.0.0.0:*               LISTEN      1648/../../src//red
tcp        0      0 0.0.0.0:40004           0.0.0.0:*               LISTEN      1656/../../src//red
tcp        0      0 0.0.0.0:40005           0.0.0.0:*               LISTEN      1661/../../src//red
tcp        0      0 0.0.0.0:40006           0.0.0.0:*               LISTEN      1666/../../src//red
tcp6       0      0 :::30001                :::*                    LISTEN      1644/../../src//red
tcp6       0      0 :::30002                :::*                    LISTEN      1646/../../src//red
tcp6       0      0 :::30003                :::*                    LISTEN      1648/../../src//red
tcp6       0      0 :::30004                :::*                    LISTEN      1656/../../src//red
tcp6       0      0 :::30005                :::*                    LISTEN      1661/../../src//red
tcp6       0      0 :::30006                :::*                    LISTEN      1666/../../src//red
tcp6       0      0 :::22                   :::*                    LISTEN      1086/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1359/master
tcp6       0      0 :::40001                :::*                    LISTEN      1644/../../src//red
tcp6       0      0 :::40002                :::*                    LISTEN      1646/../../src//red
tcp6       0      0 :::40003                :::*                    LISTEN      1648/../../src//red
tcp6       0      0 :::40004                :::*                    LISTEN      1656/../../src//red
tcp6       0      0 :::40005                :::*                    LISTEN      1661/../../src//red
tcp6       0      0 :::40006                :::*                    LISTEN      1666/../../src//red
udp        0      0 0.0.0.0:68              0.0.0.0:*                           902/dhclient
[root@localhost create-cluster]# ps -ef|grep redis
root       1644      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30001 [cluster]
root       1646      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30002 [cluster]
root       1648      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30003 [cluster]
root       1656      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30004 [cluster]
root       1661      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30005 [cluster]
root       1666      1  0 00:00 ?        00:00:00 ../../src//redis-server *:30006 [cluster]
root       1675   1608  0 00:00 pts/0    00:00:00 grep --color=auto redis

二、部署集群?

? ? ? ?1、分配集群節點? ? ? ? ?

[root@localhost create-cluster]# ll
total 8
-rwxrwxr-x. 1 root root 2787 Apr 17  2023 create-cluster
-rw-rw-r--. 1 root root 1437 Apr 17  2023 README
[root@localhost create-cluster]# ./create-cluster create
>>> Performing hash slots allocation on 6 nodes...
Master[0] -> Slots 0 - 5460
Master[1] -> Slots 5461 - 10922
Master[2] -> Slots 10923 - 16383
Adding replica 127.0.0.1:30005 to 127.0.0.1:30001
Adding replica 127.0.0.1:30006 to 127.0.0.1:30002
Adding replica 127.0.0.1:30004 to 127.0.0.1:30003
>>> Trying to optimize slaves allocation for anti-affinity
[WARNING] Some slaves are in the same host as their master
M: f8ec4c4889fb9a8c83e3b732bdd4df4ae529970c 127.0.0.1:30001slots:[0-5460] (5461 slots) master
M: 7c602a2fa09e149f4afa678da9deb4ba7a623b7a 127.0.0.1:30002slots:[5461-10922] (5462 slots) master
M: a8c24cf5fdc40cb32ea8a8122fb6f553bfb1343f 127.0.0.1:30003slots:[10923-16383] (5461 slots) master
S: 361ee2234efa8527ba9d255b29dcebb60a5a2f35 127.0.0.1:30004replicates f8ec4c4889fb9a8c83e3b732bdd4df4ae529970c
S: 7f307cd20409072ea9aa7c297fab6fa8be008a72 127.0.0.1:30005replicates 7c602a2fa09e149f4afa678da9deb4ba7a623b7a
S: 9083610ae287234adfb957adfa0d7d3e9f9a5e42 127.0.0.1:30006replicates a8c24cf5fdc40cb32ea8a8122fb6f553bfb1343f
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join
.
>>> Performing Cluster Check (using node 127.0.0.1:30001)
M: f8ec4c4889fb9a8c83e3b732bdd4df4ae529970c 127.0.0.1:30001slots:[0-5460] (5461 slots) master1 additional replica(s)
S: 361ee2234efa8527ba9d255b29dcebb60a5a2f35 127.0.0.1:30004slots: (0 slots) slavereplicates f8ec4c4889fb9a8c83e3b732bdd4df4ae529970c
S: 7f307cd20409072ea9aa7c297fab6fa8be008a72 127.0.0.1:30005slots: (0 slots) slavereplicates 7c602a2fa09e149f4afa678da9deb4ba7a623b7a
M: 7c602a2fa09e149f4afa678da9deb4ba7a623b7a 127.0.0.1:30002slots:[5461-10922] (5462 slots) master1 additional replica(s)
S: 9083610ae287234adfb957adfa0d7d3e9f9a5e42 127.0.0.1:30006slots: (0 slots) slavereplicates a8c24cf5fdc40cb32ea8a8122fb6f553bfb1343f
M: a8c24cf5fdc40cb32ea8a8122fb6f553bfb1343f 127.0.0.1:30003slots:[10923-16383] (5461 slots) master1 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
[root@localhost create-cluster]#

?2、驗證集群可用性

[root@localhost create-cluster]# redis-cli -p 30001
127.0.0.1:30001> set name vV
(error) MOVED 5798 127.0.0.1:30002   #這里提示應該在5798 槽位放入鍵值對,但是你30001的不包含
127.0.0.1:30001> exit
[root@localhost create-cluster]# redis-cli -p 30001 -c   #加參數 -c 可以自行跳轉對應的redis
127.0.0.1:30001> set name vV
-> Redirected to slot [5798] located at 127.0.0.1:30002
OK
127.0.0.1:30002> get name
"vV"
127.0.0.1:30002>

[root@localhost create-cluster]# ps -aux|grep reids
root       1727  0.0  0.0 112812   968 pts/0    S+   00:13   0:00 grep --color=auto reids
[root@localhost create-cluster]# ps -aux|grep redis
root       1644  0.1  0.0 146232  3252 ?        Ssl  00:00   0:01 ../../src//redis-server *:30001 [cluster]
root       1646  0.1  0.0 146140  3156 ?        Ssl  00:00   0:01 ../../src//redis-server *:30002 [cluster]
root       1648  0.1  0.0 146240  3252 ?        Ssl  00:00   0:01 ../../src//redis-server *:30003 [cluster]
root       1656  0.1  0.0 146136  3112 ?        Ssl  00:00   0:01 ../../src//redis-server *:30004 [cluster]
root       1661  0.1  0.0 146136  3124 ?        Ssl  00:00   0:01 ../../src//redis-server *:30005 [cluster]
root       1666  0.1  0.0 146136  3104 ?        Ssl  00:00   0:01 ../../src//redis-server *:30006 [cluster]
root       1729  0.0  0.0 112812   972 pts/0    S+   00:13   0:00 grep --color=auto redis
[root@localhost create-cluster]# pkill -9 redis
[root@localhost create-cluster]#
[root@localhost create-cluster]# ps -aux|grep redis
root       1732  0.0  0.0 112812   968 pts/0    S+   00:13   0:00 grep --color=auto redis

3、停止redis進程

[root@localhost create-cluster]# ps -aux|grep reids
root       1727  0.0  0.0 112812   968 pts/0    S+   00:13   0:00 grep --color=auto reids
[root@localhost create-cluster]# ps -aux|grep redis
root       1644  0.1  0.0 146232  3252 ?        Ssl  00:00   0:01 ../../src//redis-server *:30001 [cluster]
root       1646  0.1  0.0 146140  3156 ?        Ssl  00:00   0:01 ../../src//redis-server *:30002 [cluster]
root       1648  0.1  0.0 146240  3252 ?        Ssl  00:00   0:01 ../../src//redis-server *:30003 [cluster]
root       1656  0.1  0.0 146136  3112 ?        Ssl  00:00   0:01 ../../src//redis-server *:30004 [cluster]
root       1661  0.1  0.0 146136  3124 ?        Ssl  00:00   0:01 ../../src//redis-server *:30005 [cluster]
root       1666  0.1  0.0 146136  3104 ?        Ssl  00:00   0:01 ../../src//redis-server *:30006 [cluster]
root       1729  0.0  0.0 112812   972 pts/0    S+   00:13   0:00 grep --color=auto redis
[root@localhost create-cluster]# pkill -9 redis
[root@localhost create-cluster]#
[root@localhost create-cluster]# ps -aux|grep redis
root       1732  0.0  0.0 112812   968 pts/0    S+   00:13   0:00 grep --color=auto redis

三、手動部署集群

1、配置redis.conf配置文件

[root@localhost redis]# cd /usr/local/redis/
[root@localhost redis]# mkdir cluster#創建6個redis.config文件
[root@localhost cluster]# vim redis-cluster-6379.conf
[root@localhost cluster]# vim redis-cluster-6380.conf
[root@localhost cluster]# vim redis-cluster-6381.conf
[root@localhost cluster]# vim redis-cluster-6382.conf
[root@localhost cluster]# vim redis-cluster-6383.conf
[root@localhost cluster]# vim redis-cluster-6382.conf
[root@localhost cluster]# vim redis-cluster-6384.conf
#里面內容如下,記得根據不同的配置文件修改文件里面的內容root@localhost cluster]# cat redis-cluster-6379.conf
# 數據存儲目錄
# 指定 Redis 數據文件和配置文件的存儲位置
dir "/usr/local/redis/cluster/db/6379"# 啟用集群模式
# 啟用 Redis 集群功能,使該實例作為集群的一部分工作
cluster-enabled yes# 集群配置文件
# 指定 Redis 集群的配置文件名,Redis 在運行時將存儲集群狀態
cluster-config-file 6379.conf# 端口號
# 指定 Redis 實例監聽的端口號
port 6379# 守護進程模式
# 使 Redis 以守護進程方式運行,即在后臺運行
daemonize yes# 綁定 IP 地址
# 指定 Redis 監聽的 IP 地址,0.0.0.0 表示監聽所有網絡接口
bind 0.0.0.0# 密碼保護
# 設置訪問 Redis 實例所需的密碼
#requirepass your_password_here# 日志文件
# 指定 Redis 日志文件的存儲位置
logfile "/usr/local/redis/cluster/logs/6379.log"# 日志級別
# 指定日志記錄的級別,可以是 debug、verbose、notice、warning
loglevel info#創建目錄
[root@localhost cluster]# mkdir db
[root@localhost cluster]# cd db/
[root@localhost db]# mkdir {6379,6380,6381,6382,6383,6384}
[root@localhost db]# ll
total 0
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6379
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6380
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6381
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6382
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6383
drwxr-xr-x. 2 root root 6 Jul  9 00:26 6384

2、啟動redis集群

[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6379.conf
[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6380.conf

[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6381.conf

[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6382.conf
[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6383.conf
[root@localhost cluster]# ../../redis/bin/redis-server redis-cluster-6384.conf

[root@localhost cluster]# ps -ef|grep redis

root ? ? ? 1847 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:6379 [cluster]
root ? ? ? 1852 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:6380 [cluster]
root ? ? ? 1825 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:6381 [cluster]
root ? ? ? 1832 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:8382 [cluster]
root ? ? ? 1837 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:6383 [cluster]
root ? ? ? 1842 ? ? ?1 ?0 00:32 ? ? ? ? ?00:00:00 ../../redis/bin/redis-server *:6384 [cluster]
?

?3、手動創建redis集群

[root@localhost cluster]# redis-cli --cluster create 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384
>>> Performing hash slots allocation on 6 nodes...
Master[0] -> Slots 0 - 2730
Master[1] -> Slots 2731 - 5460
Master[2] -> Slots 5461 - 8191
Master[3] -> Slots 8192 - 10922
Master[4] -> Slots 10923 - 13652
Master[5] -> Slots 13653 - 16383
M: 04f33b8ebfe689b5841ec5bf2e42a7583d4320ef 127.0.0.1:6379slots:[0-2730] (2731 slots) master
M: 7976cdeba2788063b916bccaac71d06a89ff63c4 127.0.0.1:6380slots:[2731-5460] (2730 slots) master
M: 268a39068026beef18fb5d88410c0d9f72779d4f 127.0.0.1:6381slots:[5461-8191] (2731 slots) master
M: 39d35937546e37d31d350d8b8357a1405a6336c7 127.0.0.1:6382slots:[8192-10922] (2731 slots) master
M: d4302a52d4d67f4834fd9933e0a6286b0d1803aa 127.0.0.1:6383slots:[10923-13652] (2730 slots) master
M: a28ebb8ef8fa184b9b6c2dc080fc7a458b12e228 127.0.0.1:6384slots:[13653-16383] (2731 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join
......
>>> Performing Cluster Check (using node 127.0.0.1:6379)
M: 04f33b8ebfe689b5841ec5bf2e42a7583d4320ef 127.0.0.1:6379slots:[0-2730] (2731 slots) master
M: 39d35937546e37d31d350d8b8357a1405a6336c7 127.0.0.1:6382slots:[8192-10922] (2731 slots) master
M: 7976cdeba2788063b916bccaac71d06a89ff63c4 127.0.0.1:6380slots:[2731-5460] (2730 slots) master
M: 268a39068026beef18fb5d88410c0d9f72779d4f 127.0.0.1:6381slots:[5461-8191] (2731 slots) master
M: d4302a52d4d67f4834fd9933e0a6286b0d1803aa 127.0.0.1:6383slots:[10923-13652] (2730 slots) master
M: a28ebb8ef8fa184b9b6c2dc080fc7a458b12e228 127.0.0.1:6384slots:[13653-16383] (2731 slots) master
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
[root@localhost cluster]#

4、驗證

[root@localhost cluster]# redis-cli  -p 6379 -c
127.0.0.1:6379> set name vV
-> Redirected to slot [5798] located at 127.0.0.1:6381
OK
127.0.0.1:6381> get name
"vV"
127.0.0.1:6381>
127.0.0.1:6381>

四、集群操作指令?

#-c 自動跳轉對應的槽位

?redis-cli ?-p 6379 -c

127.0.0.1:6379> set name vV
-> Redirected to slot [5798] located at 127.0.0.1:6381
OK
127.0.0.1:6381> get name
"vV"

#把倆個key放道同一個槽位,使用打印標簽的方式{里面的內容隨便,寫什么都可以}

127.0.0.1:6383> set a 123
-> Redirected to slot [15495] located at 127.0.0.1:6384
OK
127.0.0.1:6384> set b 456
-> Redirected to slot [3300] located at 127.0.0.1:6380
OK
127.0.0.1:6380> set {user}a 123
-> Redirected to slot [5474] located at 127.0.0.1:6381
OK
127.0.0.1:6381> set {user}b 123
OK
127.0.0.1:6381> set {user}c 123
OK
127.0.0.1:6381>

#查看集群信息(可以查看對應的集群里面的keys有多少)

[root@localhost cluster]# redis-cli --cluster info  127.0.0.1 6379
127.0.0.1:6379 (04f33b8e...) -> 0 keys | 2731 slots | 0 slaves.
127.0.0.1:6382 (39d35937...) -> 0 keys | 2731 slots | 0 slaves.
127.0.0.1:6380 (7976cdeb...) -> 1 keys | 2730 slots | 0 slaves.
127.0.0.1:6381 (268a3906...) -> 6 keys | 2731 slots | 0 slaves.
127.0.0.1:6383 (d4302a52...) -> 1 keys | 2730 slots | 0 slaves.
127.0.0.1:6384 (a28ebb8e...) -> 3 keys | 2731 slots | 0 slaves.
[OK] 11 keys in 6 masters.
0.00 keys per slot on average.
[root@localhost cluster]#

#檢查集群狀態

[root@localhost cluster]# redis-cli --cluster check 127.0.0.1 6379
127.0.0.1:6379 (04f33b8e...) -> 0 keys | 2731 slots | 0 slaves.
127.0.0.1:6382 (39d35937...) -> 0 keys | 2731 slots | 0 slaves.
127.0.0.1:6380 (7976cdeb...) -> 1 keys | 2730 slots | 0 slaves.
127.0.0.1:6381 (268a3906...) -> 6 keys | 2731 slots | 0 slaves.
127.0.0.1:6383 (d4302a52...) -> 1 keys | 2730 slots | 0 slaves.
127.0.0.1:6384 (a28ebb8e...) -> 3 keys | 2731 slots | 0 slaves.
[OK] 11 keys in 6 masters.
0.00 keys per slot on average.
>>> Performing Cluster Check (using node 127.0.0.1:6379)
M: 04f33b8ebfe689b5841ec5bf2e42a7583d4320ef 127.0.0.1:6379slots:[0-2730] (2731 slots) master
M: 39d35937546e37d31d350d8b8357a1405a6336c7 127.0.0.1:6382slots:[8192-10922] (2731 slots) master
M: 7976cdeba2788063b916bccaac71d06a89ff63c4 127.0.0.1:6380slots:[2731-5460] (2730 slots) master
M: 268a39068026beef18fb5d88410c0d9f72779d4f 127.0.0.1:6381slots:[5461-8191] (2731 slots) master
M: d4302a52d4d67f4834fd9933e0a6286b0d1803aa 127.0.0.1:6383slots:[10923-13652] (2730 slots) master
M: a28ebb8ef8fa184b9b6c2dc080fc7a458b12e228 127.0.0.1:6384slots:[13653-16383] (2731 slots) master
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
[root@localhost cluster]#

#查看redis集群槽位分布?


127.0.0.1:6379> cluster slots
1) 1) (integer) 02) (integer) 27303) 1) "127.0.0.1"2) (integer) 63793) "04f33b8ebfe689b5841ec5bf2e42a7583d4320ef"
2) 1) (integer) 27312) (integer) 54603) 1) "127.0.0.1"2) (integer) 63803) "7976cdeba2788063b916bccaac71d06a89ff63c4"
3) 1) (integer) 54612) (integer) 81913) 1) "127.0.0.1"2) (integer) 63813) "268a39068026beef18fb5d88410c0d9f72779d4f"
4) 1) (integer) 81922) (integer) 109223) 1) "127.0.0.1"2) (integer) 63823) "39d35937546e37d31d350d8b8357a1405a6336c7"
5) 1) (integer) 109232) (integer) 136523) 1) "127.0.0.1"2) (integer) 63833) "d4302a52d4d67f4834fd9933e0a6286b0d1803aa"
6) 1) (integer) 136532) (integer) 163833) 1) "127.0.0.1"2) (integer) 63843) "a28ebb8ef8fa184b9b6c2dc080fc7a458b12e228"
127.0.0.1:6379>

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/41958.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/41958.shtml
英文地址,請注明出處:http://en.pswp.cn/web/41958.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

mysql異常數據損壞處理,報錯:Operating system error number 2 in a file operation

一、問題描述 某次一線反應,某主庫表全部丟失,查看為空,登陸主機查看mysqld.log后報錯:Operating system error number 2 in a file operation數據目錄OS重裝后修改過,但只是指向方式不同,目錄還是同一目錄…

【綠色版】Mysql下載、安裝、配置與使用(保姆級教程)

大家都知道,Mysql安裝版的卸載過程非常繁瑣,而且卸載不干凈會出現許多問題,很容易讓大家陷入重裝系統的窘境。基于此,博主今天給大家分享綠色版Mysql的安裝、配置與使用。 目錄 一、Mysql安裝、配置與使用 1、下載解壓 2、創建…

vue對axios進行請求響應封裝

一、原因 像是在一些業務邏輯上,比如需要在請求之前展示loading效果,或者在登錄的時候判斷身份信息(token)等信息有沒有過期,再者根據服務器響應回來的code碼進行相應的提示信息。等等在請求之前,之后做的一…

ABAP注釋快捷鍵修改(留著備用)

ABAP注釋快捷鍵修改(留著備用) 在使用ABAP編輯器的時候,原有的添加代碼注釋和取消代碼注釋的快捷鍵未生效,這時我們可以考慮對注釋快捷鍵進行修改 在事務碼SE38(ABAP編輯器)屏幕右下角,點擊【Options選項】圖標 在【鍵盤】|【命令】輸入欄中…

DWM 相關實現代碼 [自用]

1. DWM 縮略圖和模糊隱藏實現半透明 #include <windows.h> #include <dwmapi.h> #include <string> #pragma comment(lib, "dwmapi.lib")// 檢查 UWP 窗口是否可見 bool IsUWPWindowVisible(HWND hwnd) {DWORD cloaked 0;DwmGetWindowAttribute(…

【c語言】玩轉文件操作

&#x1f31f;&#x1f31f;作者主頁&#xff1a;ephemerals__ &#x1f31f;&#x1f31f;所屬專欄&#xff1a;C語言 目錄 引言 一、文件的打開和關閉 1.流 2.標準流 3.文本文件和二進制文件 4.控制文件打開與關閉的函數 二、文件的順序讀寫 三、文件的隨機讀寫 1…

深入理解OAuth 2.0:原理、流程與實踐

一、什么是OAuth 2.0 1. 什么是OAuth 2.0 OAuth 2.0 是一套關于授權的行業標準協議。 OAuth 2.0 允許用戶授權第三方應用訪問他們在另一個服務提供方上的數據&#xff0c;而無需分享他們的憑據&#xff08;如用戶名、密碼&#xff09;。 2. OAuth 2.0 應用場景 OAuth 2.0的…

非參數檢測6——優缺點

優點&#xff1a; 參量檢測的特點在于以似然比處理器為基礎&#xff0c;并建立在假定干擾或噪聲的統計特性已知的基礎上。但實際上&#xff0c;干擾環境往往十分復雜&#xff0c;包括自然和人為因素&#xff0c;且常常隨時改變。這使我們很難確定噪聲的統計特性。因此人們提出…

服務器U盤安裝Centos 7時提示Warning:/dev/root does not exist

這是沒有找到正確的鏡像路徑導致的&#xff0c;我們可以在命令行輸入ls /dev看一下有哪些盤符 像圖中紅色圈起來的就是我插入U盤的盤符&#xff0c;大家的輸幾盤可能做了多個邏輯盤&#xff0c;這種情況下就可以先將U盤拔掉再ls /dev看一下和剛才相比少了那兩個盤符&#xff0c…

在Spring Boot中實現多線程任務調度

在Spring Boot中實現多線程任務調度 大家好&#xff0c;我是微賺淘客系統3.0的小編&#xff0c;也是冬天不穿秋褲&#xff0c;天冷也要風度的程序猿&#xff01; 1. Spring Boot中的任務調度 Spring Boot通過集成Spring框架的Task Execution和Scheduling支持&#xff0c;提供…

Double 4 VR仿真情景實訓教學系統在法律專業課堂上的應用

隨著科技的飛速發展&#xff0c;VR技術逐漸滲透到各個領域&#xff0c;為教育行業帶來了革命性的變化。 VR技術以其獨特的沉浸式體驗&#xff0c;為法律課堂帶來了前所未有的學習體驗。通過Double 4 VR仿真情景實訓教學系統&#xff0c;學生可以身臨其境地進入虛擬的仿真情景中…

vue前端面試

一 .v-if和v-show的區別 v-if 和 v-show 是 Vue.js 中兩個常用的條件渲染指令&#xff0c;它們都可以根據條件決定是否渲染某個元素。但是它們之間存在一些區別。 語法&#xff1a;v-if 和 v-show 的語法相同&#xff0c;都接收一個布爾值作為參數。 <div v-if"show…

權力之望怎么下載客戶端 權力之望一鍵下載

《權力之望》是一款由NX3 Games開發、Smilegate發行的多人在線動作MMORPG游戲。這款游戲最大的特點是高度的自由度和豐富的角色定制選項。我們在游戲中不僅可以自由更換武器&#xff0c;而且游戲還提供了54種能力和60多種職業選擇&#xff0c;讓我們可以根據自己的游戲風格和喜…

繼 承

為什么要有繼承&#xff0c;繼承的作用&#xff1f; 繼承(inheritance)機制&#xff1a;是面向對象程序設計使代碼可以復用的最重要的手段&#xff0c;它允許程序員在保持原有類特性的基礎上進行擴展&#xff0c;增加新功能&#xff0c;這樣產生新的類&#xff0c;稱派生類。 …

【人工智能】—基于成都市各區(市)縣租房價格預測建模研究

引言 隨著城市化進程的加速&#xff0c;人口流動日益頻繁&#xff0c;租房市場作為城市生活的重要組成部分&#xff0c;其價格波動對居民生活質量和城市經濟發展具有顯著影響。成都市&#xff0c;作為中國西部地區的經濟、文化、交通和科技中心&#xff0c;近年來吸引了大量人…

為什么獨立站需要高質量的GPB外鏈?

獨立站需要高質量的GPB外鏈&#xff0c;主要是因為它們能顯著提升網站的可信度和可見性。高質量的外鏈相當于得到其他權威網站的認可和推薦&#xff0c;這會讓搜索引擎認為你的內容有價值&#xff0c;從而提升你的搜索排名。試想一下&#xff0c;當其他有影響力的網站愿意鏈接到…

非阻塞式 I/O 模型 【NIO】補充內容

NIO是一種同步非阻塞IO, 基于Reactor模型來實現的。其實相當于就是一個線程處理大量的客戶端的請求&#xff0c;通過一個線程輪詢大量的channel&#xff0c;每次就獲取一批有事件的channel&#xff0c;然后對每個請求啟動一個線程處理即可。這里的核心就是非阻塞&#xff0c;就…

請求接口在控制臺報cors跨域問題

我的問題是&#xff1a;BASE_URL沒有和本地IP設置一致 剛開始&#xff1a;&#xff08;這個不是我本地電腦的地址&#xff09; 所以我要把&#xff1a;這個地址改為我本地電腦的ip&#xff08;http://192.168.2.50:8087&#xff09; BASE_URL: http://localhost:8087/api/ 或…

單位電腦文檔怎么加密?哪種方法最有效?

單位電腦文檔的加密是保障信息安全的重要措施之一&#xff0c;它可以防止未經授權的訪問和數據泄露。 選擇最佳的加密方法取決于您的具體需求&#xff0c;包括文檔的敏感程度、加密的便捷性、成本、以及是否需要跨平臺兼容性。下面是幾種常見的加密方法及其優缺點&#xff0c;…

【SpringBoot3】結合 gRpc 實現遠程服務調用

一、gRPC概念介紹 gRPC&#xff08;Google Remote Procedure Call&#xff0c;Google遠程過程調用&#xff09;是一個現代開源高性能遠程過程調用(RPC)框架&#xff0c;可以在任何環境中運行。它由Google開發&#xff0c;旨在幫助開發人員更輕松地構建分布式應用&#xff0c;特…