fewbytes-cookbooks / redis2

Chef cookbook to install/configure redis instances
Apache License 2.0
2 stars 5 forks source link

Can't override default instance attributes #7

Closed szymonpk closed 9 years ago

szymonpk commented 9 years ago

Code I've used

node.set.redis2.instances.prime.vm.max_memory = '512mb'
node.set.redis2.instances.prime.maxmemory_policy = 'allkeys-lru'

include_recipe 'redis2::default_instance'

Result

# grep 512 /etc/redis/redis_prime.conf
list-max-ziplist-entries 512
set-max-intset-entries 512

I've also tried overwrite with node.default, doesn't work either.

nukemberg commented 9 years ago

these values are hardcoded in the template. We should probably move these to attributes

szymonpk commented 9 years ago

Erm... sorry you got this wrong. I'm trying to set max_memory to 512 and only 512 values I've found were these two default mentioned above.

# grep maxmemory /etc/redis/redis_prime.conf
# WARNING: maxmemory can be a good idea mainly if you want to use Redis as a
# to upgrade. With maxmemory after the limit is reached you'll start to get
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# maxmemory-samples 3

My max_memory override isn't applied.

szymonpk commented 9 years ago

Forget about this issue, I've used wrong keys. With these two below everything works fine:

node.set.redis2.instances.prime.maxmemory = '512mb'
node.set.redis2.instances.prime.maxmemory_policy = 'allkeys-lru'

It just wasn't documented.