Pinba Server install on centos6.4

2016-10-31 16:35:24

Pinba is a MySQL storage engine that acts as a realtime monitoring/statistics server for PHP using MySQL as a read-only interface.

Environment:

Pinba 1.1.0
Pinboard 1.5.2
MySQL: 5.5.50
PHP: 5.6

install MySQL:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
yum install cmake  ncurses-devel
wget http://downloads.mysql.com/archives/get/file/mysql-5.5.50.tar.gz
tar xvf mysql-5.5.50.tar.gz
mysql-5.5.50
cmake .
make install
cd /usr/local/mysql
chown -R mysql.mysql .
bin/mysql_install_db --user=mysql
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql.server
chmod +x /etc/init.d/mysql.server
chkconfig mysql.server on
/etc/init.d/mysql.server start

install Pinba:

1
2
3
4
5
6
yum install Judy.x86_64 protobuf.x86_64 libevent.x86_64 Judy-devel.x86_64 protobuf-devel.x86_64 libevent-devel.x86_64
wget http://store.alexlinux.com/sources/P/pinba_engine-1.2.0.tar.gz
tar zxvf pinba_engine-1.2.0.tar.gz
./configure --with-mysql=../mysql-5.5.50 --libdir=/usr/local/mysql/lib/plugin
make
make install

install Pinba plugin:

1
2
3
mysql> INSTALL PLUGIN pinba SONAME 'libpinba_engine.so';
mysql> CREATE DATABASE pinba;
shell> mysql -D pinba < default_tables.sql

create mysql user:

1
2
mysql> GRANT ALL PRIVILEGES ON pinba.* TO pinba@"<HOST>"
IDENTIFIED BY "<PASSWORD>";

install Pinba extension,defaut for php7,if you like me use php5 need change it to php5:

1
2
3
4
5
6
7
shell> git clone https://github.com/tony2001/pinba_extension.git
shell> cd pinba_extension
shell> git checkout -b php5 remotes/origin/php5
shell> phpize
shell> ./configure
shell> make
shell> make install

install apcu extension:

1
2
3
4
5
6
7
shell> wget http://pecl.php.net/get/apcu-4.0.11.tgz
shell> tar zxvf apcu-4.0.11.tgz
shell> cd apcu-4.0.11
shell> phpize
shell> ./configure --enable-apc-bc
shell> make
shell> make install

install Composer:

1
2
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

install Pinboard:

1
2
3
4
5
shell> tar zxvf v1.5.2.tar.gz
shell> cd pinboard-1.5.2
shell> composer install
shell> ./console migrations:migrate
shell> ./console register-crontab

confirm server if reecive data on port 30002:

1
shell> tcpdump -nn -i any udp port 30002

nginx configure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
server {        
listen 80;
server_name pinboard.me;
root /var/www/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 unix:/tmp/php-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param HTTPS $https if_not_empty;
}

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

Now we will see http://pinboard.me

install extension for client:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
shell> git clone https://github.com/tony2001/pinba_extension.git
shell> cd pinba_extension
shell> git checkout -b php5 remotes/origin/php5
shell> phpize
shell> ./configure
shell> make
shell> make install
(
cat <<EOF
; Load Pinba extension
extension=pinba.so
; Enable and configure Pinba extension
; See http://pinba.org/wiki/Manual:PHP_extension
pinba.enabled = 1
pinba.server = 127.0.0.1
EOF
) > /etc/php.d/pinba.ini

ref:

HowToPinbaCentOs
install on centos6
pinba server installation on CentOS 7
pinboard
pinba
Install Intaro Pinboard on Debian
Intaro Pinboard
PinbaBundle


您的鼓励是我写作最大的动力

俗话说,投资效率是最好的投资。 如果您感觉我的文章质量不错,读后收获很大,预计能为您提高 10% 的工作效率,不妨小额捐助我一下,让我有动力继续写出更多好文章。