## 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 ~~~~ `MySQL` の `root` パスワード等は適宜設定する。 *** #### 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 ~~~~