DATABASE SETUP
1) Download this: postgresapp.com/ 2) brew install postgresql 3) bundle install 4) psql postgres 5) CREATE USER notistapp; 6) ALTER ROLE notistapp CREATEDB; 7) \q 8) bundle exec rake db:create:all 9) bundle exec rake db:migrate
DOCUMENT CONVERSION WORKER
1) Open ‘config/application_settings.yml’ in the current project:
- Replace the value of 'sqs_pdf_conversion_queue_name' (under development)
to one of the following:
- document_conversion_queue_vlad
- document_conversion_queue_matt
- document_conversion_queue_piyush
- document_conversion_queue_josh
2) Check out this project: bitbucket.org/leevlad/thenotist-node
Follow instructions in the README.rdoc of that project
NOTE: make sure to specify the right database to write to from database.yml
(default *SHOULD* work)
USEFUL COMMANDS
-
DB Debugging: ‘rails dbconsole’
DEPLOYMENTS
-
cap rubber:create_staging
-
cap rubber:bootstrap
-
cap deploy:cold – migrations
-
cap rubber:tail_logs
-
cap -T rubber
For NGINX/Passenger:
-
bundle –without development test –deployment
-
nginx -t
MONITORING
For realtime performance monitoring:
-
If this is your first-time setup: gem install scout_realtime
-
Now, do the following: > scout_realtime start
Daemon has started successfully To view in your browser, do ONE of the following: A) create an SSH tunnel: ssh -NL 5555:localhost:5555 user@ip_or_hostname (run that command on your own computer, not the server) then point your browser to: http://localhost:5555 --- OR --- B) open a port in your firewall: sudo iptables -A INPUT -p tcp --dport 5555 -j ACCEPT (run that command on your server) then point your browser to: http://your-ip-or-hostname:5555 * FYI, the log file is: /root/.scout/scout_realtime.log * "scout_realtime stop" to stop the daemon
-
Find the gem here: github.com/scoutapp/scout_realtime
PROD DATABASE
-
Check if DB is down: Log in, execute ‘psql’
-
use ‘sudo /etc/init.d/postgresql start 9.3’ to start the psql database if it’s down