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.

Revisions

  1. congdonglinux renamed this gist Apr 29, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @inokappa inokappa revised this gist Apr 16, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -113,6 +113,8 @@ yum install initscripts fontconfig
    cd ~
    wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.0_beta3-1.x86_64.rpm
    yum localinstall grafana-2.0.0_beta3-1.x86_64.rpm
    /etc/init.d/grafana-server start
    chkconfig grafana-server on
    ~~~

    #### Apache 2.4 の場合には...
  3. @inokappa inokappa revised this gist Apr 16, 2015. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -91,17 +91,30 @@ mysql -e 'FLUSH PRIVILEGES;' -u root

    ****

    #### Carbon と Apache を起動する
    #### Carbon と Apache を起動する(自動起動も有効にする)

    ~~~~
    /etc/init.d/carbon-cache start
    /etc/init.d/httpd start
    chkconfig carbon-cache on
    chkconfig mysqld on
    chkconfig httpd on
    ~~~~

    ***

    ## 追記

    #### Grafana 2.0.0 Beta3

    ~~~
    sudo su -
    yum install initscripts fontconfig
    cd ~
    wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.0_beta3-1.x86_64.rpm
    yum localinstall grafana-2.0.0_beta3-1.x86_64.rpm
    ~~~

    #### Apache 2.4 の場合には...

    `graphite-web.conf` を以下のように設定する必要がある。
  4. @inokappa inokappa revised this gist Apr 16, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ sudo yum install --enablerepo=epel graphite-web graphite-web-selinux mysql mysql
    #### MySQL の起動

    ~~~~
    service mysqld start
    sudo service mysqld start
    ~~~~

    `MySQL``root` パスワード等は適宜設定する。
    @@ -44,6 +44,7 @@ service mysqld start
    #### Graphite-web の設定

    ~~~~
    sudo su -
    cp /etc/graphite-web/local_settings.py /etc/graphite-web/local_settings.py.bk
    cat << EOT >> /etc/graphite-web/local_settings.py
    GRAPHITE_ROOT = '/usr/share/graphite'
  5. @inokappa inokappa revised this gist Apr 16, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -9,9 +9,10 @@
    #### epel リポジトリの追加

    ~~~~
    rpm --import http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/RPM-GPG-KEY-EPEL-6
    sudo rpm --import http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/RPM-GPG-KEY-EPEL-6
    cd /tmp/
    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
    sudo rpm -Uvh epel-release-6-8.noarch.rpm
    ~~~~

    ***
  6. @inokappa inokappa revised this gist Apr 16, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -19,9 +19,15 @@ rpm -Uvh epel-release-6-8.noarch.rpm
    #### パッケージのインストール

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

    環境に応じては epel リポジトリが無効になっている場合があるので以下のように epel リポジトリを有効にしてインストールする。

    ~~~
    sudo yum install --enablerepo=epel graphite-web graphite-web-selinux mysql mysql-server MySQL-python python-carbon
    ~~~

    ***

    #### MySQL の起動
  7. @inokappa inokappa revised this gist Aug 24, 2014. 1 changed file with 37 additions and 0 deletions.
    37 changes: 37 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -88,4 +88,41 @@ mysql -e 'FLUSH PRIVILEGES;' -u root
    ~~~~
    /etc/init.d/carbon-cache start
    /etc/init.d/httpd start
    ~~~~

    ***

    ## 追記

    #### Apache 2.4 の場合には...

    `graphite-web.conf` を以下のように設定する必要がある。

    ~~~~
    # Graphite Web Basic mod_wsgi vhost
    <VirtualHost *:80>
    ServerName graphite-web
    DocumentRoot "/usr/share/graphite/webapp"
    ErrorLog /var/log/httpd/graphite-web-error.log
    CustomLog /var/log/httpd/graphite-web-access.log common
    Alias /media/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media/"
    WSGIScriptAlias / /usr/share/graphite/graphite-web.wsgi
    WSGIImportScript /usr/share/graphite/graphite-web.wsgi process-group=%{GLOBAL} application-group=%{GLOBAL}
    <Location "/content/">
    SetHandler None
    </Location>
    <Location "/media/">
    SetHandler None
    </Location>
    <Directory "/usr/share/graphite/">
    Require all granted
    </Directory>
    </VirtualHost>
    ~~~~
  8. @inokappa inokappa revised this gist Aug 24, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -57,6 +57,7 @@ DATABASES = {
    'PORT': '3306',
    }
    }
    EOT
    ~~~~

    ***
  9. @inokappa inokappa revised this gist Jul 1, 2014. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -39,17 +39,24 @@ service mysqld start
    ~~~~
    cp /etc/graphite-web/local_settings.py /etc/graphite-web/local_settings.py.bk
    cat << EOT >> /etc/graphite-web/local_settings.py
    GRAPHITE_ROOT = '/usr/share/graphite'
    CONF_DIR = '/etc/graphite-web'
    STORAGE_DIR = '/var/lib/graphite-web'
    CONTENT_DIR = '/usr/share/graphite/webapp/content'
    WHISPER_DIR = '/var/lib/carbon/whisper/'
    RRD_DIR = '/var/lib/carbon/rrd'
    LOG_DIR = '/var/log/graphite-web/'
    DATABASES = {
    'default': {
    'NAME': 'graphite',
    'ENGINE': 'django.db.backends.mysql',
    'USER': '${your_name}',
    'PASSWORD': '${your_password}',
    'USER': 'graphite',
    'PASSWORD': 'complexpassw0rd',
    'HOST': 'localhost',
    'PORT': '3306',
    }
    }
    EOT
    ~~~~

    ***
  10. @inokappa inokappa revised this gist May 6, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    ## Graphite Setup for CentOS

    #### 参考

    * [Install graphite on a CentOS/RHEL server](http://www.linuxsysadmintutorials.com/install-graphite-on-a-centosrhel-server/)
    * [CentOSにRPMでGraphite+Diamondをインストールする](http://qiita.com/takakiku/items/4dbee4739801cb8f60a2)

    ***
    #### epel リポジトリの追加

    ~~~~
  11. @inokappa inokappa revised this gist May 6, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,8 @@ mysql -e 'FLUSH PRIVILEGES;' -u root
    /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
    ~~~~

    幾つか質問されるので適宜答える。

    ****

    #### Carbon と Apache を起動する
  12. @inokappa inokappa revised this gist May 6, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    ## Graphite Setup for CentOS

    #### epel リポジトリの追加

    ~~~~
  13. @inokappa inokappa created this gist May 6, 2014.
    73 changes: 73 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    #### 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
    ~~~~