温馨提示×

centos gitlab怎么停

小樊
49
2026-09-30 00:55:07
栏目: 智能运维

在 CentOS 上停止 GitLab,通常取决于你是 Omnibus 安装 还是 源码/容器安装。最常见的是 Omnibus 安装,下面分别说明。


一、Omnibus 方式安装的 GitLab(最常见)

1️⃣ 停止 GitLab 所有服务

sudo gitlab-ctl stop

2️⃣ 查看运行状态

sudo gitlab-ctl status

3️⃣ 如需彻底停止并禁用开机启动

sudo systemctl stop gitlab-runsvdir
sudo systemctl disable gitlab-runsvdir

这样重启服务器后 GitLab 不会自动启动。

4️⃣ 恢复开机启动(如需)

sudo systemctl enable gitlab-runsvdir
sudo systemctl start gitlab-runsvdir

二、使用 systemctl 管理(推荐)

sudo systemctl stop gitlab-runsvdir

或单独停止 GitLab 服务(部分版本):

sudo systemctl stop gitlab

三、Docker 安装的 GitLab

停止容器

docker stop gitlab

查看容器

docker ps -a

四、源码安装的 GitLab(较少见)

sudo service gitlab stop

或

sudo /etc/init.d/gitlab stop

五、只停止某个组件(可选)

例如只停 nginx:

sudo gitlab-ctl stop nginx

如果你是 不确定安装方式,可以告诉我:

  • which gitlab-ctl 是否有输出
  • 是否是 Docker
  • CentOS 版本(7 / 8 / Stream)

我可以给你更精确的操作命令。

0 踩