Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters not valid for older Redis in config #111

Closed
jskarpe opened this issue Sep 19, 2016 · 12 comments · Fixed by #189
Closed

Parameters not valid for older Redis in config #111

jskarpe opened this issue Sep 19, 2016 · 12 comments · Fixed by #189
Labels
bug Something isn't working

Comments

@jskarpe
Copy link

jskarpe commented Sep 19, 2016

Config from version 1.2.3 doesn't start Redis service successfully anymore

@flyinbutrs
Copy link

Second this, had to revert to 1.2.2.

On ubuntu 14.04:

# redis-server --version
Redis server v=2.8.4 sha=00000000:0 malloc=jemalloc-3.4.1 bits=64 build=a44a05d76f06a5d9
# service redis-server start
Starting redis-server:
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 33
>>> 'tcp-backlog 0'
Bad directive or wrong number of arguments
failed

@MWilkinson
Copy link

Same issue here...
It appears that the template file to create the redis.conf has been upgraded to support features only in redis 3.x and doesn't cater for installs like Ubuntu 14.04/redis 2.8.4

@flyinbutrs
Copy link

It should check what version of redis is running and setup the conf file accordingly.

@petems
Copy link
Member

petems commented Oct 14, 2016

@flyinbutrs Can you give a list of which parameters are specific to v2 vs v3 of redis? Is it just tcp-backlog?

@petems petems changed the title Pushing new version without successful Travis? Parameters not valid for older Redis in config Oct 14, 2016
@petems
Copy link
Member

petems commented Nov 30, 2016

#136 is part of the full solution for this (see my blog post about the final pattern: https://petersouter.co.uk/puppet-pattern-version-specific/)

@codylane
Copy link
Contributor

codylane commented Nov 30, 2016

FWIW - I ran into this today as well while testing EPEL provided redis on CentOS 6 where tcp-backlog doesnt' work with redis 2.4.10 (which comes from EPEL). However, newer versions of redis are avaiable via the REMI repo and that is most likely what my team will be using.

If I read the Redis documentation correctly I believe redis 2.8.x supports the tcp-backlog param which might be the minimum version as specified in @petems PR.

I'm not going to lie, I'm no way a Redis expert, just a humble puppet guy trying to help others.

@flyinbutrs
Copy link

Ok, I figured it out... This is the commit that changed the parameter from backlog to tcp-backlog:

redis/redis@917b851

cloned the repo and described:

$ git describe 917b851491415466368430dd2b450ce431c88081
2.8.4-11-g917b851

So if redis version is >2.8.4, the parameter it tcp-backlog, if <=2.8.4, use backlog.

@petems
Copy link
Member

petems commented Dec 6, 2016

Yes, I'm working on a fix to detect the version in #145

In the mean time, you can either use the older version or fork and make a change to that template manually

@nvtkaszpir
Copy link

any progress on this?

@petems
Copy link
Member

petems commented Apr 13, 2017

Turns out neither work with the version available in Ubuntu:

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 258
>>> 'backlog 511'
Bad directive or wrong number of arguments
root@271ac462d565:/# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty
root@271ac462d565:/# redis-server --version
Redis server v=2.8.4 sha=00000000:0 malloc=jemalloc-3.4.1 bits=64 build=a44a05d76f06a5d9

So I'm just going to put a "Must be newer than 2.8.5" around that logic

@petems
Copy link
Member

petems commented Apr 13, 2017

@nvtkaszpir I've got a working version for CentOS 6, is that the one you've been having issues with? Should have a PR soon

@nvtkaszpir
Copy link

nvtkaszpir commented Apr 13, 2017

