mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding second redis story db.
This commit is contained in:
parent
27c6612d1b
commit
5ce751b0f2
5 changed files with 16 additions and 9 deletions
|
@ -133,10 +133,16 @@ You got the downtime message either through email or SMS. This is the order of o
|
|||
When the new redis server is connected to the primary redis server:
|
||||
|
||||
# db-redis-story2 = moving to new server
|
||||
# db-redis-story = old server about to be shutdown
|
||||
# db-redis-story1 = old server about to be shutdown
|
||||
# Edit digitalocean.tf to change db-redis-story count to 2
|
||||
make plan
|
||||
make apply
|
||||
make firewall
|
||||
# Wait for redis to sync, takes 5-10 minutes
|
||||
# Edit redis/consul_service.json to switch primary to db-redis-story2
|
||||
make celery_stop
|
||||
make maintenance_on
|
||||
apd -l db-redis-story2 -t replicaofnoone
|
||||
aps -l db-redis-story,db-redis-story2 -t consul
|
||||
aps -l db-redis-story1,db-redis-story2 -t consul
|
||||
make maintenance_off
|
||||
make task
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"service": {
|
||||
{% if inventory_hostname in ["db-redis-user", "db-redis-story1", "db-redis-session", "db-redis-pubsub"] %}
|
||||
{% if inventory_hostname in ["db-redis-user", "db-redis-story2", "db-redis-session", "db-redis-pubsub"] %}
|
||||
"name": "{{ inventory_hostname|regex_replace('\d+', '') }}",
|
||||
{% else %}
|
||||
"name": "{{ inventory_hostname|regex_replace('\d+', '') }}-staging",
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<img src="/media/img/logo_512.png" class="logo">
|
||||
<h1>NewsBlur is in <span class="error404">maintenance mode</span></h1>
|
||||
<div class="description">
|
||||
<p>Moving to a larger Redis story DB, since the existing DB is buckling under the new load from the requirements of the new NewsBlur Premium Archive subscription.</p>
|
||||
<p>Moving to another Redis story DB, since the existing DB is having some issues. Check the daily load time graph to see how it's had an impact. Always good to do this, expect fast load times after this.</p>
|
||||
<p>To pass the time, <a href="http://mltshp.com/popular">check out what's popular on MLTSHP</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -380,11 +380,11 @@ resource "digitalocean_droplet" "db-redis-sessions" {
|
|||
}
|
||||
|
||||
resource "digitalocean_droplet" "db-redis-story" {
|
||||
count = 1
|
||||
count = 2
|
||||
image = var.droplet_os
|
||||
name = "db-redis-story${count.index+1}"
|
||||
region = var.droplet_region
|
||||
size = contains([1], count.index) ? "m-8vcpu-64gb" : var.redis_story_droplet_size
|
||||
size = contains([0], count.index) ? "m-8vcpu-64gb" : var.redis_story_droplet_size
|
||||
ssh_keys = [digitalocean_ssh_key.default.fingerprint]
|
||||
provisioner "local-exec" {
|
||||
command = "/srv/newsblur/ansible/utils/generate_inventory.py; sleep 120"
|
||||
|
@ -466,12 +466,13 @@ resource "digitalocean_droplet" "db-postgres" {
|
|||
# servers=$(for i in {1..9}; do echo -n "-target=\"digitalocean_droplet.db-mongo-primary[$i]\" " ; done); tf plan -refresh=false `eval echo $servers`
|
||||
#
|
||||
resource "digitalocean_droplet" "db-mongo-primary" {
|
||||
count = 1
|
||||
count = 2
|
||||
backups = contains([0], count.index) ? false : true
|
||||
image = var.droplet_os
|
||||
name = "db-mongo-primary${count.index+1}"
|
||||
region = var.droplet_region
|
||||
size = contains([1], count.index) ? "m3-8vcpu-64gb" : var.mongo_primary_droplet_size
|
||||
# size = contains([1], count.index) ? "m3-8vcpu-64gb" : var.mongo_primary_droplet_size
|
||||
size = var.mongo_primary_droplet_size
|
||||
ssh_keys = [digitalocean_ssh_key.default.fingerprint]
|
||||
provisioner "local-exec" {
|
||||
command = "/srv/newsblur/ansible/utils/generate_inventory.py; sleep 120"
|
||||
|
|
|
@ -89,5 +89,5 @@ variable "elasticsearch_droplet_size" {
|
|||
|
||||
variable "redis_story_droplet_size" {
|
||||
type = string
|
||||
default = "m-8vcpu-64gb"
|
||||
default = "m-4vcpu-32gb"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue