SlideShare a Scribd company logo
Introduction to
 CloudForecast
   Yokohama.pm #6.x


      @kazeburo
•
• @kazeburo
• 2010 5
• 2010 6
• Web
CloudForecast

•

•
• perl        rrdtool         sysadmin
                         (by tokuhirom)
•
•
(1)
(1)


• ping
(1)


• ping
• HTTP,SSH
(1)


• ping
• HTTP,SSH
•            Disk
(2)

•
•
•
    • Nagios
    • monit
(1)
(1)



•
(1)



•
• CPU
(2)
•
•
•
    •   Cacti
    •   munin
    •   Ganglia
    •   CloudForecast
CloudForecast

•

• YAML
•         Web

• Perl!
CPAN
•   Plack + Starlet
•   Gearman
•   Parallel::Prefork
•   DBI DBD::SQLite

•   YAML::Syck
•   Text::Xslate
•   Data::Section::Simple
•   local::lib
• RRDTool RRDs.pm
• SNMP.pm
• Shirahata(WAF)
CloudForecast                  1




                RRD

    Radar                Web

                SQLite
CloudForecast                  1



(1)




                      RRD

          Radar                Web

                      SQLite
CloudForecast                  1



(1)




                      RRD

          Radar                Web

                      SQLite

            (2)
CloudForecast                        1



(1)




                      RRD

          Radar                      Web

                      SQLite

            (2)                (3)
CloudForecast                        1



(1)




                      RRD

          Radar                      Web

                      SQLite

            (2)                (3)
CloudForecast               2



         fetcher
         worker



                   RRD
         update
Radar                       Web
         worker
                   SQLite
CloudForecast                   2

                   Gearman
                   Worker


         fetcher
         worker



                        RRD
         update
Radar                           Web
         worker
                       SQLite
CloudForecast                  2

                  Gearman
                  Worker




                       RRD
         update
Radar                          Web
         worker
                      SQLite
Introduction to cloudforecast
1


# ubuntu
$ sudo apt-get install librrds-perl libsnmp-perl

# CentOS rrdtool   EPEL
$ sudo yum install net-snmp-perl
$ sudo yum install rrdtool-perl
2

$ git clone git://github.com/kazeburo/cloudforecast.git
$ cd cloudforecast
$ cpanm -l extlib --installdeps .
$ ls
Changes                   cloudforecast_web
Makefile.PL               docs
README                    host_config
cf_devstarter             htdocs
cf_fetcher_worker         lib
cf_updater_worker         server_list_sample.yaml
cloudforecast_radar       t
cloudforecast_sample.yaml
#
$ cp cloudforecast_sample.yaml cloudforecast.yaml

#
$ cp server_list_sample.yaml server_list.yaml
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
servers:
  - config: basic.yaml
    hosts:
             ....
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
servers:
  - config: basic.yaml
    hosts:
             ....
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
servers:
  - config: basic.yaml
    hosts:
             ....
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
      IP
servers:
  - config: basic.yaml
    hosts:
             ....
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
      IP
servers:
  - config: basic.yaml
    hosts:
             ....
(server_list.yaml)

--- #LOCALHOST
servers:
  - config: basic.yaml
    hosts:
      - 127.0.0.1 server1 my great localhost

--- #My Servers
      IP
servers:
  - config: basic.yaml
    hosts:
             ....
(basic.yaml)

---
component_config:
resources:
  - basic
  - traffic:eth0




      basic = eth0   CPU    TCP
(basic.yaml)

---
component_config:
resources:
  - basic
  - traffic:eth0




      basic = eth0   CPU    TCP
(basic.yaml)

---
component_config:
resources:
  - basic
  - traffic:eth0




      basic = eth0   CPU    TCP
•   Basic(CPU       TCP   )

