项目作者: dockpack

项目描述 :
Ansible role to install Redis5 Sentinel on-prem from SCL on RedHat/Centos 7
高级语言: Jinja
项目地址: git://github.com/dockpack/base_redis.git
创建时间: 2020-03-11T22:44:01Z
项目社区:https://github.com/dockpack/base_redis

开源协议:

下载


base_redis

Ansible-role to install Redis5 Sentinel on Centos/RHEL 7 (using Satellite).
This role has been developed to cater analytics of a high-volume website with Matomo. We use Redis hosts with 64Gb to cache the event queues before processing into MariaDB.

Requirements

Yum with Software Collections, this role has been developed for on-prem use.

Role Variables

See defaults/main.yml

Dependencies

In your inventory define hosts like:

  1. [redis_master]
  2. node0.example.com
  3. [redis_slave]
  4. node1.example.com
  5. node2.example.com
  6. [redis_sentinel]
  7. node0.example.com
  8. node1.example.com
  9. node2.example.com

Example Playbook

  1. ---
  2. # Install Redis Sentinel on 3 RHEL7 VMs
  3. - name: Discover Redis master
  4. hosts: redis_server
  5. become: true
  6. roles:
  7. - {role: base_redis, tags: master, slave}
  8. - name: Install Redis master
  9. hosts: redis_leader
  10. become: true
  11. vars:
  12. redis_server: true
  13. roles:
  14. - {role: base_redis, tags: master}
  15. - name: Install Redis slaves
  16. hosts: redis_server
  17. become: true
  18. vars:
  19. redis_server: true
  20. roles:
  21. - {role: base_redis, tags: slave}
  22. - name: Configure Redis sentinel nodes
  23. hosts: redis_sentinel
  24. become: true
  25. vars:
  26. redis_sentinel: true
  27. redis_sentinel_monitors:
  28. - name: mymaster
  29. # host: "{{ groups.redis_master[0] }}"
  30. host: "{{ master_hostname }}"
  31. port: "{{ redis_host }}"
  32. quorum: "{{ groups.redis_server|length -1 }}"
  33. roles:
  34. - {role: base_redis, tags: sentinel}

License

MIT

Author Information

@bbaassssiiee