mysqlchk的systemctl中的数千个条目

问题描述

我正在尝试设置HA-proxy来监督Percona XTradb集群。我想为此使用systemd并为此使用以下设置:

cat /etc/systemd/system/MysqLchk@.service
[Unit]
Description=MysqL Check Service for HAProxy
After=MysqL.service
Requires=MysqLchk.socket
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=-/bin/bash /usr/bin/clustercheck
Restart=always
StandardInput=socket
[Install]
WantedBy=multi-user.target

cat /etc/systemd/system/MysqLchk.socket
[Unit]
Description=MysqL Check Socket for HAProxy
PartOf=MysqLchk@.service
[Socket]
ListenStream=0.0.0.0:9200
Accept=true
[Install]
WantedBy=sockets.target

虽然这在原理上是可行的,但问题在于它们都用以下条目填充了日志:

Sep 20 06:30:24 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49832).
Sep 20 06:30:36 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49844).
Sep 20 06:30:48 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49850).
Sep 20 06:31:00 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49856).
Sep 20 06:31:12 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49862).
Sep 20 06:31:24 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49874).
Sep 20 06:31:36 kermit systemd[1]: Started MysqL Check Service for HAProxy (xxx.yyy.10.55:49886).

而且systemctl的输出为此显示了数千行

  MysqLchk@10012-xxx.yyy.3.90:9200-xxx.yyy.10.55:38558.service                                     loaded active exited    MysqL Check Service for HAProxy (213.179.10.55:38558)
  MysqLchk@10013-xxx.yyy.3.90:9200-xxx.yyy.10.55:38576.service                                     loaded active exited    MysqL Check Service for HAProxy (213.179.10.55:38576)
  MysqLchk@10014-xxx.yyy.3.90:9200-xxx.yyy.10.55:38582.service                                     loaded active exited    MysqL Check Service for HAProxy (213.179.10.55:38582)
  MysqLchk@10015-xxx.yyy.3.90:9200-xxx.yyy.10.55:38588.service                                     loaded active exited    MysqL Check Service for HAProxy (213.179.10.55:38588)
  MysqLchk@10016-xxx.yyy.3.90:9200-xxx.yyy.10.55:38594.service                                     loaded active exited    MysqL Check Service for HAProxy (213.179.10.55:38594)

我的数据库集群位于IP地址xxx.yyy.3.90-92

有人知道为什么会有这个问题,即为什么systemctl会填满所有这些条目吗?一段时间后,它变得无法管理,并且我的数据库节点资源不足,我必须重新启动,因此很明显,我拥有的解决方案不是我可以接受的解决方案。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)