redis.conf.j2_new 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. daemonize yes
  2. pidfile /var/run/redis/{{ redis_daemon }}.pid
  3. port {{ redis_port }}
  4. # {% if ansible_eth0.ipv4.address == hostvars[groups['lan_rd'][0]]['ansible_host'] %}
  5. # bind 127.0.0.1 {{ ansible_default_ipv4.address }}
  6. # {% else %}
  7. # bind 127.0.0.1 {{ ansible_default_ipv4.address }}
  8. # slaveof {{ hostvars[groups['lan_rd'][0]]['ansible_host'] }} 6379
  9. # {% endif %}
  10. bind {{ redis_bind_interface }}
  11. {% if redis_unixsocket %}
  12. unixsocket {{ redis_unixsocket }}
  13. {% endif %}
  14. timeout {{ redis_timeout }}
  15. loglevel {{ redis_loglevel }}
  16. logfile {{ redis_logfile }}
  17. # To enable logging to the system logger, just set 'syslog-enabled' to yes,
  18. # and optionally update the other syslog parameters to suit your needs.
  19. # syslog-enabled no
  20. # syslog-ident redis
  21. # syslog-facility local0
  22. databases {{ redis_databases }}
  23. {% for save in redis_save %}
  24. save {{ save }}
  25. {% endfor %}
  26. rdbcompression {{ redis_rdbcompression }}
  27. dbfilename {{ redis_dbfilename }}
  28. dir {{ redis_dbdir }}
  29. # maxclients 128
  30. {% if redis_maxmemory %}
  31. maxmemory {{ redis_maxmemory }}
  32. maxmemory-policy {{ redis_maxmemory_policy }}
  33. maxmemory-samples {{ redis_maxmemory_samples }}
  34. {% endif %}
  35. appendonly {{ redis_appendonly }}
  36. appendfsync {{ redis_appendfsync }}
  37. no-appendfsync-on-rewrite no
  38. {% for include in redis_includes %}
  39. include {{ include }}
  40. {% endfor %}
  41. {% if redis_requirepass %}
  42. requirepass {{ redis_requirepass }}
  43. {% endif %}
  44. {% for redis_disabled_command in redis_disabled_commands %}
  45. rename-command {{ redis_disabled_command }} ""
  46. {% endfor %}
  47. protected-mode yes
  48. unixsocketperm 775
  49. maxclients 512
  50. tcp-backlog 511
  51. tcp-keepalive 300
  52. supervised no
  53. always-show-logo yes
  54. stop-writes-on-bgsave-error yes
  55. rdbchecksum yes
  56. replica-serve-stale-data yes
  57. replica-read-only yes
  58. repl-diskless-sync no
  59. repl-diskless-sync-delay 5
  60. repl-disable-tcp-nodelay no
  61. replica-priority 100
  62. lazyfree-lazy-eviction no
  63. lazyfree-lazy-expire no
  64. lazyfree-lazy-server-del no
  65. replica-lazy-flush no
  66. appendfilename "appendonly.aof"
  67. auto-aof-rewrite-percentage 100
  68. auto-aof-rewrite-min-size 64mb
  69. aof-load-truncated yes
  70. aof-use-rdb-preamble yes
  71. lua-time-limit 5000
  72. slowlog-log-slower-than 10000
  73. slowlog-max-len 128
  74. latency-monitor-threshold 0
  75. notify-keyspace-events ""
  76. hash-max-ziplist-entries 512
  77. hash-max-ziplist-value 64
  78. list-max-ziplist-size -2
  79. list-compress-depth 0
  80. set-max-intset-entries 512
  81. zset-max-ziplist-entries 128
  82. zset-max-ziplist-value 64
  83. hll-sparse-max-bytes 3000
  84. stream-node-max-bytes 4096
  85. stream-node-max-entries 100
  86. activerehashing yes
  87. client-output-buffer-limit normal 0 0 0
  88. client-output-buffer-limit replica 256mb 64mb 60
  89. client-output-buffer-limit pubsub 32mb 8mb 60
  90. hz 10
  91. dynamic-hz yes
  92. aof-rewrite-incremental-fsync yes
  93. rdb-save-incremental-fsync yes