Linux technical support - [email protected]


pinba server installation on CentOS 7

# PINBA RECEIVER CONFIGURATION

[receiver]# yum install -y net-tools epel-release

[receiver]# yum install -y wget glibc glibc-common mpfr libmpc cpp \
libgomp kernel-headers glibc-headers glibc-devel gcc \
libstdc++-devel gcc-c++ libevent libevent-devel Judy Judy-devel

[receiver]# cd /
[receiver]# wget http://store.alexlinux.com/sources/P/\
pinba_mariadb_headers.tar.gz
[receiver]# tar -xvzf pinba_mariadb_headers.tar.gz

[receiver]# cd /root
[receiver]# wget http://store.alexlinux.com/sources/P/\
pinba_engine-1.1.0.tar.gz

[receiver]# tar -xvzf pinba_engine-1.1.0.tar.gz

[receiver]# cd pinba_engine-1.1.0

[receiver]# yum -y install mariadb-devel mariadb-server

[receiver]# systemctl start mariadb; systemctl enable mariadb

# NOTE: CONFIGURE WILL FAIL, YOUR SHOULD COPY SOURCES 
# TO DIFFERENT FOLDERS IN /usr/include/mysql/
[receiver]# ./configure --with-mysql=/usr/include/mysql/ \
--libdir=/usr/lib64/mysql/plugin/

[receiver]# make && make install

[receiver]# ll /usr/lib64/mysql/plugin/

[receiver]# mysql -e "INSTALL PLUGIN pinba SONAME 'libpinba_engine.so';"

[receiver]# netstat -unap | grep 30002
udp    0    0 0.0.0.0:30002    0.0.0.0:*    2664/mysqld   :::*  772/ntpd

[receiver]# mysql -e "CREATE DATABASE pinba;"

[receiver]# mysql -D pinba < default_tables.sql

[receiver]# mysqlshow pinba
Database: pinba
+--------------------------------------+
|                Tables                |
+--------------------------------------+
| info                                 |
| report_by_hostname                   |
| report_by_hostname_and_schema        |
| report_by_hostname_and_script        |
| report_by_hostname_and_server        |
| report_by_hostname_and_status        |
| report_by_hostname_script_and_schema |
| report_by_hostname_script_and_status |
| report_by_hostname_server_and_script |
| report_by_hostname_status_and_schema |
| report_by_schema                     |
| report_by_script_and_schema          |
| report_by_script_and_status          |
| report_by_script_name                |
| report_by_server_and_schema          |
| report_by_server_and_script          |
| report_by_server_and_status          |
| report_by_server_name                |
| report_by_status                     |
| request                              |
| status                               |
| tag                                  |
| timer                                |
| timertag                             |
+--------------------------------------+

[receiver]# mkdir /data
[receiver]# cd /data/
[receiver]# mysql -u root -e "GRANT ALL PRIVILEGES ON pinba.* TO alexlinux@localhost IDENTIFIED BY 'alexlinux';"
[receiver]# git clone https://github.com/intaro/pinboard.git \
--branch=v1.5.2
[receiver]# cd pinboard/
[receiver]# ln -s /opt/remi/php55/root/bin/php /bin/
[receiver]# curl -sS https://getcomposer.org/installer | php
[receiver]# php composer.phar install
[receiver]# ./console migrations:migrate
Creating the "config/parameters.yml" file
Some parameters are missing. Please provide them.
host (localhost):
name (pinba):
user (user): alexlinux
pass (password): alexlinux
[receiver]# ./console register-crontab
[receiver]# yum -y -q install nginx
[receiver]# vim /etc/nginx/conf.d/pinba.conf

server {
    listen 80;
    server_name pinboard.site.ru;
    root /data/pinboard/web;

    #site root is redirected to the app boot script
    location = / {
        try_files @site @site;
    }

    #all other locations try other files first and go to our front 
    #controller if none of them exists
    location / {
        try_files $uri $uri/ @site;
    }

    #return 404 for all php files as we do have a front controller
    location ~ \.php$ {
       return 404;
    }

    location @site {
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root/index.php;
        fastcgi_param HTTPS $https if_not_empty;
    }

    location ~ /\.(ht|svn|git) {
        deny  all;
    }
}

[receiver]# systemctl start nginx; systemctl enable nginx

[receiver]# tcpdump -nn port 30002
tcpdump: verbose output suppressed, use -v or -vv for full
protocol decode listening on eth0, link-type EN10MB (Ethernet), capture
size 65535 bytes
18:14:27.322828 IP sender-ip.55429 > receiver-ip.30002: UDP, length 75

[receiver]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use pinba;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [pinba]> show tables;
+---------------------------------------------------------+
| Tables_in_pinba                                         |
+---------------------------------------------------------+
| doctrine_migration_versions                             |
| info                                                    |
| ipm_cpu_usage_details                                   |
| ipm_mem_peak_usage_details                              |
| ipm_pinba_report_by_hostname_90_95_99                   |
| ipm_pinba_report_by_hostname_and_server_90_95_99        |
| ipm_pinba_report_by_server_90_95_99                     |
| ipm_pinba_tag_info_category_server_name                 |
| ipm_pinba_tag_info_category_server_name_hostname        |
| ipm_pinba_tag_info_category_server_server_name          |
| ipm_pinba_tag_info_category_server_server_name_hostname |
| ipm_pinba_tag_info_group_server_name                    |
| ipm_pinba_tag_info_group_server_name_hostname           |
| ipm_pinba_tag_info_group_server_server_name             |
| ipm_pinba_tag_info_group_server_server_name_hostname    |
| ipm_report_2_by_hostname_and_server                     |
| ipm_report_by_hostname                                  |
| ipm_report_by_hostname_and_server                       |
| ipm_report_by_server_name                               |
| ipm_req_time_details                                    |
| ipm_status_details                                      |
| ipm_tag_info                                            |
| ipm_timer                                               |
| report_by_hostname                                      |
| report_by_hostname_and_schema                           |
| report_by_hostname_and_script                           |
| report_by_hostname_and_server                           |
| report_by_hostname_and_status                           |
| report_by_hostname_script_and_schema                    |
| report_by_hostname_script_and_status                    |
| report_by_hostname_server_and_script                    |
| report_by_hostname_status_and_schema                    |
| report_by_schema                                        |
| report_by_script_and_schema                             |
| report_by_script_and_status                             |
| report_by_script_name                                   |
| report_by_server_and_schema                             |
| report_by_server_and_script                             |
| report_by_server_and_status                             |
| report_by_server_name                                   |
| report_by_status                                        |
| request                                                 |
| status                                                  |
| tag                                                     |
| timer                                                   |
| timertag                                                |
+---------------------------------------------------------+
46 rows in set (0.00 sec)
> select * from ipm_pinba_report_by_hostname_and_server_90_95_99\G
*************************** 1. row ***************************
               req_count: 4
             req_per_sec: 4
          req_time_total: 0.027921
        req_time_percent: 100
        req_time_per_sec: 0.027921
          ru_utime_total: 0.013176
        ru_utime_percent: 100
        ru_utime_per_sec: 0.013176
          ru_stime_total: 0.0021765
        ru_stime_percent: 100
        ru_stime_per_sec: 0.008706
           traffic_total: 309.855
         traffic_percent: 100
         traffic_per_sec: 309.855
                hostname: sender
             server_name: _
  memory_footprint_total: 15808
memory_footprint_percent: 100
         req_time_median: 0.00976562
             index_value: sender/_
                     p90: 0.0146484
                     p95: 0.0146484
                     p99: 0.0146484
1 row in set (0.00 sec)

MariaDB [pinba]>

# YOU SHOULD SET TIMEZONE IN PHP.INI,
# RESTART FPM AND WAIT A COUPLE OF HOURS

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>