찾다
데이터 베이스RedisRedis 단계 분석 센티널 센티널 클러스터

추천 학습: Redis 동영상 튜토리얼

1. Redis sentinel 클러스터 개요

(1) Redis sentinel 개요

*Sentinel: 분산 시스템으로 Redis를 모니터링하는 데 사용되는 프로세스입니다. 클러스터 내 마스터 서버의 작동 상태. 마스터 서버가 실패하면 마스터 서버와 슬레이브 서버를 몇 초 안에 전환하여 시스템에 마스터 서버가 있는지 확인하고 Reids2.6에서 고가용성을 제공할 수 있습니다. 버전은 당시 추가되어 버전 2.8 이후 안정되었습니다.

Redis Sentinel과 Redis 마스터-슬레이브의 차이점:

Redis Sentinel: 마스터 서버가 실패한 후 마스터를 대체할 슬레이브 서버가 있습니다. server

Redis 마스터-슬레이브: 마스터 서버가 실패한 후 슬레이브 서버는 아무 작업도 하지 않습니다.

Redis 단계 분석 센티널 센티널 클러스터

(2) Redis Sentinel의 작동 메커니즘

哨兵只需要部署在master主服务器上即可

Worker 프로세스:

모니터링: Sentinel은 가십 프로토콜을 통해 클러스터 내 각 서버가 정상적으로 작동하는지 지속적으로 확인합니다.

Notification: Sentinel이 모니터링하는 Redis 서버에 문제가 있는 경우 Sentinel은 API(애플리케이션 인터페이스)를 사용하여 관리자 또는 다른 애플리케이션에 알림 보내기

자동 장애 조치: 클러스터의 마스터 서버에 장애가 발생하면 Sentinel은 계약 프로토콜을 통해 자동 장애 조치를 시작합니다. 결함 마이그레이션 작업에서 상대적으로 완료된 슬레이브 서버를 선택합니다. 클라이언트가 장애가 발생한 마스터 서버에 연결을 시도하면 클러스터는 새로운 마스터 서버의 주소도 클라이언트에 반환하므로 클러스터는 장애가 발생한 마스터를 대체하기 위해 현재 마스터를 사용할 수 있습니다. .

마스터와 슬레이브가 전환되면 마스터의 Redis 기본 구성 파일, 슬레이브의 Redis 기본 구성 파일 및 Sentinel의 구성 파일 내용이 모두 그에 따라 변경됩니다. 즉, 원래 마스터의 Redis 기본 구성 파일은 슬레이브 서버를 한 줄 더 구성하면 Sentinel 모니터링 대상이 현재 Master 메인 서버로 변경됩니다

(3) Sentinel의 세 가지 예약 모니터링 작업

10초마다 각 Sentinel 노드는 마스터 서버에 메시지 보내기 노드와 슬레이브 노드는 Redis 데이터 노드의 정보를 얻기 위해 info 명령을 보냅니다

기능:

info 명령을 실행하여 슬레이브 노드의 정보를 얻습니다. 이것이 Sentinel 노드가 모니터링 슬레이브 노드를 명시적으로 구성할 필요가 없는 이유입니다. 새로운 슬레이브 노드가 합류하면 즉시 감지할 수 있으며, 해당 노드에 연결할 수 없거나 장애 조치(failover)가 발생한 경우 info 명령을 통해 노드 토폴로지 정보를 실시간으로 업데이트할 수 있습니다.

1초마다 각 Sentinel 노드는 마스터 노드와 슬레이브 노드에 ping 명령을 보내 하트비트 확인을 통해 해당 노드가 현재 연결 가능한지 확인합니다.마스터 노드가 끊기면 sentinel 중 하나입니다. 상대적으로 완전한 데이터를 가지고 있는 나머지 슬레이브 노드를 마스터 노드로 선택합니다

2. Redis Sentinel 시스템 배포

(1) 실험 환경

Redis-5.0.4Redis: 6379슬레이브

(2)实验步骤 -在每台服务器上都安装Redis

安装步骤相同,主机名、ip不同,下面只写Master配置

[root@Centos7 ~]# hostnamectl set-hostname master
[root@Centos7 ~]# su
[root@master ~]# systemctl stop firewalld
[root@master ~]# setenforce 0
setenforce: SELinux is disabled
[root@master ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
mount: /dev/sr0 已经挂载或 /mnt 忙
       /dev/sr0 已经挂载到 /mnt 上
[root@master ~]# ll
总用量 1928
-rw-------. 1 root root    1264 1月  12 18:27 anaconda-ks.cfg
-rw-r--r--  1 root root 1966337 6月   9 01:16 redis-5.0.4.tar.gz
[root@master ~]# tar xf redis-5.0.4.tar.gz
[root@master ~]# cd redis-5.0.4
[root@master redis-5.0.4]# make
[root@master redis-5.0.4]# mkdir -p /usr/local/redis
[root@master redis-5.0.4]# cp /root/redis-5.0.4/src/redis-server /usr/local/redis/
[root@master redis-5.0.4]# cp /root/redis-5.0.4/src/redis-cli /usr/local/redis/
[root@master redis-5.0.4]# cp /root/redis-5.0.4/redis.conf  /usr/local/redis/ 
[root@master redis-5.0.4]# vim /usr/local/redis/redis.conf   #修改
。。。。。。
  68 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69 bind 192.168.100.202  #修改为本机地址,如果为127.0.0.1就只能本机访问
  70 
。。。。。。
  87 # are explicitly listed using the "bind" directive.
  88 protected-mode no  #关闭redis的保护模式,如果为yes的话其他客户端就无法连接到此服务器
  89 
。。。。。。
 135 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
 136 daemonize yes  #开启redis的后台守护程序,即在redis开启之后是放在后台运行的
 137 
。。。。。。
 262 # Note that you must specify a directory here, not a file name.
 263 dir /usr/local/redis/rdb
 264 
。。。。。。
 506 #
 507 requirepass 123123  #去掉注释,修改redis的密码为123123
 508 
#保存退出
[root@slave2 redis-5.0.4]# mkdir /usr/local/redis/rdb
[root@master redis-5.0.4]# vim /etc/init.d/redis
#!/bin/sh
# chkconfig: 2345 80 90
# description: Start and Stop redis
#PATH=/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT=6379
EXEC=/usr/local/redis/redis-server
REDIS_CLI=/usr/local/redis/redis-cli
PIDFILE=/var/run/redis_6379.pid
CONF="/usr/local/redis/redis.conf"
AUTH="123123"
LISTEN_IP=$(netstat -utpln |grep redis-server |awk '{print $4}'|awk -F':' '{print $1}')

case "$1" in
    start)
        if [ -f $PIDFILE ]
        then
                echo "$PIDFILE exists, process is already running or crashed"
        else
                echo "Starting Redis server..."
                $EXEC $CONF
        fi
        if [ "$?"="0" ]
        then
              echo "Redis is running..."
        fi
        ;;
    stop)
        if [ ! -f $PIDFILE ]
        then
                echo "$PIDFILE does not exist, process is not running"
        else
                PID=$(cat $PIDFILE)
                echo "Stopping ..."
                $REDIS_CLI -h $LISTEN_IP -p $REDISPORT -a $AUTH SHUTDOWN
                while [ -x ${PIDFILE} ]
               do
                    echo "Waiting for Redis to shutdown ..."
                    sleep 1
                done
                echo "Redis stopped"
        fi
        ;;
   restart|force-reload)
        ${0} stop
        ${0} start
        ;;
  *)
    echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2
        exit 1
esac
[root@master redis-5.0.4]# chkconfig --add redis
[root@master redis-5.0.4]# chmod 755 /etc/init.d/redis
[root@master redis-5.0.4]# ln -s /usr/local/redis/* /usr/local/bin/
[root@master redis-5.0.4]# /etc/init.d/redis start 
Starting Redis server...
5233:C 09 Jun 2021 01:25:53.069 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5233:C 09 Jun 2021 01:25:53.069 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=5233, just started
5233:C 09 Jun 2021 01:25:53.069 # Configuration loaded
Redis is running...
[root@master redis-5.0.4]# netstat -anpt | grep 6379
tcp        0      0 192.168.100.202:6379    0.0.0.0:*               LISTEN      5234/redis-server 1

-做redis主从

******(1)Master配置
[root@master redis-5.0.4]# vim /usr/local/redis/redis.conf #修改
。。。。。。
 292 #
 293  masterauth 123123  #配置主服务器密码,哨兵有一个问题,就是当主服务器坏掉,切换到从服务器时,原来的主服务器可以正常运行之后,再次加入集群是加不进去的,因为哨兵没有配置主服务器的密码,所以无法连接,所以在使用哨兵集群时,要把每台的主服务器密码都配置上,每台redis的密码最好都一样
 294 
。。。。。。
 456 #
 457  min-replicas-to-write 1 #设置slave服务器的数量,当slave服务器少于这个数量时,Master主服务器会停止接收客户端的一切写请求
 458  min-replicas-max-lag 10 #设置主服务器和从服务器之间同步数据的超时时间,当超过此时间时,master主服务器会停止客户端的一切写操作,单位为秒
 459 #
。。。。。。
[root@master redis-5.0.4]# /etc/init.d/redis restart   #重启redis
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Redis stopped
Starting Redis server...
5291:C 09 Jun 2021 02:04:39.132 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5291:C 09 Jun 2021 02:04:39.132 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=5291, just started
5291:C 09 Jun 2021 02:04:39.132 # Configuration loaded
Redis is running...

******(2)Slave1配置
[root@slave1 redis-5.0.4]# vim /usr/local/redis/redis.conf 
。。。。。。
 285 #
 286 replicaof 192.168.100.202 6379  #在从服务器上指定主服务器的ip和端口
 287 
。。。。。。
 292 #
 293 masterauth 123123  #指定主服务器上redis的密码
 294
。。。。。。
#保存退出
[root@slave redis-5.0.4]# /etc/init.d/redis restart  #重启服务
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Redis stopped
Starting Redis server...
5304:C 09 Jun 2021 02:11:32.241 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5304:C 09 Jun 2021 02:11:32.241 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=5304, just started
5304:C 09 Jun 2021 02:11:32.241 # Configuration loaded
Redis is running...

******(3)Slave2配置
[root@slave2 redis-5.0.4]# vim /usr/local/redis/redis.conf 
。。。。。。
 286  replicaof 192.168.100.204 6379
 287 
 288 # If the master is password protected (using the "requirepass" configuration
 289 # directive below) it is possible to tell the replica to authenticate before
 290 # starting the replication synchronization process, otherwise the master will
 291 # refuse the replica request.
 292 #
 293  masterauth 123123
 294 
。。。。。。
#保存退出
[root@slave2 redis-5.0.4]# /etc/init.d/redis restart 
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Redis stopped
Starting Redis server...
5253:C 09 Jun 2021 17:50:25.680 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5253:C 09 Jun 2021 17:50:25.680 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=5253, just started
5253:C 09 Jun 2021 17:50:25.680 # Configuration loaded
Redis is running...

******(3)验证主从是否成功
[root@master ~]# redis-cli -h 192.168.100.202 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.202:6379> set aaa bbb
OK
192.168.100.202:6379> set bbb ccc 
OK
192.168.100.202:6379> keys *
1) "aaa"
2) "bbb"

[root@slave1 ~]# redis-cli -h 192.168.100.203 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.203:6379> keys *
1) "bbb"
2) "aaa"
192.168.100.203:6379> set ttt fff
(error) READONLY You can't write against a read only replica.  #从服务器无法写入数据

[root@slave2 redis-5.0.4]# redis-cli -h 192.168.100.204 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.204:6379> keys *
1) "aaa"
2) "bbb"
192.168.100.204:6379> set ggg aaa
(error) READONLY You can't write against a read only replica.

#主从配置完成

