I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| #!/bin/sh | |
| #Put this script into <gitProject>/hooks/post-receive on the production server | |
| #Make sure this script has execute permissions (chmod +x post-receive) | |
| #You can create a group (like "git"), make it owner of this file, and add | |
| #every user that needs to push to the that group. | |
| echo 'start repo to prod' | |
| ##### DEBIAN ################ | |
| # Debian Experimental | |
| # deb http://ftp.de.debian.org/debian experimental main contrib non-free | |
| # deb-src http://ftp.de.debian.org/debian experimental main contrib | |
| # Debian Sid # CURRENT UNSTABLE | |
| # deb http://ftp.de.debian.org/debian sid main contrib non-free | |
| # deb-src http://ftp.de.debian.org/debian sid main contrib non-free | |
| # Debian 8.0 (Jessie) # CURRENT TESTING |
| # Security updates | |
| deb http://security.debian.org/ jessie/updates main contrib non-free | |
| deb-src http://security.debian.org/ jessie/updates main contrib non-free | |
| ## Debian mirror | |
| # Base repository | |
| deb http://ftp.debian.org/debian jessie main contrib non-free | |
| deb-src http://ftp.debian.org/debian jessie main contrib non-free |
| # Unstable | |
| deb http://ftp.debian.org/debian unstable main contrib non-free | |
| deb-src http://ftp.debian.org/debian unstable main contrib non-free | |
| # Testing | |
| deb http://ftp.debian.org/debian testing main contrib non-free | |
| deb-src http://ftp.debian.org/debian testing main contrib non-free | |
| # Stable | |
| deb http://ftp.debian.org/debian stable main contrib non-free |
| # | |
| # This config file is a combination of ideas from: | |
| # http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy | |
| # http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/ | |
| # http://wiki.railsmachine.com/HAProxy | |
| # http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/ | |
| # http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/ | |
| # http://wiki.railsmachine.com/HAProxy | |
| # http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9 | |
| # |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
| package main | |
| import ( | |
| "fmt" | |
| "syscall" | |
| ) | |
| type DiskStatus struct { | |
| All uint64 `json:"all"` | |
| Used uint64 `json:"used"` |