{"action":"created","issue":{"url":"https://api.github.com/repos/arioch/puppet-redis/issues/113","repository_url":"https://api.github.com/repos/arioch/puppet-redis","labels_url":"https://api.github.com/repos/arioch/puppet-redis/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/arioch/puppet-redis/issues/113/comments","events_url":"https://api.github.com/repos/arioch/puppet-redis/issues/113/events","html_url":"https://github.com/arioch/puppet-redis/issues/113","id":178552106,"number":113,"title":"Support for multi-instances per host","user":{"login":"rhoml","id":369350,"avatar_url":"https://avatars.githubusercontent.com/u/369350?v=3","gravatar_id":"","url":"https://api.github.com/users/rhoml","html_url":"https://github.com/rhoml","followers_url":"https://api.github.com/users/rhoml/followers","following_url":"https://api.github.com/users/rhoml/following{/other_user}","gists_url":"https://api.github.com/users/rhoml/gists{/gist_id}","starred_url":"https://api.github.com/users/rhoml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhoml/subscriptions","organizations_url":"https://api.github.com/users/rhoml/orgs","repos_url":"https://api.github.com/users/rhoml/repos","events_url":"https://api.github.com/users/rhoml/events{/privacy}","received_events_url":"https://api.github.com/users/rhoml/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-09-22T08:38:26Z","updated_at":"2016-10-17T16:07:27Z","closed_at":null,"body":"It is a common practice to have more than one instance of redis per host. We should move the config.pp into a define type so we can create multiple instances pointing into different ports. \r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/arioch/puppet-redis/issues/comments/254252922","html_url":"https://github.com/arioch/puppet-redis/issues/113#issuecomment-254252922","issue_url":"https://api.github.com/repos/arioch/puppet-redis/issues/113","id":254252922,"user":{"login":"spo0nman","id":1265328,"avatar_url":"https://avatars.githubusercontent.com/u/1265328?v=3","gravatar_id":"","url":"https://api.github.com/users/spo0nman","html_url":"https://github.com/spo0nman","followers_url":"https://api.github.com/users/spo0nman/followers","following_url":"https://api.github.com/users/spo0nman/following{/other_user}","gists_url":"https://api.github.com/users/spo0nman/gists{/gist_id}","starred_url":"https://api.github.com/users/spo0nman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spo0nman/subscriptions","organizations_url":"https://api.github.com/users/spo0nman/orgs","repos_url":"https://api.github.com/users/spo0nman/repos","events_url":"https://api.github.com/users/spo0nman/events{/privacy}","received_events_url":"https://api.github.com/users/spo0nman/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T16:07:27Z","updated_at":"2016-10-17T16:07:27Z","body":"Hello!\r\n\r\nI 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.  \r\n\r\nI added a new variable called instances, this is expected to be a hash of the form: \r\n`$instances = { 'instance_name' = { \r\n                                                            'port' = 'portnumber'\r\n                                                            'maxmemory' ='maxmemory'\r\n                                                        }\r\n                       }\r\n`\r\nThe 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. \r\n\r\nfor multiple instances we need multiple redis-server processes, so i decided to decorate the process name with instance) name. \r\n\r\n`\r\n====================hieradata/redis.yaml\r\nredis::bind: 0.0.0.0\r\nredis::maxmemory: 2gb\r\nredis::config_dir: '/etc/redis/'\r\nredis::slaveof: 'redis-101'\r\nredis::sentinel::discover_master: true\r\nredis::sentinel::multiple_instances: true\r\nredis::sentinel::members:\r\n    - redis-101\r\n    - redis-102\r\n    - redis-104\r\nredis::instances:\r\n    instance_1:\r\n        port: 7000\r\n        maxmemory: 4gb\r\n    instance_2:\r\n        port: 7001\r\n    instance_3:\r\n        port: 7002\r\n====================\r\n`\r\nA 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. \r\n\r\n1. https://github.com/spo0nman/puppet-redis/commit/62ebea6e2effebe31be97eba80047d6f7f11eda2\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"spo0nman"}}