keydb.conf.j2 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # {{ ansible_managed }}
  2. bind 0.0.0.0
  3. protected-mode {{ redis_protected_mode }}
  4. port {{ redis_port }}
  5. timeout {{ redis_timeout }}
  6. daemonize {{ redis_daemonize }}
  7. pidfile {{ redis_pidfile }}
  8. loglevel {{ redis_loglevel }}
  9. logfile {{ redis_logfile }}
  10. databases {{ redis_databases }}
  11. {% for save in redis_save %}
  12. save {{ save }}
  13. {% endfor %}
  14. rdbcompression {{ redis_rdbcompression }}
  15. dbfilename {{ redis_dbfilename }}
  16. dir {{ redis_dbdir }}
  17. tcp-backlog 511
  18. tcp-keepalive 300
  19. supervised no
  20. always-show-logo yes
  21. set-proc-title yes
  22. proc-title-template "{title} {listen-addr} {server-mode}"
  23. stop-writes-on-bgsave-error yes
  24. rdbchecksum yes
  25. rdb-del-sync-files no
  26. replica-serve-stale-data yes
  27. replica-read-only yes
  28. repl-diskless-sync no
  29. repl-diskless-sync-delay 5
  30. repl-diskless-load disabled
  31. repl-disable-tcp-nodelay no
  32. replica-priority 100
  33. acllog-max-len 128
  34. lazyfree-lazy-eviction no
  35. lazyfree-lazy-expire no
  36. lazyfree-lazy-server-del no
  37. replica-lazy-flush no
  38. lazyfree-lazy-user-del no
  39. lazyfree-lazy-user-flush no
  40. oom-score-adj no
  41. oom-score-adj-values 0 200 800
  42. disable-thp yes
  43. appendonly no
  44. appendfilename "appendonly.aof"
  45. appendfsync everysec
  46. no-appendfsync-on-rewrite no
  47. auto-aof-rewrite-percentage 100
  48. auto-aof-rewrite-min-size 64mb
  49. aof-load-truncated yes
  50. aof-use-rdb-preamble yes
  51. lua-time-limit 5000
  52. slowlog-log-slower-than 10000
  53. slowlog-max-len 128
  54. latency-monitor-threshold 0
  55. notify-keyspace-events ""
  56. hash-max-ziplist-entries 512
  57. hash-max-ziplist-value 64
  58. list-max-ziplist-size -2
  59. list-compress-depth 0
  60. set-max-intset-entries 512
  61. zset-max-ziplist-entries 128
  62. zset-max-ziplist-value 64
  63. hll-sparse-max-bytes 3000
  64. stream-node-max-bytes 4096
  65. stream-node-max-entries 100
  66. activerehashing yes
  67. client-output-buffer-limit normal 0 0 0
  68. client-output-buffer-limit replica 256mb 64mb 60
  69. client-output-buffer-limit pubsub 32mb 8mb 60
  70. hz 10
  71. dynamic-hz yes
  72. aof-rewrite-incremental-fsync yes
  73. rdb-save-incremental-fsync yes
  74. jemalloc-bg-thread yes
  75. server-threads 2
  76. replica-weighting-factor 2
  77. {% if redis_list_servers|length == 2 %}
  78. multi-master yes
  79. active-replica yes
  80. {% if ansible_fqdn != redis_list_servers[0] %}
  81. replicaof {{ hostvars[redis_list_servers[0]]['ansible_host'] }} {{ redis_port }}
  82. {% else %}
  83. replicaof {{ hostvars[redis_list_servers[1]]['ansible_host'] }} {{ redis_port }}
  84. {% endif %}
  85. {% endif %}