diff --git a/manifests/config.pp b/manifests/config.pp index 9085eb67..7a349bb3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -3,69 +3,6 @@ # This class provides configuration for Redis. # class redis::config { - $activerehashing = $::redis::activerehashing - $aof_load_truncated = $::redis::aof_load_truncated - $aof_rewrite_incremental_fsync = $::redis::aof_rewrite_incremental_fsync - $appendfilename = $::redis::appendfilename - $appendfsync = $::redis::appendfsync - $appendonly = $::redis::appendonly - $auto_aof_rewrite_min_size = $::redis::auto_aof_rewrite_min_size - $auto_aof_rewrite_percentage = $::redis::auto_aof_rewrite_percentage - $bind = $::redis::bind - $cluster_config_file = $::redis::cluster_config_file - $cluster_enabled = $::redis::cluster_enabled - $cluster_node_timeout = $::redis::cluster_node_timeout - $daemonize = $::redis::daemonize - $databases = $::redis::databases - $dbfilename = $::redis::dbfilename - $extra_config_file = $::redis::extra_config_file - $hash_max_ziplist_entries = $::redis::hash_max_ziplist_entries - $hash_max_ziplist_value = $::redis::hash_max_ziplist_value - $hll_sparse_max_bytes = $::redis::hll_sparse_max_bytes - $hz = $::redis::hz - $latency_monitor_threshold = $::redis::latency_monitor_threshold - $list_max_ziplist_entries = $::redis::list_max_ziplist_entries - $list_max_ziplist_value = $::redis::list_max_ziplist_value - $log_file = $::redis::log_file - $log_level = $::redis::log_level - $masterauth = $::redis::masterauth - $maxclients = $::redis::maxclients - $maxmemory = $::redis::maxmemory - $maxmemory_policy = $::redis::maxmemory_policy - $maxmemory_samples = $::redis::maxmemory_samples - $min_slaves_max_lag = $::redis::min_slaves_max_lag - $min_slaves_to_write = $::redis::min_slaves_to_write - $no_appendfsync_on_rewrite = $::redis::no_appendfsync_on_rewrite - $notify_keyspace_events = $::redis::notify_keyspace_events - $pid_file = $::redis::pid_file - $port = $::redis::port - $rdbcompression = $::redis::rdbcompression - $repl_backlog_size = $::redis::repl_backlog_size - $repl_backlog_ttl = $::redis::repl_backlog_ttl - $repl_disable_tcp_nodelay = $::redis::repl_disable_tcp_nodelay - $repl_ping_slave_period = $::redis::repl_ping_slave_period - $repl_timeout = $::redis::repl_timeout - $requirepass = $::redis::requirepass - $save_db_to_disk = $::redis::save_db_to_disk - $save_db_to_disk_interval = $::redis::save_db_to_disk_interval - $set_max_intset_entries = $::redis::set_max_intset_entries - $slave_priority = $::redis::slave_priority - $slave_read_only = $::redis::slave_read_only - $slave_serve_stale_data = $::redis::slave_serve_stale_data - $slaveof = $::redis::slaveof - $slowlog_log_slower_than = $::redis::slowlog_log_slower_than - $slowlog_max_len = $::redis::slowlog_max_len - $stop_writes_on_bgsave_error = $::redis::stop_writes_on_bgsave_error - $syslog_enabled = $::redis::syslog_enabled - $syslog_facility = $::redis::syslog_facility - $tcp_backlog = $::redis::tcp_backlog - $tcp_keepalive = $::redis::tcp_keepalive - $timeout = $::redis::timeout - $unixsocket = $::redis::unixsocket - $unixsocketperm = $::redis::unixsocketperm - $workdir = $::redis::workdir - $zset_max_ziplist_entries = $::redis::zset_max_ziplist_entries - $zset_max_ziplist_value = $::redis::zset_max_ziplist_value if $::redis::notify_service { File { diff --git a/templates/redis-sentinel.conf.erb b/templates/redis-sentinel.conf.erb index de292823..59902d7a 100644 --- a/templates/redis-sentinel.conf.erb +++ b/templates/redis-sentinel.conf.erb @@ -1,23 +1,23 @@ -<% if @sentinel_bind -%> -bind <%= @sentinel_bind %> +<% if scope['redis::sentinel::sentinel_bind']-%> +bind <%= scope['redis::sentinel::sentinel_bind'] %> <% end -%> -port <%= @sentinel_port %> -dir <%= @working_dir %> -<% if @daemonize -%>daemonize yes<% else -%>daemonize no<% end %> -pidfile <%= @pid_file %> +port <%= scope['redis::sentinel::sentinel_port'] %> +dir <%= scope['redis::sentinel::working_dir'] %> +<% if scope['redis::sentinel::daemonize'] -%>daemonize yes<% else -%>daemonize no<% end %> +pidfile <%= scope['redis::sentinel::pid_file'] %> -sentinel monitor <%= @master_name %> <%= @redis_host %> <%= @redis_port %> <%= @quorum %> -sentinel down-after-milliseconds <%= @master_name %> <%= @down_after %> -sentinel parallel-syncs <%= @master_name %> <%= @parallel_sync %> -sentinel failover-timeout <%= @master_name %> <%= @failover_timeout %> -<% if @auth_pass -%> -sentinel auth-pass <%= @master_name %> <%= @auth_pass %> +sentinel monitor <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::redis_host'] %> <%= scope['redis::sentinel::redis_port'] %> <%= scope['redis::sentinel::quorum'] %> +sentinel down-after-milliseconds <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::down_after'] %> +sentinel parallel-syncs <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::parallel_sync'] %> +sentinel failover-timeout <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::failover_timeout'] %> +<% if scope['redis::sentinel::auth_pass']-%> +sentinel auth-pass <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::auth_pass'] %> <% end -%> -<% if @notification_script -%> -sentinel notification-script <%= @master_name %> <%= @notification_script %> +<% if scope['redis::sentinel::notification_script']-%> +sentinel notification-script <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::notification_script'] %> <% end -%> -<% if @client_reconfig_script -%> -sentinel client-reconfig-script <%= @master_name %> <%= @client_reconfig_script %> +<% if scope['redis::sentinel::client_reconfig_script']-%> +sentinel client-reconfig-script <%= scope['redis::sentinel::master_name'] %> <%= scope['redis::sentinel::client_reconfig_script'] %> <% end -%> -logfile <%= @log_file %> +logfile <%= scope['redis::sentinel::log_file'] %> diff --git a/templates/redis-sentinel.init.erb b/templates/redis-sentinel.init.erb index a4e1b397..24279276 100644 --- a/templates/redis-sentinel.init.erb +++ b/templates/redis-sentinel.init.erb @@ -14,7 +14,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/redis-sentinel -DAEMON_ARGS=<%= @config_file %> +DAEMON_ARGS=<%= scope['redis::config_file'] %> NAME=redis-sentinel DESC=redis-senitnel @@ -37,7 +37,7 @@ case "$1" in echo -n "Starting $DESC: " mkdir -p $RUNDIR touch $PIDFILE - chown <%= @service_user %>:<%= @service_group %> $RUNDIR $PIDFILE + chown <%= scope['redis::service_user'] %>:<%= scope['redis::service_group'] %> $RUNDIR $PIDFILE chmod 755 $RUNDIR if [ -n "$ULIMIT" ] @@ -45,7 +45,7 @@ case "$1" in ulimit -n $ULIMIT fi - if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid <%= @service_user %>:<%= @service_group %> --exec $DAEMON -- $DAEMON_ARGS + if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid <%= scope['redis::service_user'] %>:<%= scope['redis::service_group'] %> --exec $DAEMON -- $DAEMON_ARGS then echo "$NAME." else diff --git a/templates/redis.conf.erb b/templates/redis.conf.erb index ca3c7100..d0283abd 100644 --- a/templates/redis.conf.erb +++ b/templates/redis.conf.erb @@ -14,15 +14,15 @@ # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. -daemonize <% if @daemonize -%>yes<% else -%>no<% end -%> +daemonize <% if scope['redis::daemonize'] -%>yes<% else -%>no<% end -%> # When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here. -pidfile <%= @pid_file %> +pidfile <%= scope['redis::pid_file'] %> # Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. -port <%= @port %> +port <%= scope['redis::port'] %> # TCP listen() backlog. # @@ -31,22 +31,22 @@ port <%= @port %> # will silently truncate it to the value of /proc/sys/net/core/somaxconn so # make sure to raise both the value of somaxconn and tcp_max_syn_backlog # in order to get the desired effect. -tcp-backlog <%= @tcp_backlog %> +tcp-backlog <%= scope['redis::tcp_backlog'] %> # If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # -bind <%= @bind %> +bind <%= scope['redis::bind'] %> # Specify the path for the unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen # on a unix socket when not specified. # -<% if @unixsocket %>unixsocket <%= @unixsocket %><% end %> -<% if @unixsocketperm %>unixsocketperm <%= @unixsocketperm %><% end %> +<% if scope['redis::unixsocket'] %>unixsocket <%= scope['redis::unixsocket'] %><% end %> +<% if scope['redis::unixsocketperm'] %>unixsocketperm <%= scope['redis::unixsocketperm'] %><% end %> # Close the connection after a client is idle for N seconds (0 to disable) -timeout <%= @timeout %> +timeout <%= scope['redis::timeout'] %> # TCP keepalive. # @@ -62,7 +62,7 @@ timeout <%= @timeout %> # On other kernels the period depends on the kernel configuration. # # A reasonable value for this option is 60 seconds. -tcp-keepalive <%= @tcp_keepalive %> +tcp-keepalive <%= scope['redis::tcp_keepalive'] %> # Set server verbosity to 'debug' # it can be one of: @@ -70,27 +70,27 @@ tcp-keepalive <%= @tcp_keepalive %> # verbose (many rarely useful info, but not a mess like the debug level) # notice (moderately verbose, what you want in production probably) # warning (only very important / critical messages are logged) -loglevel <%= @log_level %> +loglevel <%= scope['redis::log_level'] %> # Specify the log file name. Also 'stdout' can be used to force # Redis to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null -logfile <%= @log_file %> +logfile <%= scope['redis::log_file'] %> # To enable logging to the system logger, just set 'syslog-enabled' to yes, # and optionally update the other syslog parameters to suit your needs. -syslog-enabled <% if @syslog_enabled %>yes<% else %>no<% end %> +syslog-enabled <% if scope['redis::syslog_enabled'] %>yes<% else %>no<% end %> # Specify the syslog identity. # syslog-ident redis # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. -<% if @syslog_facility %>syslog-facility <%= @syslog_facility %><% else %># syslog-facility local0<% end %> +<% if scope['redis::syslog_facility'] %>syslog-facility <%= scope['redis::syslog_facility'] %><% else %># syslog-facility local0<% end %> # Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT where # dbid is a number between 0 and 'databases'-1 -databases <%= @databases %> +databases <%= scope['redis::databases'] %> ################################ SNAPSHOTTING ################################# # @@ -113,8 +113,8 @@ databases <%= @databases %> # like in the following example: # # save "" -<% if @save_db_to_disk %> -<%- @save_db_to_disk_interval.sort_by{}.each do |seconds, key_change| -%> +<% if scope['redis::save_db_to_disk'] %> +<%- scope['save_db_to_disk_interval'].sort_by{}.each do |seconds, key_change| -%> save <%= seconds -%> <%= key_change -%> <%= "\n" -%> <%- end -%> <% end %> @@ -131,13 +131,13 @@ save <%= seconds -%> <%= key_change -%> <%= "\n" -%> # and persistence, you may want to disable this feature so that Redis will # continue to work as usual even if there are problems with disk, # permissions, and so forth. -stop-writes-on-bgsave-error <% if @stop_writes_on_bgsave_error -%>yes<% else -%>no<% end %> +stop-writes-on-bgsave-error <% if scope['redis::stop_writes_on_bgsave_error'] -%>yes<% else -%>no<% end %> # Compress string objects using LZF when dump .rdb databases? # For default that's set to 'yes' as it's almost always a win. # If you want to save some CPU in the saving child set it to 'no' but # the dataset will likely be bigger if you have compressible values or keys. -rdbcompression <% if @rdbcompression -%>yes<% else -%>no<% end %> +rdbcompression <% if scope['redis::rdbcompression'] -%>yes<% else -%>no<% end %> # Since verison 5 of RDB a CRC64 checksum is placed at the end of the file. # This makes the format more resistant to corruption but there is a performance @@ -149,7 +149,7 @@ rdbcompression <% if @rdbcompression -%>yes<% else -%>no<% end %> rdbchecksum yes # The filename where to dump the DB -dbfilename <%= @dbfilename %> +dbfilename <%= scope['redis::dbfilename'] %> # The working directory. # @@ -159,7 +159,7 @@ dbfilename <%= @dbfilename %> # Also the Append Only File will be created inside this directory. # # Note that you must specify a directory here, not a file name. -dir <%= @workdir %> +dir <%= scope['redis::workdir'] %> ################################# REPLICATION ################################# @@ -169,7 +169,7 @@ dir <%= @workdir %> # different interval, or to listen to another port, and so on. # # slaveof -<% if @slaveof -%>slaveof <%= @slaveof %><% end -%> +<% if scope['redis::slaveof'] -%>slaveof <%= scope['redis::slaveof'] %><% end -%> # If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the slave to authenticate before @@ -177,7 +177,7 @@ dir <%= @workdir %> # refuse the slave request. # # masterauth -<% if @masterauth -%>masterauth <%= @masterauth %><% end -%> +<% if scope['redis::masterauth'] -%>masterauth <%= scope['redis::masterauth'] %><% end -%> # When a slave loses the connection with the master, or when the replication # is still in progress, the slave can act in two different ways: @@ -190,7 +190,7 @@ dir <%= @workdir %> # an error "SYNC with master in progress" to all the kind of commands # but to INFO and SLAVEOF. # -slave-serve-stale-data <% if @slave_serve_stale_data -%>yes<% else -%>no<% end %> +slave-serve-stale-data <% if scope['redis::slave_serve_stale_data'] -%>yes<% else -%>no<% end %> # You can configure a slave instance to accept writes or not. Writing against # a slave instance may be useful to store some ephemeral data (because data @@ -206,7 +206,7 @@ slave-serve-stale-data <% if @slave_serve_stale_data -%>yes<% else -%>no<% end % # such as CONFIG, DEBUG, and so forth. To a limited extend you can improve # security of read only slaves using 'rename-command' to shadow all the # administrative / dangerous commands. -slave-read-only <% if @slave_read_only -%>yes<% else -%>no<% end %> +slave-read-only <% if scope['redis::slave_read_only'] -%>yes<% else -%>no<% end %> # Slaves send PINGs to server in a predefined interval. It's possible to change # this interval with the repl_ping_slave_period option. The default value is 10 @@ -221,7 +221,7 @@ slave-read-only <% if @slave_read_only -%>yes<% else -%>no<% end %> # specified for repl-ping-slave-period otherwise a timeout will be detected # every time there is low traffic between the master and the slave. # -repl-timeout <%= @repl_timeout %> +repl-timeout <%= scope['redis::repl_timeout'] %> # Disable TCP_NODELAY on the slave socket after SYNC? # @@ -236,7 +236,7 @@ repl-timeout <%= @repl_timeout %> # By default we optimize for low latency, but in very high traffic conditions # or when the master and slaves are many hops away, turning this to "yes" may # be a good idea. -repl-disable-tcp-nodelay <% if @repl_disable_tcp_nodelay -%>yes<% else -%>no<% end -%> +repl-disable-tcp-nodelay <% if scope['redis::repl_disable_tcp_nodelay'] -%>yes<% else -%>no<% end -%> # Set the replication backlog size. The backlog is a buffer that accumulates # slave data when slaves are disconnected for some time, so that when a slave @@ -249,7 +249,7 @@ repl-disable-tcp-nodelay <% if @repl_disable_tcp_nodelay -%>yes<% else -%>no<% e # # The backlog is only allocated once there is at least a slave connected. # -repl-backlog-size <%= @repl_backlog_size %> +repl-backlog-size <%= scope['redis::repl_backlog_size'] %> # After a master has no longer connected slaves for some time, the backlog # will be freed. The following option configures the amount of seconds that @@ -258,7 +258,7 @@ repl-backlog-size <%= @repl_backlog_size %> # # A value of 0 means to never release the backlog. # -repl-backlog-ttl <%= @repl_backlog_ttl %> +repl-backlog-ttl <%= scope['redis::repl_backlog_ttl'] %> # The slave priority is an integer number published by Redis in the INFO output. # It is used by Redis Sentinel in order to select a slave to promote into a @@ -273,7 +273,7 @@ repl-backlog-ttl <%= @repl_backlog_ttl %> # Redis Sentinel for promotion. # # By default the priority is 100. -slave-priority <%= @slave_priority %> +slave-priority <%= scope['redis::slave_priority'] %> # It is possible for a master to stop accepting writes if there are less than # N slaves connected, having a lag less or equal than M seconds. @@ -296,8 +296,8 @@ slave-priority <%= @slave_priority %> # # By default min-slaves-to-write is set to 0 (feature disabled) and # min-slaves-max-lag is set to 10. -min-slaves-to-write <%= @min_slaves_to_write %> -min-slaves-max-lag <%= @min_slaves_max_lag %> +min-slaves-to-write <%= scope['redis::min_slaves_to_write'] %> +min-slaves-max-lag <%= scope['redis::min_slaves_max_lag'] %> ################################## SECURITY ################################### @@ -312,7 +312,7 @@ min-slaves-max-lag <%= @min_slaves_max_lag %> # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # -<% if @requirepass -%>requirepass <%= @requirepass %><% end -%> +<% if scope['redis::requirepass'] -%>requirepass <%= scope['redis::requirepass'] %><% end -%> # Command renaming. # @@ -341,7 +341,7 @@ min-slaves-max-lag <%= @min_slaves_max_lag %> # Once the limit is reached Redis will close all the new connections sending # an error 'max number of clients reached'. # -maxclients <%= @maxclients %> +maxclients <%= scope['redis::maxclients'] %> # Don't use more memory than the specified amount of bytes. # When the memory limit is reached Redis will try to remove keys @@ -367,7 +367,7 @@ maxclients <%= @maxclients %> # output buffers (but this is not needed if the policy is 'noeviction'). # # maxmemory -<% if @maxmemory -%>maxmemory <%= @maxmemory %><% end -%> +<% if scope['redis::maxmemory'] -%>maxmemory <%= scope['redis::maxmemory'] %><% end -%> # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory # is reached? You can select among five behavior: @@ -391,7 +391,7 @@ maxclients <%= @maxclients %> # The default is: # # maxmemory-policy volatile-lru -<% if @maxmemory_policy -%>maxmemory-policy <%= @maxmemory_policy %><% end -%> +<% if scope['redis::maxmemory_policy'] -%>maxmemory-policy <%= scope['redis::maxmemory_policy'] %><% end -%> # LRU and minimal TTL algorithms are not precise algorithms but approximated # algorithms (in order to save memory), so you can select as well the sample @@ -400,7 +400,7 @@ maxclients <%= @maxclients %> # using the following configuration directive. # # maxmemory-samples 3 -<% if @maxmemory_samples -%>maxmemory-samples <%= @maxmemory_samples %><% end -%> +<% if scope['redis::maxmemory_samples'] -%>maxmemory-samples <%= scope['redis::maxmemory_samples'] %><% end -%> ############################## APPEND ONLY MODE ############################### @@ -422,10 +422,10 @@ maxclients <%= @maxclients %> # # Please check http://redis.io/topics/persistence for more information. -appendonly <% if @appendonly -%>yes<% else -%>no<% end -%> +appendonly <% if scope['redis::appendonly'] -%>yes<% else -%>no<% end -%> # The name of the append only file (default: "appendonly.aof") -appendfilename <%= @appendfilename %> +appendfilename <%= scope['redis::appendfilename'] %> # The fsync() call tells the Operating System to actually write data on disk # instead to wait for more data in the output buffer. Some OS will really flush @@ -450,7 +450,7 @@ appendfilename <%= @appendfilename %> # # If unsure, use "everysec". -appendfsync <%= @appendfsync %> +appendfsync <%= scope['redis::appendfsync'] %> # When the AOF fsync policy is set to always or everysec, and a background # saving process (a background save or AOF log background rewriting) is @@ -470,7 +470,7 @@ appendfsync <%= @appendfsync %> # # If you have latency problems turn this to "yes". Otherwise leave it as # "no" that is the safest pick from the point of view of durability. -no-appendfsync-on-rewrite <% if @no_appendfsync_on_rewrite -%>yes<% else -%>no<% end -%> +no-appendfsync-on-rewrite <% if scope['redis::no_appendfsync_on_rewrite'] -%>yes<% else -%>no<% end -%> # Automatic rewrite of the append only file. # Redis is able to automatically rewrite the log file implicitly calling @@ -489,8 +489,8 @@ no-appendfsync-on-rewrite <% if @no_appendfsync_on_rewrite -%>yes<% else -%>no<% # Specify a percentage of zero in order to disable the automatic AOF # rewrite feature. -auto-aof-rewrite-percentage <%= @auto_aof_rewrite_percentage %> -auto-aof-rewrite-min-size <%= @auto_aof_rewrite_min_size %> +auto-aof-rewrite-percentage <%= scope['redis::auto_aof_rewrite_percentage'] %> +auto-aof-rewrite-min-size <%= scope['redis::auto_aof_rewrite_min_size'] %> # An AOF file may be found to be truncated at the end during the Redis # startup process, when the AOF data gets loaded back into memory. @@ -514,7 +514,7 @@ auto-aof-rewrite-min-size <%= @auto_aof_rewrite_min_size %> # the server will still exit with an error. This option only applies when # Redis will try to read more data from the AOF file but not enough bytes # will be found. -aof-load-truncated <% if @aof_load_truncated -%>yes<% else -%>no<% end -%> +aof-load-truncated <% if scope['redis::aof_load_truncated'] -%>yes<% else -%>no<% end -%> ################################ LUA SCRIPTING ############################### @@ -552,11 +552,11 @@ lua-time-limit 5000 # The following time is expressed in microseconds, so 1000000 is equivalent # to one second. Note that a negative number disables the slow log, while # a value of zero forces the logging of every command. -slowlog-log-slower-than <%= @slowlog_log_slower_than %> +slowlog-log-slower-than <%= scope['redis::slowlog_log_slower_than'] %> # There is no limit to this length. Just be aware that it will consume memory. # You can reclaim memory used by the slow log with SLOWLOG RESET. -slowlog-max-len <%= @slowlog_max_len %> +slowlog-max-len <%= scope['redis::slowlog_max_len'] %> ################################ LATENCY MONITOR ############################## @@ -577,7 +577,7 @@ slowlog-max-len <%= @slowlog_max_len %> # impact, that while very small, can be measured under big load. Latency # monitoring can easily be enalbed at runtime using the command # "CONFIG SET latency-monitor-threshold " if needed. -latency-monitor-threshold <%= @latency_monitor_threshold %> +latency-monitor-threshold <%= scope['redis::latency_monitor_threshold'] %> ############################# Event notification ############################## @@ -623,34 +623,34 @@ latency-monitor-threshold <%= @latency_monitor_threshold %> # By default all notifications are disabled because most users don't need # this feature and the feature has some overhead. Note that if you don't # specify at least one of K or E, no events will be delivered. -notify-keyspace-events <% if @notify_keyspace_events -%><%= @notify_keyspace_events %><% else -%>""<% end -%> +notify-keyspace-events <% if scope['redis::notify_keyspace_events'] -%><%= scope['redis::notify_keyspace_events'] %><% else -%>""<% end -%> ############################### ADVANCED CONFIG ############################### # Hashes are encoded using a memory efficient data structure when they have a # small number of entries, and the biggest entry does not exceed a given # threshold. These thresholds can be configured using the following directives. -hash-max-ziplist-entries <%= @hash_max_ziplist_entries %> -hash-max-ziplist-value <%= @hash_max_ziplist_value %> +hash-max-ziplist-entries <%= scope['redis::hash_max_ziplist_entries'] %> +hash-max-ziplist-value <%= scope['redis::hash_max_ziplist_value'] %> # Similarly to hashes, small lists are also encoded in a special way in order # to save a lot of space. The special representation is only used when # you are under the following limits: -list-max-ziplist-entries <%= @list_max_ziplist_entries %> -list-max-ziplist-value <%= @list_max_ziplist_value %> +list-max-ziplist-entries <%= scope['redis::list_max_ziplist_entries'] %> +list-max-ziplist-value <%= scope['redis::list_max_ziplist_value'] %> # Sets have a special encoding in just one case: when a set is composed # of just strings that happens to be integers in radix 10 in the range # of 64 bit signed integers. # The following configuration setting sets the limit in the size of the # set in order to use this special memory saving encoding. -set-max-intset-entries <%= @set_max_intset_entries %> +set-max-intset-entries <%= scope['redis::set_max_intset_entries'] %> # Similarly to hashes and lists, sorted sets are also specially encoded in # order to save a lot of space. This encoding is only used when the length and # elements of a sorted set are below the following limits: -zset-max-ziplist-entries <%= @zset_max_ziplist_entries %> -zset-max-ziplist-value <%= @zset_max_ziplist_value %> +zset-max-ziplist-entries <%= scope['redis::zset_max_ziplist_entries'] %> +zset-max-ziplist-value <%= scope['redis::zset_max_ziplist_value'] %> # HyperLogLog sparse representation bytes limit. The limit includes the # 16 bytes header. When an HyperLogLog using the sparse representation crosses @@ -663,8 +663,8 @@ zset-max-ziplist-value <%= @zset_max_ziplist_value %> # the space efficient encoding without slowing down too much PFADD, # which is O(N) with the sparse encoding. The value can be raised to # ~ 10000 when CPU is not a concern, but space is, and the data set is -# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. -hll-sparse-max-bytes <%= @hll_sparse_max_bytes %> +# composed of many HyperLogLogs with cardinality in the 0'] - 15000 range. +hll-sparse-max-bytes <%= scope['redis::hll_sparse_max_bytes'] %> # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in # order to help rehashing the main Redis hash table (the one mapping top-level @@ -684,7 +684,7 @@ hll-sparse-max-bytes <%= @hll_sparse_max_bytes %> # # use "activerehashing yes" if you don't have such hard requirements but # want to free memory asap when possible. -activerehashing <% if @activerehashing -%>yes<% else -%>no<% end -%> +activerehashing <% if scope['redis::activerehashing'] -%>yes<% else -%>no<% end -%> # The client output buffer limits can be used to force disconnection of clients # that are not reading data from the server fast enough for some reason (a @@ -738,19 +738,19 @@ client-output-buffer-limit pubsub 32mb 8mb 60 # The range is between 1 and 500, however a value over 100 is usually not # a good idea. Most users should use the default of 10 and raise this up to # 100 only in environments where very low latency is required. -hz <%= @hz %> +hz <%= scope['redis::hz'] %> # When a child rewrites the AOF file, if the following option is enabled # the file will be fsync-ed every 32 MB of data generated. This is useful # in order to commit the file to the disk more incrementally and avoid # big latency spikes. -aof-rewrite-incremental-fsync <% if @aof_rewrite_incremental_fsync -%>yes<% else -%>no<% end -%> +aof-rewrite-incremental-fsync <% if scope['redis::aof_rewrite_incremental_fsync'] -%>yes<% else -%>no<% end -%> # Redis Cluster Settings -<% if @cluster_enabled -%> +<% if scope['redis::cluster_enabled'] -%> cluster-enabled yes -cluster-config-file <%= @cluster_config_file %> -cluster-node-timeout <%= @cluster_node_timeout %> +cluster-config-file <%= scope['redis::cluster_config_file'] %> +cluster-node-timeout <%= scope['redis::cluster_node_timeout'] %> <% end -%> @@ -763,6 +763,6 @@ cluster-node-timeout <%= @cluster_node_timeout %> # # include /path/to/local.conf # include /path/to/other.conf -<% if @extra_config_file -%> -include <%= @extra_config_file %> +<% if scope['redis::extra_config_file'] -%> +include <%= scope['redis::extra_config_file'] %> <% end -%>