Graphite

Graphite for RHEL 5.7

Python2.7 install

...省略...

Django install

# Download Django 1.3.5 source from django.org
# Unpackage

cd Django-1.3.5
python setup.py install

django-tagging install

# Download django-tagging from http://code.google.com/p/django-tagging/
# Unpackage

cd django-tagging-0.3.1
python setup.py install
cd ..

pixman install

# Now you have to build the Cairo graphics library, as RHEL's
# is too old for py2cairo's needs.

# Start with pixman, a dependency for building cairo!

# Download pixman from http://www.cairographics.org/releases/
# Unpackage

cd pixman-0.28.2
./configure
make
checkinstall   ###rpm パッケージ作成
rpm -ivh /usr/src/redhat/RPMS/x86_64/pixman-0.28.2-1.x86_64.rpm

cairo install

# Download cairo from http://www.cairographics.org/releases/
# Unpackage

cd cairo-1.12.8
# Make sure we find our shit and don't have runtime linker problems
export LDFLAGS="-L/usr/local/lib/ -Xlinker -rpath -Xlinker /usr/local/lib/"
# PKG_CONFIG_PATH is set below so pixman is found
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
# Turn off all the X shit and gobject since RHEL glib2 is too old
./configure --without-x --enable-xlib=no \
--enable-xlib-xrender=no --enable-xcb-shm=no \
--enable-qt=no --enable-gl=no \
--enable-gobject=no

make
checkinstall
rpm -ivh /usr/src/redhat/RPMS/x86_64/cairo-1.12.8-1.x86_64.rpm

pycairo

# Download Pycairo (aka py2cairo) from http://www.cairographics.org/pycairo/
# Unpackage
# python2.7 with py2cairo

# Had to add these to LDFLAGS or ./waf configure bombs on Python.h test
# due to not including them when it should be in its test
export LDFLAGS="$LDFLAGS -lm -ldl -lutil"
cd py2cairo-1.10.0
./waf configure
./waf build
./waf install
cd ..

graphite

# Download carbon, whisper, and graphite-web from
# https://github.com/graphite-project/
# Unpackage

git clone https://github.com/graphite-project/whisper.git
cd whisper
python setup.py install
cd ..

git clone https://github.com/graphite-project/carbon.git
cd carbon
python setup.py install
cd ..

git clone https://github.com/graphite-project/graphite-web.git
cd graphite-web
./check-dependencies.py # Ignore WARNINGs as you see fit
python setup.py install
cd ..

Graphite and Nginx

nginx install

yum -y install nginx

uwsgi install

wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz
tar xf uwsgi-latest.tar.gz
cd uwsgi-latest
make Makefile
cp uwsgi /usr/local/bin/
cp nginx/uwsgi_params /etc/nginx/

supervisor install

pip install supervisor

### create supervisord config file
supervisord -c /etc/supervisord.conf

### change supervisord config like thie
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)

### add graphite config
cat >> /etc/supervisord.conf << EOF
[program:uwsgi]
command=/usr/local/bin/uwsgi
  --module 'django.core.handlers.wsgi:WSGIHandler()'
  --socket 127.0.0.1:3031
  --chdir /opt/graphite/webapp
  --processes 1
  --master
  --harakiri 120
  --max-requests 5000
  --pythonpath "['/opt/graphite/webapp'] + sys.path"
directory=/opt/graphite/webapp
environment=DJANGO_SETTINGS_MODULE='graphite.settings'
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/nginx/uwsgi.log
redirect_stderr=true
stopsignal=QUIT
EOF

### create init.d with supervisord
cat > /etc/init.d/supervisord <<EOF
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
# description: Supervisor Server
# processname: supervisord

# Source init functions
. /etc/rc.d/init.d/functions

prog="supervisord"

prefix="/usr/local"
exec_prefix="${prefix}"
prog_bin="${exec_prefix}/bin/supervisord"
PIDFILE="/var/run/$prog.pid"
CONF_FILE="/etc/supervisord.conf"

start()
{
        echo -n $"Starting $prog: "
        daemon $prog_bin -c $CONF_FILE --pidfile $PIDFILE
        [ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup"
        echo
}

stop()
{
        echo -n $"Shutting down $prog: "
        [ -f $PIDFILE ] && killproc $prog || success $"$prog shutdown"
        echo
}

case "$1" in

  start)
    start
  ;;

  stop)
    stop
  ;;

  status)
        status $prog
  ;;

  restart)
    stop
    start
  ;;

  *)
    echo "Usage: $0 {start|stop|restart|status}"
  ;;

esac
EOF

nginx.conf

server {
        listen 8080;
        listen [::]:80; # use this only if using IPv6
        client_max_body_size    4M;
        server_name  graphite.frlinux.net;
        root   /var/www/stats;
        access_log  /var/log/nginx/stats.access.log;
        error_log  /var/log/nginx/stats.error.log;

        location / {
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /content {
                alias /opt/graphite/webapp/graphite/content;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /metrics {
                alias /opt/graphite/webapp/graphite/metrics;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /dashboard {
                alias /opt/graphite/webapp/graphite/dashboard;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /render {
                alias /opt/graphite/webapp/graphite/render;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /browser {
                alias /opt/graphite/webapp/graphite/browser;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
        location /composer {
                alias /opt/graphite/webapp/graphite/composer;
                gzip off;
                include uwsgi_params;
                uwsgi_pass      127.0.0.1:3031;
        }
}

diamond

I use diamond send metric to my graphite server

git clone https://github.com/BrightcoveOS/Diamond.git
cd Diamond
python setup.py bdist_rpm
rpm dist/diamond-3.2.35-1.noarch.rpm
/var/lib/openshift/bccd8eac1968476490eaee9ced33c7bf/app-root/runtime/repo/php/data/pages/graphite.txt · 最后更改: 2012/12/18 10:28 由 admin
到顶部
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0