-配置哨兵

******(1)在master上配置sentinel哨兵
[root@master ~]# cp redis-5.0.4/src/redis-sentinel /usr/local/redis/  #复制哨兵启动脚本
[root@master ~]# cp redis-5.0.4/sentinel.conf /usr/local/redis/  #复制哨兵配置文件
[root@master ~]# mkdir -p /var/redis/data  #创建日志文件存放位置	
[root@master ~]# vim /usr/local/redis/sentinel.conf   #修改哨兵配置文件
。。。。。。
 21 port 26379  #指定端口默认为26379
 22 
 23 # By default Redis Sentinel does not run as a daemon. Use 'yes' if you need it.
 24 # Note that Redis will write a pid file in /var/run/redis-sentinel.pid when
 25 # daemonized.
 26 daemonize yes  #yes为放在后台运行,使用no放在前台运行可以看到主从切换时候的信息
 27 
。。。。。。
 64 # unmounting filesystems.
 65 dir /var/redis/data  #指定日志存放位置,就是刚才创建的路径
 66 
。。。。。。
 83 # The valid charset is A-z 0-9 and the three characters ".-_".
 84 sentinel monitor mymaster 192.168.100.202  6379 1  #指定用户为mymaster,ip为202,端口为6379,1表示当有一台master出现故障时,就进行切换
 85 
 86 # sentinel a
。。。。。。
112 # Default is 30 seconds.
113 sentinel down-after-milliseconds mymaster 3000  #指定master的失效时间,单位为毫秒3000为3秒,表示master超过3秒没响应就判定为故障
114 
。。。。。。
145 # Default is 3 minutes.
146 sentinel failover-timeout mymaster 180000  #切换操作完成的超时时间,单位为毫秒180000为180秒,在主从切换超过这个时间就判定为切换失败
147 
148 # SCRIPTS EXE
。。。。。。
102 #
103  sentinel auth-pass mymaster 123123  #连接master和slave的密码
104 sentinel config-epoch mymaster  1  #切换后最多有多少节点可以于新的master进行同步数据
105 
#保存退出
[root@master ~]# /usr/local/redis/redis-sentinel /usr/local/redis/sentinel.conf  #启动哨兵
1118:X 09 Jun 2021 18:09:29.027 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1118:X 09 Jun 2021 18:09:29.027 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=1118, just started
1118:X 09 Jun 2021 18:09:29.027 # Configuration loaded
[root@master ~]# netstat -anpt | grep 26379
tcp        0      0 0.0.0.0:26379           0.0.0.0:*               LISTEN      1119/redis-sentinel 
tcp6       0      0 :::26379                :::*                    LISTEN      1119/redis-sentinel 
[root@master ~]# kill -9 1119  #先关闭哨兵
[root@master ~]# netstat -anpt | grep 26379
[root@master ~]# sed -i '26s/yes/no/g' /usr/local/redis/sentinel.conf  #修改为前台启动
[root@master ~]# /usr/local/redis/redis-sentinel /usr/local/redis/sentinel.conf  #再次开启哨兵,稍等一段时间会有提示
1129:X 09 Jun 2021 18:11:02.585 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1129:X 09 Jun 2021 18:11:02.585 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=1129, just started
1129:X 09 Jun 2021 18:11:02.585 # Configuration loaded
1129:X 09 Jun 2021 18:11:02.586 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 5.0.4 (00000000/0) 64 bit
  .-`` .-".  "\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26379
 |    `-._   `._    /     _.-'    |     PID: 1129
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

1129:X 09 Jun 2021 18:11:02.586 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1129:X 09 Jun 2021 18:11:02.586 # Sentinel ID is fce7776020cf12792fd239f6f9d34f2d3fdef98c
1129:X 09 Jun 2021 18:11:02.586 # +monitor master mymaster 192.168.100.202 6379 quorum 1
1129:X 09 Jun 2021 18:18:04.434 * +reboot slave 192.168.100.204:6379 192.168.100.204 6379 @ mymaster 192.168.100.202 6379  #看到新增两条消息,从服务器增加了203和204主服务器时202
1129:X 09 Jun 2021 18:18:14.478 * +reboot slave 192.168.100.203:6379 192.168.100.203 6379 @ mymaster 192.168.100.202 6379

#哨兵配置完成

-测试哨兵的故障切换

******(1)把master服务器在开启一个终端,在新开启的终端中关闭redis,测试是否可以主从切换
[root@master ~]# /etc/init.d/redis stop 
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Redis stopped

******(2)切换到开启哨兵的终端,查看新弹出的信息
1129:X 09 Jun 2021 18:20:36.588 # +failover-end master mymaster 192.168.100.202 6379
1129:X 09 Jun 2021 18:20:36.588 # +switch-master mymaster 192.168.100.202 6379 192.168.100.203 6379
1129:X 09 Jun 2021 18:20:36.588 * +slave slave 192.168.100.204:6379 192.168.100.204 6379 @ mymaster 192.168.100.203 6379  #发现主服务器变成了203
1129:X 09 Jun 2021 18:20:36.588 * +slave slave 192.168.100.202:6379 192.168.100.202 6379 @ mymaster 192.168.100.203 6379
1129:X 09 Jun 2021 18:20:39.607 # +sdown slave 192.168.100.202:6379 192.168.100.202 6379 @ mymaster 192.168.100.203 6379‘

******(3)在203上测试主从复制是否可以正常同步
[root@slave1 ~]# redis-cli -h 192.168.100.203 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.203:6379> keys *
1) "aaa"
2) "bbb"
192.168.100.203:6379> set yyy aaa
OK
192.168.100.203:6379> keys *
1) "yyy"
2) "aaa"
3) "bbb"

[root@slave2 redis-5.0.4]# redis-cli -h 192.168.100.204 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.204:6379> keys *  #发现同步成功
1) "yyy"
2) "bbb"
3) "aaa"

******(4)此时重新开启202的redis,并且查看哨兵的提示消息
[root@master ~]# /etc/init.d/redis start 
Starting Redis server...
1167:C 09 Jun 2021 18:23:39.756 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1167:C 09 Jun 2021 18:23:39.756 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=1167, just started
1167:C 09 Jun 2021 18:23:39.756 # Configuration loaded
Redis is running...

1129:X 09 Jun 2021 18:23:50.324 * +convert-to-slave slave 192.168.100.202:6379 192.168.100.202 6379 @ mymaster 192.168.100.203 6379   #提示增加了一台slave

******(5)在202的新终端上查看redis的数据是否成功同步
[root@master ~]# redis-cli -h 192.168.100.202 -a 123123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.100.202:6379> keys *  #发现已经成功同步
1) "bbb"
2) "aaa"
3) "yyy"

#测试故障切换缓存,发现在master主机出现故障然后重新连接到集群后,master角色不会进行转移

-哨兵日志分析

#把哨兵放在前台运行时,日志信息会直接输出到终端上,放到后台运行时,日志会写到指定的路径中
+reset-master <instance details>   #当master被重置时.
+slave <instance details>  #当检测到一个slave并添加进slave列表时.
+failover-state-reconf-slaves <instance details> #Failover状态变为reconf-slaves状态时
+failover-detected <instance details> #当failover发生时
+slave-reconf-sent <instance details> #sentinel发送SLAVEOF命令把它重新配置时
+slave-reconf-inprog <instance details> #slave被重新配置为另外一个master的slave,但数据复制还未发生时。
+slave-reconf-done <instance details> #slave被重新配置为另外一个master的slave并且数据复制已经与master同步时。
-dup-sentinel <instance details> #删除指定master上的冗余sentinel时,当一个sentinel重新启动时,可能会发生这个事件
+sentinel <instance details> #当master增加了一个sentinel时。
+sdown <instance details> #进入SDOWN状态时;
-sdown <instance details> #离开SDOWN状态时。
+odown <instance details> #进入ODOWN状态时。
-odown <instance details> #离开ODOWN状态时。
+new-epoch <instance details>  #当前配置版本被更新时。
+try-failover <instance details> #达到failover条件,正等待其他sentinel的选举。
+elected-leader <instance details> #被选举为去执行failover的时候。
+failover-state-select-slave <instance details> #开始要选择一个slave当选新master时。
no-good-slave <instance details> #没有合适的slave来担当新master
selected-slave <instance details> #找到了一个适合的slave来担当新master
failover-state-send-slaveof-noone <instance details> #当把选择为新master的slave的身份进行切换的时候。
failover-end-for-timeout <instance details>   #failover由于超时而失败时。
failover-end <instance details> #failover成功完成时。
switch-master <master name> <oldip> <oldport> <newip> <newport> #当master的地址发生变化时。通常这是客户端最感兴趣的消息了。
+tilt #进入Tilt模式。
-tilt #退出Tilt模式。

