inushome 发表于 2018-11-5 11:25:47

Redis集群功能配置以及Redis Sentinel配置

一、安装redis并配置主从
  1.安装redis
  # tar zxvf redis-3.0.3.tar.gz
  # cd redis-3.0.3
  # make PREFIX=/data/install/redis install
  2.查看安装后目录/文件
  # ls -R /data/install/redis/
  /data/install/redis/:
  bin
  /data/install/redis/bin:
  redis-benchmarkredis-check-aofredis-check-dumpredis-cli redis-sentinelredis-server
  3.默认没有配置文件,创建目录,倒入配置
  mkdir /data/install/redis/conf
  mkdir /data/install/redis/data
  mkdir /data/log/redis/
  cp/data/redis/redis-3.0.3/redis.conf /data/install/redis/conf/ (源路径看实际情况)
  =====redis.conf==模板====(直接拷贝就好了,注意标红)
  daemonize yes
  pidfile"/data/install/redis/redis.pid"
  port 6379
  tcp-backlog511
  timeout0
  tcp-keepalive0
  loglevelnotice
  logfile " /data/log/redis/redis.log"
  databases16
  save 9001
  save 30010
  save 6010000
  stop-writes-on-bgsave-erroryes
  rdbcompressionyes
  rdbchecksumyes
  dbfilenamedump.rdb
  dir"/data/install/redis/data"
  slave-serve-stale-datayes
  slave-read-onlyyes
  maxmemory 128M
  masterauth "test123"
  requirepass "test123"
  repl-diskless-syncno
  repl-diskless-sync-delay5
  repl-disable-tcp-nodelayno
  slave-priority100
  appendonlyno
  appendfilename"appendonly.aof"
  appendfsynceverysec
  no-appendfsync-on-rewriteno
  auto-aof-rewrite-percentage100
  auto-aof-rewrite-min-size64mb
  aof-load-truncatedyes
  lua-time-limit5000
  slowlog-log-slower-than10000
  slowlog-max-len128
  latency-monitor-threshold0
  notify-keyspace-events""
  hash-max-ziplist-entries512
  hash-max-ziplist-value64
  list-max-ziplist-entries512
  list-max-ziplist-value64
  set-max-intset-entries512
  zset-max-ziplist-entries128
  zset-max-ziplist-value64
  hll-sparse-max-bytes3000
  activerehashingyes
  client-output-buffer-limitnormal 0 0 0
  client-output-buffer-limitslave 256mb 64mb 60
  client-output-buffer-limitpubsub 32mb 8mb 60
  hz 10
  aof-rewrite-incremental-fsyncyes
  ===========End===========

页: [1]
查看完整版本: Redis集群功能配置以及Redis Sentinel配置