AmazonLinuxにGrowthForecastをインストール

インストール

基本は https://github.com/kazeburo/GrowthForecast/ http://kazeburo.github.io/GrowthForecast/ のとおりです。

必要な前提パッケージを入れます。

yum -y groupinstall "Development Tools" 
yum -y install pkgconfig glib2-devel gettext libxml2-devel pango-devel cairo-devel

GrowthForecastではperl環境が必要ですが、perlbrew推奨とあるのでperlbrewを使って新しいバージョンのperlをインストールします。

curl -kL http://install.perlbrew.pl | bash

実行後、

## Download the latest perlbrew

## Installing perlbrew
perlbrew is installed: ~/perl5/perlbrew/bin/perlbrew
perlbrew root (~/perl5/perlbrew) is initialized.
Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:
source ~/perl5/perlbrew/etc/bashrc
Simply run `perlbrew` for usage details.
Happy brewing!

## Installing patchperl

## Done.

と表示されますので

echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bash_profile
source ~/.bash_profile

します。
続いてperlbrewでperlをインストールします。 バージョンは何を入れればよくわかりませんでしたが、 http://memocra.blogspot.jp/2013/01/fluentddatacountergrowthforecastrds.html を参考にして5.16.0を入れました。

perlbrew install perl-5.16.0

(新しければなんでも良いのかも。。)

インストール後、

perlbrew switch perl-5.16.0

で今入れたバージョンにスイッチすると、

perl -v
This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-linux
...

のようにバージョンが変わることが分かります。   続いてcpanmをインストールします。

perlbrew install-cpanm

cpanmでGrowthForecastをインストールします。

cpanm -n GrowthForecast

インストール後、

LANG=C growthforecast.pl --data-dir ./

でGrowthForecastを起動します。 なお、LANG=Cは付けないとグラフが文字化けしてしまいます。ネットでCentOSの例を見るとみんなyumで「bitmap-console-fonts」というパッケージを入れているので、おそらくこれがないと文字が化けるのだと思います。
また、「–data-dir」ではrrd-toolのデータが保存される先を指定しますが、とりあえず動かすだけなのでやっつけています。
起動したらブラウザで http://xxx.xxx.xxx.xxx:5125/ へアクセスします。

GrowthForecast1 ↑のような画面が表示されます。まだグラフはありません。   グラフの作成とデータの登録はWeb API経由で行います。 例として、

curl -F number=10 http://***.***.***.***:5125/api/hoge/fuga/count

のようにすると、

  • サービス名:hoge
  • セクション名:fuga
  • グラフ名:count

GrowthForecast2




Archives

2023 (2)
2021 (2)
2018 (3)
2017 (6)
2016 (2)
2015 (4)
2014 (21)
2013 (3)
2011 (2)