•   Traffic
•   Disk Usage
•   DiskIO Count
•   Apache Status
•   Nginx Status
•   Squid
•   Mysql
•   Innodb
$ perldoc CloudForecast::Data::
$ perldoc CloudForecast::Data::
CloudForecast
  http://blog.nomadscafe.jp/2010/07/cloudforecast-1.html
#
$ ./cloudforecast_radar -c cloudforecast.yaml 
                        -l server_list.yaml

# Web
$ ./cloudforecast_web -p 5000 -c cloudforecast.yaml 
                      -l server_list.yaml
Web   (   )
Web   (   )
http://blog.nomadscafe.jp/2010/07/cloudforecast-2.html
Introduction to cloudforecast
•
•
•
•
•
•
# site-lib
$ mkdir -p site-lib/CloudForecast/Data
Gearman Worker


gearman        worker process


    http://blog.nomadscafe.jp/2010/07/gearman-worker-process.html
% ./gearman-starter.pl --max-prcess 8 -s 127.0.0.1:7004 
   --scoreboard-dir /var/run/worker --port 7005 MyWorker

% telnet localhost 7005
Trying 127.0.0.1...
System: gearman_servers: 127.0.0.1:7004 class: MyWorker
BusyWorkers: 0
IdleWorkers: 8
--
pid       Status Counter Comment
1630           . 0
1631           . 0
1632           . 0
1633           . 0
1634           . 0
1635           . 0
1636           . 0
1637           . 0
% ./gearman-starter.pl --max-prcess 8 -s 127.0.0.1:7004 
   --scoreboard-dir /var/run/worker --port 7005 MyWorker

% telnet localhost 7005
Trying 127.0.0.1...
System: gearman_servers: 127.0.0.1:7004 class: MyWorker
BusyWorkers: 0
IdleWorkers: 8
--
pid       Status Counter Comment
1630           . 0
1631           . 0
1632           . 0
1633           . 0
1634           . 0
1635           . 0
1636           . 0
1637           . 0
•
•
package CloudForecast::Data::Gearmanstarter;

use CloudForecast::Data -base;
use IO::Socket::INET;

=pod
  host_config)
    resources:
      - gearmanstarter[:port]

  eg)
    - gearmanstarter   #         9000
    - gearmanstarter:9005 #      port
=cut
rrds map { [$_,'GAUGE'] } qw/busy idle/;

# rrds ‘key’, ‘TYPE’ or rrds [‘key’,‘TYPE’], []..
•   COUNTER
    •
    •
    •   ) Traffic (   octet )

•   GAUGE
    •
    •
    •   )
(1)



graphs 'status' => 'worker status';

# graphs ‘key1’ => ‘label’;
# graphs ‘key2’ => ‘the great graph’;
(2)
graphs 'status' => 'worker status';
..

__DATA__
@@ status
DEF:my1=<%RRD%>:busy:AVERAGE
DEF:my2=<%RRD%>:idle:AVERAGE
AREA:my1#00C000:Busy
GPRINT:my1:LAST:Cur: %4.1lf
GPRINT:my1:AVERAGE:Ave: %4.1lf
GPRINT:my1:MAX:Max: %4.1lf
GPRINT:my1:MIN:Min: %4.1lfc
STACK:my2#0000C0:Idle
GPRINT:my2:LAST:Cur: %4.1lf
GPRINT:my2:AVERAGE:Ave: %4.1lf
GPRINT:my2:MAX:Max: %4.1lf
GPRINT:my2:MIN:Min: %4.1lfc
(2)
      graphs 'status' => 'worker status';
      ..
key
      __DATA__
      @@ status
      DEF:my1=<%RRD%>:busy:AVERAGE
      DEF:my2=<%RRD%>:idle:AVERAGE
      AREA:my1#00C000:Busy
      GPRINT:my1:LAST:Cur: %4.1lf
      GPRINT:my1:AVERAGE:Ave: %4.1lf
      GPRINT:my1:MAX:Max: %4.1lf
      GPRINT:my1:MIN:Min: %4.1lfc
      STACK:my2#0000C0:Idle
      GPRINT:my2:LAST:Cur: %4.1lf
      GPRINT:my2:AVERAGE:Ave: %4.1lf
      GPRINT:my2:MAX:Max: %4.1lf
      GPRINT:my2:MIN:Min: %4.1lfc
