配置机器1

  • 在演示中,192.168.12.107为当前ubuntu机器的ip
  • 在192.168.12.107上进入Desktop目录,创建redis目录
  • 在redis目录下创建文件7000.conf,编辑内容如下
port 7000
bind 192.168.12.107
daemonize yes
pidfile 7000.pid
cluster-enabled yes
cluster-config-file 7000_node.conf
cluster-node-timeout 15000
appendonly yes
  • 在redis目录下创建文件7001.conf,编辑内容如下
port 7001
bind 192.168.12.107
daemonize yes
pidfile 7001.pid
cluster-enabled yes
cluster-config-file 7001_node.conf
cluster-node-timeout 15000
appendonly yes
  • 在redis目录下创建文件7002.conf,编辑内容如下
port 7002
bind 192.168.12.107
daemonize yes
pidfile 7002.pid
cluster-enabled yes
cluster-config-file 7002_node.conf
cluster-node-timeout 15000
appendonly yes
  • 总结:三个文件的配置区别在port、pidfile、cluster-config-file三项
  • 使用配置文件启动redis服务
redis-server 7000.conf
redis-server 7001.conf
redis-server 7002.conf
  • 查看进程如下图

集群