首页 > 搭建的gitlab经常莫名其妙地自己停止了

搭建的gitlab经常莫名其妙地自己停止了

大家好!我遇见了一个问题,刚搭建的 gitlab,经常用着用着,就出现这个503错误:

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

我在终端里,输入: service gitlab status, 显示为:

GitLab is not running.

再次输入命令:service gitlab start,显示为:

Removing stale Unicorn web server pid. This is most likely caused by the web server crashing the last time it ran.
Removing stale Sidekiq job dispatcher pid. This is most likely caused by Sidekiq crashing the last time it ran.
Starting both the GitLab Unicorn and Sidekiq
The GitLab Unicorn web server with pid 24220 is running.
The GitLab Sidekiq job dispatcher with pid 24275 is running.
GitLab and all its components are up and running.

这时候有可以用了,但是经常这样,很麻烦!

我在终端中输入命令:

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

得到如下的信息:

System information
System:
Current User:    git
Using RVM:    no
Ruby Version:    2.3.0p0
Gem Version:    2.5.1
Bundler Version:1.12.3
Rake Version:    10.4.2
Sidekiq Version:3.3.0

GitLab information
Version:    7.14.3
Revision:    d321305
Directory:    /home/git/gitlab
DB Adapter:    mysql2
URL:        http://git.cheikh.wang
HTTP Clone URL:    http://git.cheikh.wang/some-group/some-project.git
SSH Clone URL:    git@git.cheikh.wang:some-group/some-project.git
Using LDAP:    no
Using Omniauth:    no

GitLab Shell
Version:    2.6.11
Repositories:    /home/git/repositories/
Hooks:        /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git

在终端中输入自检命令:

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

显示为:

Checking GitLab Shell ...

GitLab Shell version >= 2.6.5 ? ... OK (2.6.11)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ...
LazyWaimai / LazyWaimai-Api ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
    /home/git/repositories/: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 3.2.0
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... no
  Try fixing it:
  sudo -u git -H RAILS_ENV=production bin/background_jobs start
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
LazyWaimai / LazyWaimai-Api ... yes
Projects have satellites? ...
LazyWaimai / LazyWaimai-Api ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.0)
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (2.7.3)
Active users: 1

Checking GitLab ... Finished

可是我按照它的提示输入

sudo -u git -H RAILS_ENV=production bin/background_jobs start

gitlab 服务却又停止了,无解呀!求助!


我通过 gitlab 的日志看到是因为内存不够的原因导致 gitlab 的相关服务被自行停止了。我的云主机是1G 的内存,在我给系统添加了 SWAP 分区后,问题得以解决!

【热门文章】
【热门文章】