fetcher {
    my $c = shift;
    my $host = $c->address;
    my $port = $c->args->[0] || 9000;
    my $sock = IO::Socket::INET->new(
        PeerAddr => $host,
        PeerPort => $port,
        Proto    => 'tcp',
    );
    my $raw_stats;
    $sock->sysread( $raw_stats, 8192 );
    my ($busy, $idle);
    foreach my $line ( split /[rn]+/, $raw_stats ) {
        if ( $line =~ /^Busy.+: (d+)/ ) {
            $busy = $1;
        }
        if ( $line =~ /^Idle.+: (d+)/ ) {
            $idle = $1;
        }
    }
    return [$busy,$idle];
};
fetcher {
    my $c = shift;
    my $host = $c->address;
    my $port = $c->args->[0] || 9000;
    my $sock = IO::Socket::INET->new(
        PeerAddr => $host,
        PeerPort => $port,
        Proto    => 'tcp',
    );
    my $raw_stats;
    $sock->sysread( $raw_stats, 8192 );
    my ($busy, $idle);
    foreach my $line ( split /[rn]+/, $raw_stats ) {
        if ( $line =~ /^Busy.+: (d+)/ ) {
            $busy = $1;
        }
        if ( $line =~ /^Idle.+: (d+)/ ) {
            $idle = $1;
        }
    }
    return [$busy,$idle];
};
•
Introduction to cloudforecast
IDLE

       BUSY
TODO/Plan


• Web
• RRD   SQLite

•
• CloudForecast   Perl



•
•
Introduction to cloudforecast

More Related Content

PDF
Using ngx_lua in UPYUN
PDF
Roll Your Own API Management Platform with nginx and Lua
PDF
glance replicator
PDF
Rhebok, High Performance Rack Handler / Rubykaigi 2015
PDF
Lua tech talk
PDF
Performance Profiling in Rust
PPTX
Administering and Monitoring SolrCloud Clusters
ODP
Integrating icinga2 and the HashiCorp suite
Using ngx_lua in UPYUN
Roll Your Own API Management Platform with nginx and Lua
glance replicator
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Lua tech talk
Performance Profiling in Rust
Administering and Monitoring SolrCloud Clusters
Integrating icinga2 and the HashiCorp suite

What's hot (20)

PPT
ELK stack at weibo.com
PDF
PDF
Terraform 0.9 + good practices
PPT
{{more}} Kibana4
PDF
Top Node.js Metrics to Watch
KEY
Openstack presentation
PDF
Bootstrapping multidc observability stack
PDF
RestMQ - HTTP/Redis based Message Queue
PDF
Amazed by AWS Series #4
PDF
Lightweight wrapper for Hive on Amazon EMR
PDF
Integrating icinga2 and the HashiCorp suite
PDF
Puppet and the HashiStack
PDF
Workshop Infrastructure as Code - Suestra
PDF
Terraforming the Kubernetes Land
PDF
RubyKaigi2015 making robots-with-mruby
PDF
Infrastructure as Code in Google Cloud
PDF
Observability with Consul Connect
PDF
Introductory Overview to Managing AWS with Terraform
PDF
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
ELK stack at weibo.com
Terraform 0.9 + good practices
{{more}} Kibana4
Top Node.js Metrics to Watch
Openstack presentation
Bootstrapping multidc observability stack
RestMQ - HTTP/Redis based Message Queue
Amazed by AWS Series #4
Lightweight wrapper for Hive on Amazon EMR
Integrating icinga2 and the HashiCorp suite
Puppet and the HashiStack
Workshop Infrastructure as Code - Suestra
Terraforming the Kubernetes Land
RubyKaigi2015 making robots-with-mruby
Infrastructure as Code in Google Cloud
Observability with Consul Connect
Introductory Overview to Managing AWS with Terraform
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
Ad