推荐学习:Redis视频教程

시스템 ip 호스트 이름 Redis 버전 포트 Role
Centos7.4 192.168.100.202 master Redis-5.0.4 Redis:6379 Sentinel:26379 마스터
Centos7.4 192.168 .100.203 slave1 Redis-5.0.4 Redis:6379 Slave
Centos7.4 192.168.100.204 slave2

위 내용은 Redis 단계 분석 센티널 센티널 클러스터의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
이 기사는 脚本之家에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제
Redis : 기능과 기능을 탐색합니다Redis : 기능과 기능을 탐색합니다Apr 19, 2025 am 12:04 AM

Redis는 고속, 다양성 및 풍부한 데이터 구조로 인해 두드러집니다. 1) Redis는 문자열, 목록, 컬렉션, 해시 및 주문 컬렉션과 같은 데이터 구조를 지원합니다. 2) 메모리를 통해 데이터를 저장하고 RDB 및 AOF 지속성을 지원합니다. 3) Redis 6.0에서 시작하여 멀티 스레드 I/O 작업이 도입되어 동시 동시성 시나리오에서 성능이 향상되었습니다.

Redis는 SQL 또는 NOSQL 데이터베이스입니까? 대답이 설명되었습니다Redis는 SQL 또는 NOSQL 데이터베이스입니까? 대답이 설명되었습니다Apr 18, 2025 am 12:11 AM

redisisclassifiedasanoSqldatabaseBecauseItuseSakey-valuedatamodelinsteadofThraditionalRelationalDatabasemodel.Itoffersspeedandflexibility, makingIdealforreal-timeApplicationsandcaching, butitmaynotbesuitableforscenariosrequiringstrictaintetaintetaintetaintetaintetaintetaintegry

REDIS : 응용 프로그램 성능 및 확장 성 향상REDIS : 응용 프로그램 성능 및 확장 성 향상Apr 17, 2025 am 12:16 AM

Redis는 데이터를 캐싱하여 분산 잠금 및 데이터 지속성을 구현하여 응용 프로그램 성능 및 확장 성을 향상시킵니다. 1) 캐시 데이터 : Redis를 사용하여 데이터 액세스 속도를 향상시키기 위해 자주 액세스하는 데이터를 캐시합니다. 2) 분산 잠금 : Redis를 사용하여 분산 된 잠금 장치를 구현하여 분산 환경에서 작동의 보안을 보장합니다. 3) 데이터 지속성 : 데이터 손실을 방지하기위한 RDB 및 AOF 메커니즘을 통한 데이터 보안을 보장합니다.

Redis : 데이터 모델과 구조 탐색Redis : 데이터 모델과 구조 탐색Apr 16, 2025 am 12:09 AM

Redis의 데이터 모델 및 구조에는 5 가지 주요 유형이 포함됩니다. 1. 문자열 : 텍스트 또는 이진 데이터를 저장하는 데 사용되며 원자 연산을 지원합니다. 2. 목록 : 정렬 된 요소 컬렉션, 대기열 및 스택에 적합합니다. 세트 : 세트 작동을 지원하는 비 순차 고유 요소 세트. 4. 순서 세트 (SortedSet) : 순위에 적합한 점수가있는 고유 한 요소 세트. 5. 해시 테이블 (HASH) : 객체를 저장하는 데 적합한 키 값 쌍 모음.

