daily pastebin goal
60%
SHARE
TWEET

Reddit Open Source - Misc Admin stuff

a guest Mar 24th, 2018 29 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set / change the default subs for guests (errors if not set):
  2.  
  3.     cd ~/src/reddit/r2
  4.     paster shell run.ini
  5.     # in paster paste the following, hit enter:
  6.  
  7.     from r2.models import *
  8.     srs = [Subreddit._by_name(n) for n in ("saidit", "pics", "videos", "worldnews", "science", "technology", "funny", "music", "gifs", "musicvideos")]
  9.     LocalizedDefaultSubreddits.set_global_srs(srs)
  10.     LocalizedFeaturedSubreddits.set_global_srs([Subreddit._by_name('pics')])
  11.     exit()
  12.  
  13.  
  14. Backing up:
  15.  
  16. Backing Up
  17. ------------------
  18. postgres:
  19.  
  20.     pg_dump -U reddit reddit > ~/backup-offsite/`date +\%Y\%m\%d`-reddit.sql
  21.  
  22. cassandra:
  23.  
  24. as user 'reddit':
  25.    
  26.     nodetool snapshot
  27.     mkdir ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
  28.     sudo cp -r /var/lib/cassandra/data/reddit ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
  29.     sudo chown -R reddit:reddit ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
  30.     zip -r ~/backup-offsite/`date +\%Y\%m\%d`-cassandra.zip ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
  31.  
  32. misc configs:
  33.  
  34.     cp ~/src/reddit/r2/development.update ~/backup-offsite/`date +\%Y\%m\%d`-development.update
  35.     sudo cp /etc/cron.d/reddit ~/backup-offsite/`date +\%Y\%m\%d`-crond-reddit
  36.  
  37. ## Troubleshooting
  38.  
  39. * 503 Service Unavailable "No server is available to handle this request"
  40.   * just wait, the db has reached max connections because reddit-restart ran and the cron jobs all ran at once and users are hitting the site
  41.   * top shows 5+ 'paster' jobs running at once
  42.   * load calms down in 1-2 minutes
  43. * Search not working `sudo service tomcat7 restart`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top