Similar to Introduction to cloudforecast (20)

KEY
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
ODP
Deploying Perl apps on dotCloud
PDF
OpenStack Deployments with Chef
PDF
under the covers -- chef in 20 minutes or less
PDF
Achieving Infrastructure Portability with Chef
PDF
TXLF: Automated Deployment of OpenStack with Chef
KEY
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
PDF
Chef for OpenStack - OpenStack Fall 2012 Summit
PDF
Chef for OpenStack- Fall 2012.pdf
PDF
Open Source Toolchains to Manage Cloud Infrastructure
PDF
ChefConf 2012 Spiceweasel
PDF
The Automation Factory
PDF
Australian OpenStack User Group August 2012: Chef for OpenStack
KEY
Inside Of Mbga Open Platform
PDF
Oyster: an incubator for perls in the cloud
PDF
SCALE 2011 Deploying OpenStack with Chef
PDF
Chef For OpenStack Overview
PDF
Memonic Architecture
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Deploying Perl apps on dotCloud
OpenStack Deployments with Chef
under the covers -- chef in 20 minutes or less
Achieving Infrastructure Portability with Chef
TXLF: Automated Deployment of OpenStack with Chef
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack- Fall 2012.pdf
Open Source Toolchains to Manage Cloud Infrastructure
ChefConf 2012 Spiceweasel
The Automation Factory
Australian OpenStack User Group August 2012: Chef for OpenStack
Inside Of Mbga Open Platform
Oyster: an incubator for perls in the cloud
SCALE 2011 Deploying OpenStack with Chef
Chef For OpenStack Overview
Memonic Architecture
Ad

More from Masahiro Nagano (20)

PDF
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
PDF
Big Master Data PHP BLT #1
PDF
Stream processing in Mercari - Devsumi 2015 autumn LT
PDF
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
PDF
ISUCONの勝ち方 YAPC::Asia Tokyo 2015
PDF
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
PDF
メルカリでのNorikraの活用、 Mackerelを添えて
PDF
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
PDF
Mackerel & Norikra mackerel meetup #4 LT
PDF
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
PDF
Isucon makers casual talks
PDF
blogサービスの全文検索の話 - #groonga を囲む夕べ
PDF
Gazelle - Plack Handler for performance freaks #yokohamapm
PDF
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
PDF
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
PDF
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
PDF
Webアプリケーションの パフォーマンス向上のコツ 実践編
PDF
Webアプリケーションの パフォーマンス向上のコツ 概要編
PDF
Webアプリケーションとメモリ
PDF
最近作ったN個のCPANモジュール Yokohama.pm #10
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Big Master Data PHP BLT #1
Stream processing in Mercari - Devsumi 2015 autumn LT
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
ISUCONの勝ち方 YAPC::Asia Tokyo 2015
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
メルカリでのNorikraの活用、 Mackerelを添えて
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
Mackerel & Norikra mackerel meetup #4 LT
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
Isucon makers casual talks
blogサービスの全文検索の話 - #groonga を囲む夕べ
Gazelle - Plack Handler for performance freaks #yokohamapm
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
Webアプリケーションの パフォーマンス向上のコツ 実践編
Webアプリケーションの パフォーマンス向上のコツ 概要編
Webアプリケーションとメモリ
最近作ったN個のCPANモジュール Yokohama.pm #10

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PPTX
Spectroscopy.pptx food analysis technology
PDF
A comparative analysis of optical character recognition models for extracting...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
Spectroscopy.pptx food analysis technology
A comparative analysis of optical character recognition models for extracting...
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Mobile App Security Testing_ A Comprehensive Guide.pdf

Introduction to cloudforecast