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!
- Set / change the default subs for guests (errors if not set):
- cd ~/src/reddit/r2
- paster shell run.ini
- # in paster paste the following, hit enter:
- from r2.models import *
- srs = [Subreddit._by_name(n) for n in ("saidit", "pics", "videos", "worldnews", "science", "technology", "funny", "music", "gifs", "musicvideos")]
- LocalizedDefaultSubreddits.set_global_srs(srs)
- LocalizedFeaturedSubreddits.set_global_srs([Subreddit._by_name('pics')])
- exit()
- Backing up:
- Backing Up
- ------------------
- postgres:
- pg_dump -U reddit reddit > ~/backup-offsite/`date +\%Y\%m\%d`-reddit.sql
- cassandra:
- as user 'reddit':
- nodetool snapshot
- mkdir ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
- sudo cp -r /var/lib/cassandra/data/reddit ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
- sudo chown -R reddit:reddit ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
- zip -r ~/backup-offsite/`date +\%Y\%m\%d`-cassandra.zip ~/backup-offsite/`date +\%Y\%m\%d`-cassandra
- misc configs:
- cp ~/src/reddit/r2/development.update ~/backup-offsite/`date +\%Y\%m\%d`-development.update
- sudo cp /etc/cron.d/reddit ~/backup-offsite/`date +\%Y\%m\%d`-crond-reddit
- ## Troubleshooting
- * 503 Service Unavailable "No server is available to handle this request"
- * 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
- * top shows 5+ 'paster' jobs running at once
- * load calms down in 1-2 minutes
- * 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.