I switched to Centos 7.3 and bumped redis to 2.8.21 using openstack-kilo repo.
Without it centos was installing older redis version and puppet module was generating incompatible config for redis. The issue is actually caused by redis itself, because they introduced config changes between patch versions, and puppet module was not designed to fully support this (no wonder, incresing number of 'ifology'.
Fortunately using yum versionlock I've mitigated that issue (and also that is possible under Ubuntu/Debian by using apt::pin)

For Centos 7 openstack-kilo provides two builds for redis 2.8:
http://mirror.centos.org/centos/7/cloud/x86_64/openstack-kilo/common/
there is:

  • redis-2.8.19-2.el7.x86_64.rpm
  • redis-2.8.21-1.el7.x86_64.rpm

I was also using Debian.Ubuntu but switched to Centos 7.3.
Knowing that redis 3.x is a superset of redis 2.8 I'm rahter going to move to redis 3.2 in the future.

Example code used now, with different hiera I'm also able to install redis 3.2.x if needed (but then using remi repo, and I have never tried to migrate 2.8 to 3.2 with that setup, better set up new vm)

minimal puppet manifest for centos 7.3, compatible with both redis versions:

node default {

  include ::redis
  include ::firewall

  case $::osfamily {


    'Redhat': {

      include ::yum
      create_resources(yumrepo, hiera('yumrepo', {}))
      create_resources(yum::plugin, hiera('yum::plugin', {}))
      create_resources(yum::gpgkey, hiera('yum::gpgkey', {}))
      create_resources(yum::versionlock, hiera('yum::versionlock', {}))

      Yum::Gpgkey <||> -> Yumrepo <||>
      Yum::Versionlock <||> -> Package<| provider == 'yum' |>
      Yumrepo <||> -> Class['redis::install']
      Yum::Versionlock <||> -> Class['redis::install']
    }

    default: {
      fail ("Operating system ${::operatingsystem} is not supported yet.")
    }
  }

}

hiera for redis 2.8.21 on centos 7.3:

---
# redis 2.8
# watch out for older redis versions, puppet module is not compatible with them

# centos 7.3

# redis 2.8 requires packages in repo openstack-kilo
yumrepo:
  'openstack-kilo':
    baseurl: 'http://mirror.centos.org/centos/$releasever/cloud/$basearch/openstack-kilo/'
    descr: 'openstack-kilo'
    enabled: 1
    gpgcheck: true

yum::gpgkey:
  '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud':
    ensure: 'present'
    content: |
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      Version: GnuPG v2.0.22 (GNU/Linux)

      mQENBFVWcCcBCACfm3eQ0526/I0/p7HpR0NjK7K307XHhnbcbZv1sDUjQABDaqh0
      N4gnZcovf+3fj6pcdOmeOpGI0cKE7Fh68RbEIqyjB7l7+j1grjewR0oCFFZ38KGm
      j+DWQrj1IJW7JU5fH/G0Cu66ix+dJPcuTB3PJTqXN3ce+4TuG09D+epgwfbHlqaT
      pH2qHCu2uiGj/AaRSM/ZZzcInMaeleHSB+NChvaQ0W/m+kK5d/20d7sfkaTfI/pY
      SrodCfVTYxfKAd0TLW03kimHs5/Rdz+iZWecVKv6aFxzaywbrOjmOsy2q0kEWIwX
      MTZrq6cBRRuWyiXsI2zT2YHQ4UK44IxINiaJABEBAAG0WkNlbnRPUyBDbG91ZCBT
      SUcgKGh0dHA6Ly93aWtpLmNlbnRvcy5vcmcvU3BlY2lhbEludGVyZXN0R3JvdXAv
      Q2xvdWQpIDxzZWN1cml0eUBjZW50b3Mub3JnPokBOQQTAQIAIwUCVVZwJwIbAwcL
      CQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEPm5/ud2RCnmATUH/3HDtWxpFkmy
      FiA3VGkMt5dp3bgCRSd84X6Orfx1LARowpI4LomCGglGBGXVJePBacwcclorbLaz
      uWrW/wU0efz0aDB5c4NPg/yXfNvujvlda8ADJwZXVBQphzvaIKwl4PqBsEnxC10I
      93T/0iyphAhfMRJ5R8AbEHMj7uF+TWTX/JoyQagllMqWTwoP4DFRutPdOmmjwvSV
      kWItH7hq6z9+M4dhlqeoOvPbL5oCxX7TVmLck02Q5gI4syULOa7sqntzUQKFkhWp
      9U0+5KrBQBKezrurrrkq/WZR3WNE1KQfNQ77f7S2JcXJdOaKgJ7xe7Y2flPq98Aq
      wKXK7l1c3dc=
      =W6yF
      -----END PGP PUBLIC KEY BLOCK-----

# install specific redis version on centos
yum::versionlock:
  '0:redis-2.8.21-1.el7.x86_64':
    ensure: 'present'

redis::manage_repo: false # needed to use packages from openstack-kilo
redis::unixsocket: false # required to disable socket creation
redis::bind: '0.0.0.0'

redis::maxmemory: '1gb'
redis::syslog_enabled: true
redis::tcp_keepalive: 60
redis::timeout: 3600
redis::appendonly: true

# centos 7.x compatible
redis::config_owner: 'redis'
redis::config_group: 'root'

firewall:
  '100 allow redis access from local networks':
    source: '10.0.0.0/8'
    dport: 6379
    proto: 'tcp'
    action: 'accept'

hiera for redis 3.2. on centos 7.3:

---
# redis 3 is a superset of redis 2.8
# centos 7.3

# redis 3.2 requires remi repo and `redis::manage_repo: true`
yumrepo:
  'remi':
    mirrorlist: 'http://rpms.remirepo.net/enterprise/$releasever/remi/mirror'
    descr: 'remi'
    enabled: 1
    gpgcheck: true
    gpgkey: 'http://rpms.remirepo.net/RPM-GPG-KEY-remi'

# install specific redis version on Centos
yum::versionlock:
  '0:redis-3.2.8-1.el7.remi.x86_64':
    ensure: 'present'

redis::manage_repo: true
redis::unixsocket: false # required to disable socket creation
redis::bind: '0.0.0.0'

redis::maxmemory: '1gb'
redis::syslog_enabled: true
redis::tcp_keepalive: 60
redis::timeout: 3600
redis::appendonly: true

# centos 7.x compatible
redis::config_owner: 'redis'
redis::config_group: 'root'

firewall:
  '100 allow redis access from local networks':
    source: '10.0.0.0/8'
    dport: 6379
    proto: 'tcp'
    action: 'accept'

petems added a commit to petems/puppet-redis that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
petems added a commit to petems/puppet-redis that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
petems added a commit to petems/puppet-redis that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
petems added a commit to petems/puppet-redis that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
petems added a commit to petems/puppet-redis that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
petems added a commit that referenced this issue May 3, 2017
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See #111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
@petems petems added the bug Something isn't working label May 11, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-redis that referenced this issue Feb 16, 2021
* We say we support 1404, but aren't testing
* But 1404 has an older package, and certain 
config settings aren't present (See voxpupuli#111)
* Add 2.8.X config file and logic to fix that
* Add to CI, add docker and vagrant SUTs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants