Redis主从集群薪火相传即一个Slave是另一个Slave的Master来降低主机负担—–Redis

127.0.0.1:6379> quit
[root@localhost myredis]# cd /myredis
[root@localhost myredis]# ll
总用量 236
-rw-r--r--. 1 root root   9254 1月  21 14:24 6379.log
drwxr-xr-x. 2 root root    132 1月  18 16:33 appendonlydir
-rw-r--r--. 1 root root    111 1月  18 16:48 cmd.txt
-rw-r--r--. 1 root root    435 1月  21 14:24 dump6379.rdb
-rw-r--r--. 1 root root 107540 1月  20 15:38 redis6379.conf
-rw-r--r--. 1 root root 107529 1月  18 16:06 redis.conf
[root@localhost myredis]# cd 6379.log
bash: cd: 6379.log: 不是目录
[root@localhost myredis]# vim 6379.log
[root@localhost myredis]# vim redis6379.conf
[root@localhost myredis]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since 六 2024-01-20 16:16:20 CST; 22h ago
     Docs: man:firewalld(1)
  Process: 829 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 829 (code=exited, status=0/SUCCESS)

1月 20 15:02:35 localhost.localdomain systemd[1]: Starting firewalld - dynam...
1月 20 15:02:36 localhost.localdomain systemd[1]: Started firewalld - dynami...
1月 20 15:02:36 localhost.localdomain firewalld[829]: WARNING: AllowZoneDrif...
1月 20 16:16:18 localhost.localdomain systemd[1]: Stopping firewalld - dynam...
1月 20 16:16:20 localhost.localdomain systemd[1]: Stopped firewalld - dynami...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost myredis]# redis-cli -a abc123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:2
slave0:ip=192.168.92.130,port=6380,state=online,offset=2572,lag=1
slave1:ip=192.168.92.131,port=6381,state=online,offset=2572,lag=1
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2572
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:84
127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:1
slave0:ip=192.168.92.130,port=6380,state=online,offset=2740,lag=1
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2740
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:252
127.0.0.1:6379> set k7
(error) ERR wrong number of arguments for 'set' command
127.0.0.1:6379> set k7 v7
OK

127.0.0.1:6379> quit
[root@localhost myredis]# cd /myredis
[root@localhost myredis]# ll
总用量 236
-rw-r--r--. 1 root root   9254 1月  21 14:24 6379.log
drwxr-xr-x. 2 root root    132 1月  18 16:33 appendonlydir
-rw-r--r--. 1 root root    111 1月  18 16:48 cmd.txt
-rw-r--r--. 1 root root    435 1月  21 14:24 dump6379.rdb
-rw-r--r--. 1 root root 107540 1月  20 15:38 redis6379.conf
-rw-r--r--. 1 root root 107529 1月  18 16:06 redis.conf
[root@localhost myredis]# cd 6379.log
bash: cd: 6379.log: 不是目录
[root@localhost myredis]# vim 6379.log
[root@localhost myredis]# vim redis6379.conf
[root@localhost myredis]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since 六 2024-01-20 16:16:20 CST; 22h ago
     Docs: man:firewalld(1)
  Process: 829 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 829 (code=exited, status=0/SUCCESS)

1月 20 15:02:35 localhost.localdomain systemd[1]: Starting firewalld - dynam...
1月 20 15:02:36 localhost.localdomain systemd[1]: Started firewalld - dynami...
1月 20 15:02:36 localhost.localdomain firewalld[829]: WARNING: AllowZoneDrif...
1月 20 16:16:18 localhost.localdomain systemd[1]: Stopping firewalld - dynam...
1月 20 16:16:20 localhost.localdomain systemd[1]: Stopped firewalld - dynami...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost myredis]# redis-cli -a abc123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:2
slave0:ip=192.168.92.130,port=6380,state=online,offset=2572,lag=1
slave1:ip=192.168.92.131,port=6381,state=online,offset=2572,lag=1
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2572
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:84
127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:1
slave0:ip=192.168.92.130,port=6380,state=online,offset=2740,lag=1
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2740
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:252
127.0.0.1:6379> set k7
(error) ERR wrong number of arguments for 'set' command
127.0.0.1:6379> set k7 v7
OK
 

