Giter VIP home page Giter VIP logo

Comments (18)

spo0nman avatar spo0nman commented on June 23, 2024 1

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.

  1. spo0nman@62ebea6

from puppet-redis.

spo0nman avatar spo0nman commented on June 23, 2024

Yes! I support this. I am actually in the process of hacking this into the module. maybe we can collaborate.

from puppet-redis.

rhoml avatar rhoml commented on June 23, 2024

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.

spo0nman avatar spo0nman commented on June 23, 2024

@rhoml do you have a branch already that i can chekout?

from puppet-redis.

arioch avatar arioch commented on June 23, 2024

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.

rhoml avatar rhoml commented on June 23, 2024

@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.

spo0nman avatar spo0nman commented on June 23, 2024

@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.

arioch avatar arioch commented on June 23, 2024

@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.

spo0nman avatar spo0nman commented on June 23, 2024

@arioch the updated one looks good. let me write something around this idea.

from puppet-redis.

spo0nman avatar spo0nman commented on June 23, 2024

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.

petems avatar petems commented on June 23, 2024

@spo0nman Hey, @arioch has added me to the repo to help with maintenance, I look forward to your PR! 👍

from puppet-redis.

spo0nman avatar spo0nman commented on June 23, 2024

@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.

spo0nman avatar spo0nman commented on June 23, 2024

#128

#129

from puppet-redis.

petems avatar petems commented on June 23, 2024

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.

spo0nman avatar spo0nman commented on June 23, 2024

@petems sounds good. Let's sync up in December and I can separate out the unnecessary.

from puppet-redis.

petems avatar petems commented on June 23, 2024

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.

demueller avatar demueller commented on June 23, 2024

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.

petems avatar petems commented on June 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.