mac系统Redis启动和关闭

1.后台启动redis的6380端口

redis-server --port 6380 --daemonize yes

2.进入redis

redis-cli -p 6380

3.挂靠主节点

slaveof 127.0.0.1 6379

4.查看当前节点信息

info replication

节点信息如下

# Replication
role:slave
master_host:127.0.0.1
master_port:6379
master_link_status:up
master_last_io_seconds_ago:2
master_sync_in_progress:0
slave_read_repl_offset:14
slave_repl_offset:14
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:640e3a51b083a974e5ad111ad10f77b615a5120e
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:14
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:15
repl_backlog_histlen:0

你可能感兴趣的:(redis)