REDIS : 데이터베이스 접근 방식을 분류합니다REDIS : 데이터베이스 접근 방식을 분류합니다Apr 15, 2025 am 12:06 AM

Redis의 데이터베이스 방법에는 메모리 인 데이터베이스 및 키 값 저장소가 포함됩니다. 1) Redis는 메모리에 데이터를 저장하고 빠르게 읽고 쓰고 있습니다. 2) 키 값 쌍을 사용하여 데이터를 저장하고 캐시 및 NOSQL 데이터베이스에 적합한 목록, 컬렉션, 해시 테이블 및 주문 컬렉션과 같은 복잡한 데이터 구조를 지원합니다.

왜 Redis를 사용합니까? 혜택과 장점왜 Redis를 사용합니까? 혜택과 장점Apr 14, 2025 am 12:07 AM

Redis는 빠른 성능, 풍부한 데이터 구조, 고 가용성 및 확장 성, 지속성 기능 및 광범위한 생태계 지원을 제공하기 때문에 강력한 데이터베이스 솔루션입니다. 1) 매우 빠른 성능 : Redis의 데이터는 메모리에 저장되며 동시성이 높고 대기 시간이 낮은 응용 프로그램에 적합한 빠른 읽기 및 쓰기 속도를 가지고 있습니다. 2) 풍부한 데이터 구조 : 다양한 시나리오에 적합한 목록, 컬렉션 등과 같은 여러 데이터 유형을 지원합니다. 3) 고 가용성 및 확장 성 : 마스터 슬레이브 복제 및 클러스터 모드를 지원하여 고 가용성 및 수평 확장 성을 달성합니다. 4) 지속성 및 데이터 보안 : 데이터 지속성은 RDB 및 AOF를 통해 달성되어 데이터 무결성 및 신뢰성을 보장합니다. 5) 광범위한 생태계 및 지역 사회 지원 : 거대한 생태계와 활동적인 커뮤니티,

NOSQL 이해 : Redis의 주요 기능NOSQL 이해 : Redis의 주요 기능Apr 13, 2025 am 12:17 AM

Redis의 주요 기능에는 속도, 유연성 및 풍부한 데이터 구조 지원이 포함됩니다. 1) 속도 : Redis는 메모리 내 데이터베이스이며, 읽기 및 쓰기 작업은 거의 순간적이며 캐시 및 세션 관리에 적합합니다. 2) 유연성 : 복잡한 데이터 처리에 적합한 문자열, 목록, 컬렉션 등과 같은 여러 데이터 구조를 지원합니다. 3) 데이터 구조 지원 : 다양한 비즈니스 요구에 적합한 문자열, 목록, 컬렉션, 해시 테이블 등을 제공합니다.

REDIS : 기본 기능을 식별합니다REDIS : 기본 기능을 식별합니다Apr 12, 2025 am 12:01 AM

Redis의 핵심 기능은 고성능 인 메모리 데이터 저장 및 처리 시스템입니다. 1) 고속 데이터 액세스 : Redis는 메모리에 데이터를 저장하고 마이크로 초 수준 읽기 및 쓰기 속도를 제공합니다. 2) 풍부한 데이터 구조 : 문자열, 목록, 컬렉션 등을 지원하며 다양한 응용 프로그램 시나리오에 적응합니다. 3) 지속성 : RDB 및 AOF를 통해 디스크에 데이터를 지속하십시오. 4) 구독 게시 : 메시지 대기열 또는 실시간 통신 시스템에서 사용할 수 있습니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

DVWA

DVWA

DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

SublimeText3 영어 버전

SublimeText3 영어 버전

권장 사항: Win 버전, 코드 프롬프트 지원!

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

PhpStorm 맥 버전

PhpStorm 맥 버전

최신(2018.2.1) 전문 PHP 통합 개발 도구