geerlingguy / ansible-role-redis

Ansible Role - Redis
https://galaxy.ansible.com/geerlingguy/redis/
MIT License
254 stars 197 forks source link

redis 6.2.1 Failed with result 'protocol' #59

Closed svitru closed 3 years ago

svitru commented 3 years ago

redis 6.2.1 Failed with result 'protocol' Fixed after adding "supervised auto" to templates/redis.conf.j2

OS VERSION="20.04.2 LTS (Focal Fossa)"

pre_tasks:

nicovs commented 3 years ago

as from: https://github.com/redis/redis/blob/unstable/redis.conf#L249-L265 (vs the v5 config: https://github.com/redis/redis/blob/5.0/redis.conf#L138-L147)

There is a need to uncomment (or add an include file via the var: redis_includes, check the Readme with content supervised auto

# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
#   supervised no      - no supervision interaction
#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
#                        requires "expect stop" in your upstart job config
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#                        on startup, and updating Redis status on a regular
#                        basis.
#   supervised auto    - detect upstart or systemd method based on
#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
#       They do not enable continuous pings back to your supervisor.
#
# The default is "no". To run under upstart/systemd, you can simply uncomment
# the line below:
#
# supervised auto
stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 3 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

StanBright commented 3 years ago

Can we reopen this? I was just bitten by this :/

smutel commented 1 year ago

Same issue, any workaround ?

smutel commented 1 year ago

As a workaround:

daemonize no
supervised auto
nicovs commented 1 year ago

I do it like this: Setup a host or group var on your redis_servers group

redis_include: |
  supervised auto

Add this to your playbook:

- name: create redis folder
  file:
    path: /etc/redis
    state: directory

- set_fact:
    redis_includes: [ '/etc/redis/redis_include.conf' ]
  when: redis_include is defined

- name: Redis Include extra options
  template: 
    src: "{{ playbook_dir }}/templates/redis/redis_include.conf.j2"
    dest: /etc/redis/redis_include.conf
    owner: redis
    group: redis
    mode: 0640
  notify: 
    - restart redis
  when: redis_include is defined

- import_role:
    name: geerlingguy.redis

and a template in: templates/redis/redis_include.conf.j2

{{ ansible_managed | comment }}

{{ redis_include }}
bellackn commented 3 weeks ago

This should be reopened, it's still a problem with Redis 7.4.1.

An even simpler workaround:

redis_extra_config: |-
  supervised auto