Skip to content

Instantly share code, notes, and snippets.

@gardart
Forked from GregMefford/setup-statsd-centos.sh
Last active August 29, 2015 13:57
Show Gist options
  • Save gardart/9355010 to your computer and use it in GitHub Desktop.
Save gardart/9355010 to your computer and use it in GitHub Desktop.
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web graphite-web-selinux python-memcached python-ldap httpd memcached
yum -y groupinstall "Development Tools"
# ===== Firewall and Security =====
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport http -j ACCEPT' /etc/sysconfig/iptables
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport https -j ACCEPT' /etc/sysconfig/iptables
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p tcp --dport 2003 -j ACCEPT' /etc/sysconfig/iptables
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 8125 -j ACCEPT' /etc/sysconfig/iptables
service iptables restart
# ===== BEGIN MANUAL STEP =====
# Add permission for apache user/group to graphite-web
chown -R apache:apache /var/lib/graphite-web
# Add timeout settings for sqlite to django settings
{ echo "DATABASE_OPTIONS = {";echo "'timeout': 60,";echo "}"; } >> /etc/graphite-web/local_settings.py
# run syncdb to setup the db
python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
# ===== END MANUAL STEP =====
# ===== Start services =====
service carbon-cache restart
service memcached restart
service httpd restart
# --- Install git ---
yum install -y git gcc zlib-devel curl curl-devel openssl
# --- Install NodeJS ---
yum install -y nodejs
# --- Install the Node Package Manager ---
yum install -y npm
# --- Install express, web application framework for node ---
yum install -y nodejs-express
# --- Install StatsD ---
git clone https://github.com/etsy/statsd.git
cd statsd
# copy the the statsd config example to create the config file
# unless you used non-default ports for some other feature of the system, the defaults in the config file are fine
cp exampleConfig.js local.js
# --- Start StatsD ---
node stats.js local.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment