Skip to content

Instantly share code, notes, and snippets.

@congdonglinux
Forked from inokappa/gist:2be2ad0af6527b6749df
Last active April 29, 2017 07:56
Show Gist options
  • Save congdonglinux/a9ee4544f4744415fd4e9ea4f194d188 to your computer and use it in GitHub Desktop.
Save congdonglinux/a9ee4544f4744415fd4e9ea4f194d188 to your computer and use it in GitHub Desktop.
Graphite Setup for CentOS

Graphite Setup for CentOS

epel リポジトリの追加

rpm --import http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/RPM-GPG-KEY-EPEL-6
wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm

パッケージのインストール

yum install graphite-web graphite-web-selinux mysql mysql-server MySQL-python python-carbon

MySQL の起動

service mysqld start

MySQLroot パスワード等は適宜設定する。


Graphite-web の設定

cp /etc/graphite-web/local_settings.py /etc/graphite-web/local_settings.py.bk
cat << EOT >> /etc/graphite-web/local_settings.py
DATABASES = {
  'default': {
    'NAME': 'graphite',
    'ENGINE': 'django.db.backends.mysql',
    'USER': '${your_name}',
    'PASSWORD': '${your_password}',
    'HOST': 'localhost',
    'PORT': '3306',
  }
}
EOT

MySQL に Graphite-web のユーザーやデータベースを設定する

mysql -e "CREATE USER 'graphite'@'localhost' IDENTIFIED BY 'complexpassw0rd';" -u root
mysql -e "GRANT ALL PRIVILEGES ON graphite.* TO 'graphite'@'localhost';" -u root
mysql -e "CREATE DATABASE graphite;" -u root
mysql -e 'FLUSH PRIVILEGES;' -u root

Graphite-web の初期設定を行う

/usr/lib/python2.6/site-packages/graphite/manage.py syncdb

Carbon と Apache を起動する

/etc/init.d/carbon-cache start
/etc/init.d/httpd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment