lzf79 发表于 2018-11-2 12:35:37

Redis杂记

安装redis:  # yum -y localinstall redis-3.0.7-4.el6.art.i686.rpm
  修改监听端口:
  bind 10.201.106.22 127.0.0.1
  服务启动:
  # service redis start
  Starting redis-server:                                    
  服务器配置SLAVE:
  # redis-cli
  127.0.0.1:6379> SLAVEOF 10.201.106.21 6379
  OK
  现在node2已经是从服务器了
  日志查看:
  # tail -20 /var/log/redis/redis.log
  `-._    `-._`-.__.-'_.-'    _.-'
  `-._    `-.__.-'    _.-'
  `-._      _.-'
  `-.__.-'
  1694:M 14 Sep 04:35:05.444 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
  1694:M 14 Sep 04:35:05.444 # Server started, Redis version 3.0.7
  1694:M 14 Sep 04:35:05.444 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
  1694:M 14 Sep 04:35:05.444 * The server is now ready to accept connections on port 6379

  1694:S 14 Sep 04:36:03.912 * SLAVE OF 10.201.106.21:6379 enabled (user request from 'id=2 addr=127.0.0.1:54185 fd=6 name= age=32>  1694:S 14 Sep 04:36:04.156 * Connecting to MASTER 10.201.106.21:6379
  1694:S 14 Sep 04:36:04.156 * MASTERSLAVE sync started
  1694:S 14 Sep 04:36:04.157 * Non blocking connect for SYNC fired the event.
  1694:S 14 Sep 04:36:04.159 * Master replied to PING, replication can continue...
  1694:S 14 Sep 04:36:04.160 * Partial resynchronization not possible (no cached master)
  1694:S 14 Sep 04:36:04.196 * Full resync from master: d76cae20eecf731fd10f73a5498e61197a60e9de:1
  1694:S 14 Sep 04:36:04.256 * MASTERSLAVE sync: receiving 44 bytes from master
  1694:S 14 Sep 04:36:04.256 * MASTERSLAVE sync: Flushing old data
  1694:S 14 Sep 04:36:04.256 * MASTERSLAVE sync: Loading DB in memory
  1694:S 14 Sep 04:36:04.256 * MASTERSLAVE sync: Finished with success
  主服务器配置

页: [1]
查看完整版本: Redis杂记