supervisord管理mysql_supervisor的集中化管理搭建

1.supervisor很不错,可惜是单机版,所以上github上找了个管理工具supervisord-monitor。

github地址: https://github.com/mlazarov/supervisord-monitor

因为是php写的安装搭建比较麻烦,就大概写一个安装配置的过程,以供后续参考。

yum install nginx php php-fpm php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt

2.nginx的配置如下:

# cat /etc/nginx/nginx.conf

user nobody;

worker_processes2;

error_log/var/log/nginx/error.log;

pid/run/nginx.pid;

# Load dynamic modules. See/usr/share/nginx/README.dynamic.

include/usr/share/nginx/modules/*.conf;

events {

worker_connections 1024;

}

http {

log_format main '$remote_addr - $remote_user [$time_local] "$request" '

'$status $body_bytes_sent "$http_referer" '

'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 65;

types_hash_max_size 2048;

include /etc/nginx/mime.types;

default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.

# Seehttp://nginx.org/en/docs/ngx_core_module.html#include

# for more information.

include /etc/nginx/default.d/*.conf;

include /etc/nginx/conf.d/*.conf;

server {

listen 80;

server_name localhost;

root /opt/supervisord-monitor/public_html;

index index.html index.htm index.php;

# Load configuration files for the default server block.

# include /etc/nginx/default.d/*.conf;

location / {

try_files $uri $uri/ /index.php;

}

location ~ \.php$ {

try_files $uri =404;

include fastcgi.conf;

fastcgi_pass 127.0.0.1:9000;

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

}

3.php-fpm配置

vi /etc/php-fpm.d/www.conf

#只修改下列几项必须的,其他可根据自己需求修改

listen.owner=nobody

listen.group=nobody

listen.mode= 0666user=nobody

group= nobody

4.给予所有权限

group = nobody

5.直接访问 IP就可以了

http://192.168.23.170/

d4a439064e865e398f92054083cb886b.png

6.修改supervisord-monitor配置文件,添加主机vi /opt/supervisord-monitor/application/config/supervisor.php

$config['supervisor_servers'] =array('server01' =>array('url' => 'http://server01.app/RPC2','port' => '9001','username' => 'yourusername','password' => 'yourpass'),'server02' =>array('url' => 'http://server02.app/RPC2','port' => '9001','username' => 'yourusername','password' => 'yourpass'),'server03' =>array('url' => 'http://server03.app/RPC2','port' => '9001','username' => 'yourusername','password' => 'yourpass'),

);

然后再刷新访问就可以了。

参考:http://storysky.blog.51cto.com/628458/1707751

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值