mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Redis replica migration.
This commit is contained in:
parent
4b219cadca
commit
c0b17d9e11
3 changed files with 9 additions and 5 deletions
|
@ -6,9 +6,13 @@
|
|||
- ../env_vars/base.yml
|
||||
|
||||
tasks:
|
||||
- name: Extract part of hostname to determine container name
|
||||
set_fact:
|
||||
redis_role: "{{ inventory_hostname.split('-')[2] }}"
|
||||
|
||||
- name: Turning off secondary for redis by deleting redis_replica.conf
|
||||
copy:
|
||||
dest: /srv/newsblur/docker/redis/redis_replica.conf
|
||||
dest: "/srv/newsblur/docker/redis/redis_{{ redis_role }}_replica.conf"
|
||||
content: ""
|
||||
tags:
|
||||
- never
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
when: redis_secondary
|
||||
|
||||
- name: Remove redis_replica.conf file if not secondary
|
||||
file:
|
||||
path: "/srv/newsblur/docker/redis/redis_{{ redis_role }}_replica.conf"
|
||||
state: absent
|
||||
copy:
|
||||
dest: "/srv/newsblur/docker/redis/redis_{{ redis_role }}_replica.conf"
|
||||
content: ""
|
||||
when: not redis_secondary
|
||||
|
||||
- name: Create Redis docker volume directory
|
||||
|
|
|
@ -27,7 +27,7 @@ aps -l hdb-redis-user-1,hdb-redis-user-2 -t redis
|
|||
aps -l hdb-redis-session-1,hdb-redis-session-2 -t redis
|
||||
aps -l hdb-redis-story-1,hdb-redis-story-2 -t redis
|
||||
aps -l hdb-redis-pubsub -t redis
|
||||
# Go into each redis and `SLAVEOF NO ONE`
|
||||
apd -l hdb-redis-user-1,hdb-redis-session-1,hdb-redis-story-1,hdb-redis-pubsub -t replicaofnoone
|
||||
|
||||
# Elasticsearch
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue