

Smokeping 多机配置
source link: https://www.taterli.com/7350/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

实验的主机系统是Debian,应该只要是Debian系的系统应该都可以.主机系统版本是Raspberrry Pi OS(Debian 10),从机是各种VPS的Debian 10.
首先安装spawn-fcgi和nginx,smokeping,通过apt就可以安装,从机不需要安装nginx,主机Web端口必须可以被访问(不一定是80).
首先理清几个概念:
主机负责布置所有任务,从机通过HTTP POST和主机通信,数据库都在主机.权限是个很麻烦的事情,需要反复折腾,在AMAZ Lightsail Debian 10上没测试成功,最后在Raspbian上实践,问题比较奇怪,暂时不明白.如果出现什么错误,先试试运行:
smokeping --restart
(主机)第一步,安装必要的软件:
apt install smokeping nginx spawn-fcgi
(主机)第二步新建fcgi的映射文件/etc/systemd/system/smokeping-fcgi.service,内容如下:
[Unit] Description=SmokePing FastCGI Service After=network.target smokeping.service Wants=smokeping.service [Service] User=root Group=root StandardOutput=null StandardError=syslog ExecStart=/usr/bin/spawn-fcgi -u smokeping -s /run/smokeping-fcgi.sock -M 755 -n -U www-data -G www-data -- /usr/share/smokeping/smokeping.cgi Restart=always [Install] WantedBy=multi-user.target
(主机)第三步,给Nginx配置反向代理.
location = /smokeping/ { fastcgi_pass unix:/run/smokeping-fcgi.sock; include /etc/nginx/fastcgi_params; } location /smokeping/ { alias /usr/share/smokeping/www/; }
(主机)第四步,按照正常smokeping配置那样,配置目标等等各种参数.
(主机)第五步,设置/var/lib/smokeping的所属为smokeping:www-data,权限为755,设置,最后使用smokeping –restart重启.
(主机)从机配置文件,可以写很多行,这个是Slaves文件.
*** Slaves *** secrets=/etc/smokeping/smokeping_secrets +ap-northeast-2 display_name=韩国 首尔 color=0000ff
(主机)而smokeping_secrets是对应密码文件,格式如下:
ap-northeast-2:065538606019
(从机)把从机密码字符串放在/etc/smokeping/secrets,设定权限600,然后新建服务/etc/systemd/system/smokeping.service,内容如下:
[Unit] Description=Smokeping Service, Network Latency Graphical Viewer After=network.service [Service] Type=forking Environment=MASTER=18.183.217.124 Environment=CACHEDIR=/usr/local/smokeping/cache/ Environment=SECRET=/etc/smokeping/secrets Environment=SLAVENAME=eu-west-3 ExecStart=/bin/sh -c "/usr/sbin/smokeping --master-url=http://${MASTER}/smokeping/ --cache-dir=${CACHEDIR} --slave-name=${SLAVENAME} --shared-secret=${SECRET} --logfile=/usr/local/smokeping/slave.log --debug-daemon" KillSignal=SIGTERM ExecReload=/bin/sh -c "/usr/sbin/smokeping --master-url=http://${MASTER}/smokeping/ --cache-dir=${CACHEDIR} --slave-name=${SLAVENAME} --shared-secret=${SECRET} --logfile=/usr/local/smokeping/slave.log --debug-daemon --reload" User=smokeping Group=smokeping [Install] WantedBy=default.target
(从机)新建缓存目录,使能服务,重启服务,就可以等待上线了.
mkdir /usr/local/smokeping/cache -p chown smokeping:smokeping /usr/local/smokeping -R
批量检查下从机服务是不是正常(pssh):

结果:

实验完毕记得删机,多机费钱啊.
Recommend
-
200
k-vim VERSION: 9.2 LAST_UPDATE_TIME: 2017-07-29 本次更新: 小版本更新, 支持vim8异步语法检查 详细
-
131
babel到底该如何配置? 2017年10月22日 09:33 · 阅读 16658 说起ES6,webpack,打...
-
119
Gotorch - 多机定时任务管理系统 最近在学习...
-
30
1、配置固定IP地址过程比较简单如需请参考https://blog.51cto.com/zhuneianxiang/20499832、关闭防火墙 #查看防火墙是否开启 systemctl status firewalld.service #关闭防火墙 systemctl stop firewalld.service #禁用防火墙开机自启
-
15
Egg.js 多机平滑重启实践图南全干工程师,只为建设祖国前提:首先要...
-
7
<?xml encoding="utf-8" ??>Introduction At a high level, SmokePing checks network latency. Setting up SmokePing in multiple Vultr locations can help address network issues with cloud compute serv...
-
7
This site can’t be reached oohcode.com’s server IP address could not be found.
-
7
新浪VR > 正文页 AR空战培训系统开发商RED 6完成首次多机空战训练飞行...
-
10
5.8GHz FPV Channels Chart By knowing where the channels are located in the 5.8GHz frequency spectrum, the channel bandwidth, and how much separation there is between channels can help avoid video interference.
-
3
Ansible 多机自动化工具 初学笔记 此文档仅张聪明同学个人笔记;新负责KTH-RPL Cluster GPU的漫漫学习长路 English Docs:...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK