zabbx的服务启动关闭

根据网上的博客的方法使用如下命令,但是报没有这样的单元

[root@localhost conf]# service zabbix_server restart
Redirecting to /bin/systemctl restart zabbix_server.service
Failed to restart zabbix_server.service: Unit not found.

原因是没有把启动脚本放入到/etc/init.d
执行下面的命令即可。

[root@localhost init.d]# pwd
/root/hbk/zabbix/zabbix-4.0.2/misc/init.d
[root@localhost init.d]#cp fedora/core/zabbix_server /etc/init.d/

同理zabbix_agentd

[root@localhost init.d]# cp fedora/core/zabbix_agentd /etc/init.d/

执行上面的语句之后,就可以使用如下命令进行服务的开启,关闭,状态

/etc/init.d/zabbix_server start|stop|status
/etc/init.d/zabbix_agentd start|stop|status

设置开机随系统启动:

chkconfig zabbix_server on
chkconfig zabbix_agentd on

启动后也可以使用systemctl来进行管理,比如:

 systemctl status zabbix_server.service 

猜你喜欢

转载自blog.csdn.net/huangbaokang/article/details/84846528