[root@localhost myredis]# vim 6380.log 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:3
master_sync_in_progress:0
slave_read_repl_offset:2488
slave_repl_offset:2488
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2488
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:0
127.0.0.1:6380> get k6
"v6"
127.0.0.1:6380> quit
[root@localhost myredis]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.92.130  netmask 255.255.255.0  broadcast 192.168.92.255
        inet6 fe80::5d0e:f975:2a1e:b6d2  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::371e:c0c:3dd4:34b4  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:a5:ad:75  txqueuelen 1000  (Ethernet)
        RX packets 33428  bytes 43105059 (41.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5519  bytes 445421 (434.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 679  bytes 1275148 (1.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 679  bytes 1275148 (1.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:55:d3:7b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:6
master_sync_in_progress:0
slave_read_repl_offset:2684
slave_repl_offset:2684
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2684
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:196
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:7
master_sync_in_progress:0
slave_read_repl_offset:2768
slave_repl_offset:2768
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2768
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:280
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:9
master_sync_in_progress:0
slave_read_repl_offset:2824
slave_repl_offset:2824
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2824
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:336
127.0.0.1:6380> get k7
"v7"
127.0.0.1:6380> quit
[root@localhost myredis]# systemctl stop firewalld
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:4
master_sync_in_progress:0
slave_read_repl_offset:3170
slave_repl_offset:3170
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3170
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:682
127.0.0.1:6380> quit
[root@localhost myredis]# vim /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:4
master_sync_in_progress:0
slave_read_repl_offset:3450
slave_repl_offset:3450
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:1
slave0:ip=192.168.92.131,port=6381,state=online,offset=3450,lag=0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3450
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:3409
repl_backlog_histlen:42

[root@localhost myredis]# vim 6380.log 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:3
master_sync_in_progress:0
slave_read_repl_offset:2488
slave_repl_offset:2488
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2488
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:0
127.0.0.1:6380> get k6
"v6"
127.0.0.1:6380> quit
[root@localhost myredis]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.92.130  netmask 255.255.255.0  broadcast 192.168.92.255
        inet6 fe80::5d0e:f975:2a1e:b6d2  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::371e:c0c:3dd4:34b4  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:a5:ad:75  txqueuelen 1000  (Ethernet)
        RX packets 33428  bytes 43105059 (41.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5519  bytes 445421 (434.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 679  bytes 1275148 (1.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 679  bytes 1275148 (1.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:55:d3:7b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:6
master_sync_in_progress:0
slave_read_repl_offset:2684
slave_repl_offset:2684
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2684
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:196
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:7
master_sync_in_progress:0
slave_read_repl_offset:2768
slave_repl_offset:2768
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2768
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:280
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:9
master_sync_in_progress:0
slave_read_repl_offset:2824
slave_repl_offset:2824
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2824
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:336
127.0.0.1:6380> get k7
"v7"
127.0.0.1:6380> quit
[root@localhost myredis]# systemctl stop firewalld
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:4
master_sync_in_progress:0
slave_read_repl_offset:3170
slave_repl_offset:3170
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3170
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:682
127.0.0.1:6380> quit
[root@localhost myredis]# vim /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6380> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6380.conf 
[root@localhost myredis]# redis-cli -a abc123 -p 6380
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6380> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:4
master_sync_in_progress:0
slave_read_repl_offset:3450
slave_repl_offset:3450
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:1
slave0:ip=192.168.92.131,port=6381,state=online,offset=3450,lag=0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3450
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:3409
repl_backlog_histlen:42
 

127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.cfg
4314:C 20 Jan 2024 16:48:25.353 # Fatal error, can't open config file '/myredis/redis6381.cfg': No such file or directory
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:f0cb4a8bc6c80cd62a55a9c199aefe871f41820a
master_replid2:7513fad147a6f946a72271ad8c74f19878c9a166
master_repl_offset:2488
second_repl_offset:2489
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:0
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:740f3ad83d22f16994dbc9e5cfb37916f896bbda
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2488
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:2
master_sync_in_progress:0
slave_read_repl_offset:2544
slave_repl_offset:2544
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2544
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:14
127.0.0.1:6381> get k6
"v6"
127.0.0.1:6381> slaveof 192.168.92.130 6380
OK
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:43
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:109
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> get k7
(nil)
127.0.0.1:6381> keys *
 1) "k1"
 2) "k2"
 3) "key"
 4) "k4"
 5) "user:001"
 6) "balance"
 7) "k300"
 8) "email"
 9) "ksas"
10) "k5"
11) "k10000"
12) "k100"
13) "k3"
14) "list"
15) "k200"
16) "k6"
17) "count"
127.0.0.1:6381> slaveof connected_slaves:0
(error) ERR wrong number of arguments for 'slaveof' command
127.0.0.1:6381> slaveof 192.168.92.130
(error) ERR wrong number of arguments for 'slaveof' command
127.0.0.1:6381> slaveof 192.168.92.130 6380
OK Already connected to specified master
127.0.0.1:6381> get k7
(nil)
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:302
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:up
master_last_io_seconds_ago:5
master_sync_in_progress:0
slave_read_repl_offset:3436
slave_repl_offset:3436
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3436
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:3437
repl_backlog_histlen:0

 127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.cfg
4314:C 20 Jan 2024 16:48:25.353 # Fatal error, can't open config file '/myredis/redis6381.cfg': No such file or directory
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:f0cb4a8bc6c80cd62a55a9c199aefe871f41820a
master_replid2:7513fad147a6f946a72271ad8c74f19878c9a166
master_repl_offset:2488
second_repl_offset:2489
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2489
repl_backlog_histlen:0
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:740f3ad83d22f16994dbc9e5cfb37916f896bbda
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2488
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.129
master_port:6379
master_link_status:up
master_last_io_seconds_ago:2
master_sync_in_progress:0
slave_read_repl_offset:2544
slave_repl_offset:2544
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2544
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:14
127.0.0.1:6381> get k6
"v6"
127.0.0.1:6381> slaveof 192.168.92.130 6380
OK
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:43
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:109
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> get k7
(nil)
127.0.0.1:6381> keys *
 1) "k1"
 2) "k2"
 3) "key"
 4) "k4"
 5) "user:001"
 6) "balance"
 7) "k300"
 8) "email"
 9) "ksas"
10) "k5"
11) "k10000"
12) "k100"
13) "k3"
14) "list"
15) "k200"
16) "k6"
17) "count"
127.0.0.1:6381> slaveof connected_slaves:0
(error) ERR wrong number of arguments for 'slaveof' command
127.0.0.1:6381> slaveof 192.168.92.130
(error) ERR wrong number of arguments for 'slaveof' command
127.0.0.1:6381> slaveof 192.168.92.130 6380
OK Already connected to specified master
127.0.0.1:6381> get k7
(nil)
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_read_repl_offset:2670
slave_repl_offset:2670
master_link_down_since_seconds:302
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:2670
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:2531
repl_backlog_histlen:140
127.0.0.1:6381> quit
[root@localhost myredis]# vim /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> shutdown
not connected> quit
[root@localhost myredis]# redis-server /myredis/redis6381.conf
[root@localhost myredis]# redis-cli -a abc123 -p 6381
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6381> info replication
# Replication
role:slave
master_host:192.168.92.130
master_port:6380
master_link_status:up
master_last_io_seconds_ago:5
master_sync_in_progress:0
slave_read_repl_offset:3436
slave_repl_offset:3436
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:07c7ade6a35e9d4672d18a9094554e73f3b8c65c
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:3436
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:3437
repl_backlog_histlen:0