Fork me on GitHub

CentOS 7.9 FastDFS 设置开机自启动

CentOS 7.9 FastDFS 设置开机自启动


 

一、前言

关于 FastDFS 服务的启动、停止、重启 相关脚本,可以参考如下博客:

https://www.cnblogs.com/miracle-luna/p/17750542.html

本文主要讲解如何使用 systemctl 系统命令,进行启动、停止、重启、查看 FastDFS 状态等操作。

 

 

二、实现步骤

1、编写 Nacos 系统启动文件

/lib/systemd/system 目录下创建 fastdfs.service 文件

vi /lib/systemd/system/fastdfs.service

 

编写内容如下:

复制代码
[Unit]
Description=fastdfs - Fast Distributed File System
After=network.target
 
[Service]
Type=forking
ExecStart=/home/startFastDFS.sh
ExecReload=/home/stopFastDFS.sh
ExecStop=/home/stopFastDFS.sh
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target
复制代码

说明:其中的 /home/ 目录改为实际的脚本存放目录。

 

2、重载所有服务

systemctl daemon-reload

 

3、设置开机自启动

systemctl enable fastdfs

 

4、查看开机启动状态

systemctl is-enabled fastdfs

 

5、查看 FastDFS 服务状态

systemctl status fastdfs

 

6、启动 FastDFS 服务

systemctl start fastdfs

 

7、停止 FastDFS 服务

systemctl stop fastdfs

 

8、重启 FastDFS 服务

systemctl restart fastdfs

 

 

PS:

关于 CentOS 7.9 FastDFS 的安装、部署、调试过程,可以参考如下博客:

https://www.cnblogs.com/miracle-luna/p/17552960.html

 

 

posted @   龙凌云端  阅读(584)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示