Comments (18)
Hello!
I have pushed[1] my changes to my fork. It is a large change, I took the idea of @arioch and created a define called redis::instance, which is called multiple times from redis::config.
I added a new variable called instances, this is expected to be a hash of the form:
$instances = {
'instance_1' ={
'port' = 'portnumber',
'maxmemory' ='maxmemory'
},
'instance_2' ={
'port' = 'portnumber',
'maxmemory' ='maxmemory'
}
}
The defile allows us to 'overload' common redis::variables for all the instances and 'import' sane defaults from params.pp. It also allows us to overload defaults for all the instances on a host for example redis::maxmemory: is default 2gb for the host but is increased in instance_1. The commit has a lot more details.
for multiple instances we need multiple redis-server processes, so i decided to decorate the process name with instance) name.
hieradata/redis.yaml
redis::bind: 0.0.0.0
redis::maxmemory: 2gb
redis::config_dir: '/etc/redis/'
redis::slaveof: 'redis-101'
redis::sentinel::discover_master: true
redis::sentinel::multiple_instances: true
redis::sentinel::members:
- redis-101
- redis-102
- redis-104
redis::instances:
instance_1:
port: 7000
maxmemory: 4gb
instance_2:
port: 7001
instance_3:
port: 7002
A somewhat related but maybe unrelated feature in the commit is the sentinel_discover: since sentinel is not configured alone, we can use sentinel::discover_master flag to ask the "members" about an instance master. discover_master is set to false by default, in that case redis_host is used. (if you guys feel this is not good, we can take it out, but I use this in my infra and find it very useful.) more details on this in the commit comment.
from puppet-redis.
Yes! I support this. I am actually in the process of hacking this into the module. maybe we can collaborate.
from puppet-redis.
Absolutely, maybe rolling out small changes into a dev branch?
Sent from my iPhone
On 22 Sep. 2016, at 21:45, Pankaj [email protected] wrote:
Yes! I support this. I am actually in the process of hacking this into the module. maybe we can collaborate.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from puppet-redis.
@rhoml do you have a branch already that i can chekout?
from puppet-redis.
I'd prefer having an $instance parameter in the main class which the config class could read, parse and deploy using a resource defined type.
Pseudo code:
class redis (
$instance = {},
) {
}
class redis::config {
create_resources(::redis::instance, $::redis::instance, {})
}
define redis::instance (
$instance_name,
$instance_config_dir,
$instance_config_file,
$instance_ip,
$instance_port,
) {
}
(Update) Or even:
define redis::instance (
$name,
$config_dir,
$config_file,
$options = {
$ip => undef,
$port => undef,
$max_mem => undef,
}
) {
}
from puppet-redis.
@spo0nman No I don't have any working branch atm, been busy.
@arioch yeah, I'd like to see something similar to elastic/puppet-elasticsearch https://github.com/elastic/puppet-elasticsearch/blob/master/manifests/instance.pp
from puppet-redis.
@arioch how would we make sure that all the instances are individually configurable? e.g if redis::config is the top layer, and multiple instances on a single host will need instance specific overrides for max_memory etc.
from puppet-redis.
@spo0nman by using redis::config
for its original purpose: to configure generic stuff in /etc/redis
.
Instances could have their own directory structure, f.i. /opt/redis/instance_1
managed by redis::instance
.
from puppet-redis.
@arioch the updated one looks good. let me write something around this idea.
from puppet-redis.
Hi,
small update: I have a decent working version now with these changes. I had to make a few changes to accomplish this. I have a rather large patch, I'll commit it to my fork for your review tomorrow.
from puppet-redis.
@spo0nman Hey, @arioch has added me to the repo to help with maintenance, I look forward to your PR! 👍
from puppet-redis.
@petems I am currently struggling with sparklemotion/nokogiri#1445 and could not run the rake tests on my changes. As soon as I have rake running. I will run the tests.
from puppet-redis.
from puppet-redis.
Hi @spo0nman! I'm looking over your changes, I think some would change the intentions of this module and what falls under it's scope, but others I think could be broken up into individual features that could be merged. I should have some cycles to look through stuff in december, hopefully I can merge it for you then! 👍
from puppet-redis.
@petems sounds good. Let's sync up in December and I can separate out the unnecessary.
from puppet-redis.
This is now merged as part of #200
class { '::redis':
default_install => false,
}
redis::instance {'redis1':
port => '7777',
}
redis::instance {'redis2':
port => '8888',
}
Ta-dah! 😄
from puppet-redis.
Is there a way to do this?:
redis::instance { '::redis':
default_install => false,
}
redis::instance {'redis1':
port => '7777',
}
redis::instance {'redis2':
port => '8888',
}
Using this style we are getting error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Could not find template '' at /etc/puppetlabs/code/environments/development/modules/redis/manifests/instance.pp:294:46
from puppet-redis.
@demueller that should just be:
class { '::redis':
default_install => false,
}
redis::instance {'redis1':
port => '7777',
}
redis::instance {'redis2':
port => '8888',
}
from puppet-redis.
Related Issues (20)
- Rediscluster on Ubuntu 20.04
- Ability to disable slowlog_log_slower_than
- redis.conf is readable by all HOT 2
- Systemd service stop issues with redis instances HOT 2
- Single instance systemd service won't start on Arch Linux HOT 3
- Systemd module is deprecated HOT 2
- ACL support is missing HOT 8
- redis installation on ubuntu 22.04 fails because /var/run/redis directory doesn't exists.
- Support deferred values for requirepass HOT 1
- save_db_to_disk = false does not work HOT 2
- `rdb_save_incremental_fsync` cannot be turned off
- Error when deploying a redis instance HOT 1
- The parameter '$slowlog_log_slower_than' must be a literal type, not a Puppet::Pops::Model::AccessExpression HOT 2
- logging into stdout is not supported HOT 1
- Use of deferred function fails due to complex types in epp HOT 2
- systemd::servicelimits is deprecated, use systemd::manage_dropin
- [10.0.0] last puppet-systemd not supported HOT 7
- Sensitive Data
- Support for Redis v6+ ACL auth HOT 3
- Missing Redis 7 Features as Class Options
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-redis.