CentOS 7 上 GitLab 的安装、备份、迁移及恢复 2018-11-14 / 75 次 / 快抢沙发 /

GitLab 是目前最适合公司进行代码管理的系统,采用自己公司服务器来搭建 GitLab 是最好的选择。

本文是 AppX 系列中的一篇。AppX 系列是 @ifeegoo 个人移动互联网学习、工作和生活的提炼与总结的文章系列。更多内容请关注:
AppX @ifeegoo https://www.ifeegoo.com/appx.html

GitLab 是目前最适合公司进行代码管理的系统,采用自己公司服务器来搭建 GitLab 是最好的选择。

以下便是记录 GitLab 在 CentOS 7.x 上安装、备份、迁移及恢复的步骤。

CentOS 7.x 上 GitLab 的安装。
备注:GitLab 官方安装步骤参考文档

相关操作环境:
CentOS 7.5 64位
GitLab

注意:在官方文档 GitLab CE 版本和 GitLab EE 版本如何选择中,我们可以看到,安装 GitLab EE 版本会更好,你没有相关企业版本 [EE] 授权,就相当于社区版本 [CE] 版本,也不影响使用,将来想要从社区版本 [CE] 转成企业版本 [EE] 也是相当的方便,因此接下来我们安装的是企业版本 [EE] 的 GitLab。

1.安装和配置必要的依赖库:

在 CentOS 7 中,以下命令行会同时在系统防火墙中打开 HTTP 和 SSH 的访问。

# sudo yum install -y curl policycoreutils-python openssh-server
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel                                                                                                                                | 3.2 kB  00:00:00     
extras                                                                                                                              | 3.4 kB  00:00:00     
os                                                                                                                                  | 3.6 kB  00:00:00     
updates                                                                                                                             | 3.4 kB  00:00:00     
(1/3): extras/7/x86_64/primary_db                                                                                                   | 205 kB  00:00:00     
(2/3): epel/7/x86_64/updateinfo                                                                                                     | 932 kB  00:00:00     
(3/3): epel/7/x86_64/primary                                                                                                        | 3.6 MB  00:00:00     
epel                                                                                                                                           12698/12698
Package curl-7.29.0-46.el7.x86_64 already installed and latest version
Package openssh-server-7.4p1-16.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.5-22.el7 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-2 for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-9 for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.1-3.el7_5.1 will be installed
--> Processing Dependency: audit-libs(x86-64) = 2.8.1-3.el7_5.1 for package: audit-libs-python-2.8.1-3.el7_5.1.x86_64
---> Package checkpolicy.x86_64 0:2.5-6.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-15.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.5-11.el7 will be installed
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-2.el7 will be installed
--> Running transaction check
---> Package audit-libs.x86_64 0:2.8.1-3.el7 will be updated
--> Processing Dependency: audit-libs(x86-64) = 2.8.1-3.el7 for package: audit-2.8.1-3.el7.x86_64
---> Package audit-libs.x86_64 0:2.8.1-3.el7_5.1 will be an update
--> Running transaction check
---> Package audit.x86_64 0:2.8.1-3.el7 will be updated
---> Package audit.x86_64 0:2.8.1-3.el7_5.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================
 Package                                       Arch                          Version                                  Repository                      Size
===========================================================================================================================================================
Installing:
 policycoreutils-python                        x86_64                        2.5-22.el7                               os                             454 k
Installing for dependencies:
 audit-libs-python                             x86_64                        2.8.1-3.el7_5.1                          updates                         75 k
 checkpolicy                                   x86_64                        2.5-6.el7                                os                             294 k
 libcgroup                                     x86_64                        0.41-15.el7                              os                              65 k
 libsemanage-python                            x86_64                        2.5-11.el7                               os                             112 k
 python-IPy                                    noarch                        0.75-6.el7                               os                              32 k
 setools-libs                                  x86_64                        3.3.8-2.el7                              os                             619 k
Updating for dependencies:
 audit                                         x86_64                        2.8.1-3.el7_5.1                          updates                        247 k
 audit-libs                                    x86_64                        2.8.1-3.el7_5.1                          updates                         99 k

Transaction Summary
===========================================================================================================================================================
Install  1 Package  (+6 Dependent packages)
Upgrade             ( 2 Dependent packages)

Total download size: 2.0 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): audit-libs-2.8.1-3.el7_5.1.x86_64.rpm                                                                                        |  99 kB  00:00:00     
(2/9): audit-2.8.1-3.el7_5.1.x86_64.rpm                                                                                             | 247 kB  00:00:00     
(3/9): audit-libs-python-2.8.1-3.el7_5.1.x86_64.rpm                                                                                 |  75 kB  00:00:00     
(4/9): libcgroup-0.41-15.el7.x86_64.rpm                                                                                             |  65 kB  00:00:00     
(5/9): checkpolicy-2.5-6.el7.x86_64.rpm                                                                                             | 294 kB  00:00:00     
(6/9): libsemanage-python-2.5-11.el7.x86_64.rpm                                                                                     | 112 kB  00:00:00     
(7/9): python-IPy-0.75-6.el7.noarch.rpm                                                                                             |  32 kB  00:00:00     
(8/9): policycoreutils-python-2.5-22.el7.x86_64.rpm                                                                                 | 454 kB  00:00:00     
(9/9): setools-libs-3.3.8-2.el7.x86_64.rpm                                                                                          | 619 kB  00:00:00     
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                      3.9 MB/s | 2.0 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : audit-libs-2.8.1-3.el7_5.1.x86_64                                                                                                      1/11 
  Installing : audit-libs-python-2.8.1-3.el7_5.1.x86_64                                                                                               2/11 
  Installing : python-IPy-0.75-6.el7.noarch                                                                                                           3/11 
  Installing : checkpolicy-2.5-6.el7.x86_64                                                                                                           4/11 
  Installing : libsemanage-python-2.5-11.el7.x86_64                                                                                                   5/11 
  Installing : setools-libs-3.3.8-2.el7.x86_64                                                                                                        6/11 
  Installing : libcgroup-0.41-15.el7.x86_64                                                                                                           7/11 
  Installing : policycoreutils-python-2.5-22.el7.x86_64                                                                                               8/11 
  Updating   : audit-2.8.1-3.el7_5.1.x86_64                                                                                                           9/11 
  Cleanup    : audit-2.8.1-3.el7.x86_64                                                                                                              10/11 
  Cleanup    : audit-libs-2.8.1-3.el7.x86_64                                                                                                         11/11 
  Verifying  : libcgroup-0.41-15.el7.x86_64                                                                                                           1/11 
  Verifying  : setools-libs-3.3.8-2.el7.x86_64                                                                                                        2/11 
  Verifying  : policycoreutils-python-2.5-22.el7.x86_64                                                                                               3/11 
  Verifying  : libsemanage-python-2.5-11.el7.x86_64                                                                                                   4/11 
  Verifying  : checkpolicy-2.5-6.el7.x86_64                                                                                                           5/11 
  Verifying  : python-IPy-0.75-6.el7.noarch                                                                                                           6/11 
  Verifying  : audit-libs-2.8.1-3.el7_5.1.x86_64                                                                                                      7/11 
  Verifying  : audit-2.8.1-3.el7_5.1.x86_64                                                                                                           8/11 
  Verifying  : audit-libs-python-2.8.1-3.el7_5.1.x86_64                                                                                               9/11 
  Verifying  : audit-libs-2.8.1-3.el7.x86_64                                                                                                         10/11 
  Verifying  : audit-2.8.1-3.el7.x86_64                                                                                                              11/11 

Installed:
  policycoreutils-python.x86_64 0:2.5-22.el7                                                                                                               

Dependency Installed:
  audit-libs-python.x86_64 0:2.8.1-3.el7_5.1  checkpolicy.x86_64 0:2.5-6.el7     libcgroup.x86_64 0:0.41-15.el7  libsemanage-python.x86_64 0:2.5-11.el7 
  python-IPy.noarch 0:0.75-6.el7              setools-libs.x86_64 0:3.3.8-2.el7 

Dependency Updated:
  audit.x86_64 0:2.8.1-3.el7_5.1                                            audit-libs.x86_64 0:2.8.1-3.el7_5.1                                           

Complete!
# sudo systemctl enable sshd
# sudo systemctl start sshd
# sudo firewall-cmd --permanent --add-service=http
FirewallD is not running
# systemctl start firewalld
# sudo firewall-cmd --permanent --add-service=http
success
# sudo systemctl reload firewalld

下一步,通过安装 Postfix 发送邮件通知。如果你想要使用其他的解决方案来发送邮件,请跳过此步骤,在 GitLab 安装之后,配置外部的 SMTP 服务器
备注:此系统内部预装了 Postfix 服务,所以不用安装。

[root@VM_129_173_centos ~]# sudo yum install postfix
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package 2:postfix-2.10.1-6.el7.x86_64 already installed and latest version
Nothing to do
[root@VM_129_173_centos ~]# sudo systemctl enable postfix
[root@VM_129_173_centos ~]# sudo systemctl start postfix
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.

我们在启用 Postfix 服务的时候,提示错误,我们通过命令行查看:

# systemctl status postfix.service
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2018-11-12 16:57:43 CST; 1min 13s ago
  Process: 3338 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
  Process: 3336 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
  Process: 3332 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=75)

Nov 12 16:57:41 VM_129_173_centos systemd[1]: Starting Postfix Mail Transport Agent...
Nov 12 16:57:41 VM_129_173_centos aliasesdb[3332]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
Nov 12 16:57:42 VM_129_173_centos aliasesdb[3332]: newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
Nov 12 16:57:42 VM_129_173_centos postfix[3338]: fatal: parameter inet_interfaces: no local interface found for ::1
Nov 12 16:57:43 VM_129_173_centos systemd[1]: postfix.service: control process exited, code=exited status=1
Nov 12 16:57:43 VM_129_173_centos systemd[1]: Failed to start Postfix Mail Transport Agent.
Nov 12 16:57:43 VM_129_173_centos systemd[1]: Unit postfix.service entered failed state.
Nov 12 16:57:43 VM_129_173_centos systemd[1]: postfix.service failed.

以上命令提示信息也看不出什么,通过 Google 搜索,有一个解决方案:找到 /etc/postfix/main.cf 这个配置文件。将里面的如下配置修改:

inet_interfaces = localhost
# 修改成
inet_interfaces = all

然后重启 Postfix 服务,再启动 Postfix,就没有什么问题了!

[root@VM_129_173_centos ~]# service postfix restart
Redirecting to /bin/systemctl restart postfix.service
[root@VM_129_173_centos ~]# sudo systemctl start postfix

如果系统上没有安装过 Postfix,那么在安装的过程中,会出现相关的配置,选择 ‘Internet Site’ 回车即可。使用你服务器外部 DNS 作为 ‘mail name’ 然后回车,若有其他选项,保持默认即可。

2.添加 GitLab 包仓库并安装包

添加 GitLab 包仓库:

# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6463    0  6463    0     0   4400      0 --:--:--  0:00:01 --:--:--  4402
Detected operating system as centos/7.
Checking for curl...
Detected curl...
Downloading repository file: https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
gitlab_gitlab-ee-source/signature                                                                                                   |  836 B  00:00:00     
Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
Importing GPG key 0xE15E78F4:
 Userid     : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
 Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
 From       : https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg
gitlab_gitlab-ee-source/signature                                                                                                   |  951 B  00:00:01 !!! 
gitlab_gitlab-ee-source/primary                                                                                                     |  175 B  00:00:01     
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-45.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-46.el7_5 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================
 Package                             Arch                             Version                                      Repository                         Size
===========================================================================================================================================================
Updating:
 yum-utils                           noarch                           1.1.31-46.el7_5                              updates                           120 k

Transaction Summary
===========================================================================================================================================================
Upgrade  1 Package

Total download size: 120 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
yum-utils-1.1.31-46.el7_5.noarch.rpm                                                                                                | 120 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : yum-utils-1.1.31-46.el7_5.noarch                                                                                                        1/2 
  Cleanup    : yum-utils-1.1.31-45.el7.noarch                                                                                                          2/2 
  Verifying  : yum-utils-1.1.31-46.el7_5.noarch                                                                                                        1/2 
  Verifying  : yum-utils-1.1.31-45.el7.noarch                                                                                                          2/2 

Updated:
  yum-utils.noarch 0:1.1.31-46.el7_5                                                                                                                       

Complete!
Generating yum cache for gitlab_gitlab-ee...
Importing GPG key 0xE15E78F4:
 Userid     : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
 Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
 From       : https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey

The repository is setup! You can now install packages.

下一步,安装 GitLab 包,将 `http://gitlab.example.com` URL 修改成你想要访问 GitLab 的实例。安装过程会自动配置,并在此 URL 启动 GitLab。HTTPS 在安装之后,需要额外的配置

// sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee
# sudo EXTERNAL_URL="http://gitlab.ifeegoo.com" yum install -y gitlab-ee
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package gitlab-ee.x86_64 0:11.4.5-ee.0.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================
 Package                           Arch                           Version                                   Repository                                Size
===========================================================================================================================================================
Installing:
 gitlab-ee                         x86_64                         11.4.5-ee.0.el7                           gitlab_gitlab-ee                         487 M

Transaction Summary
===========================================================================================================================================================
Install  1 Package

Total download size: 487 M
Installed size: 1.4 G
Downloading packages:****
***
***
Running handlers complete
Chef Client failed. 434 resources updated in 06 minutes 16 seconds
warning: %posttrans(gitlab-ee-11.4.5-ee.0.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTTRANS scriptlet failure in rpm package gitlab-ee-11.4.5-ee.0.el7.x86_64
  Verifying  : gitlab-ee-11.4.5-ee.0.el7.x86_64                                                                                                        1/1 

Installed:
  gitlab-ee.x86_64 0:11.4.5-ee.0.el7                                                                                                                       

Complete!

我暂时将这个 GitLab 的地址指向 http://gitlab.ifeegoo.com。我们安装好,并且配置好域名指向之后,访问发现以下错误:

centos-7-gitlab-installation-502-gitLab-is-taking-too-much-time-to-respond

我们可以通过 gitlab-ctl 命令得到一些参考日志信息,我们保存日志之后,通过查找 warning,failed 或者 error 关键词来查找相关的参考。另外也请注意查看:/var/log/gitlab 子目录底下的 Log 日志。

# gitlab-ctl tail
==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:34:30.17021 127.0.0.1 - - [13/Nov/2018:16:34:29 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:34:30.17021 - -> /process
2018-11-13_08:34:30.33189 127.0.0.1 - - [13/Nov/2018:16:34:30 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:34:30.33190 - -> /process
2018-11-13_08:34:30.43173 127.0.0.1 - - [13/Nov/2018:16:34:29 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:34:30.43175 - -> /database
2018-11-13_08:34:30.66573 127.0.0.1 - - [13/Nov/2018:16:34:30 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:34:30.66575 - -> /database
2018-11-13_08:34:32.71828 127.0.0.1 - - [13/Nov/2018:16:34:32 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:34:32.71830 - -> /sidekiq

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
I, [2018-11-12T20:33:25.893804 #4973]  INFO -- : Refreshing Gem list
I, [2018-11-12T20:34:52.545928 #5207]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:22:23.295373 #1324]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:24:24.960101 #1701]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:25:44.332280 #1869]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:27:26.953284 #2073]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:29:24.213776 #2260]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:30:39.039260 #2411]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:32:00.365238 #2554]  INFO -- : Refreshing Gem list
I, [2018-11-13T16:33:24.932720 #2732]  INFO -- : Refreshing Gem list

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:29:22.00674 starting new unicorn master
2018-11-13_08:30:34.11509 master failed to start, check stderr log for details
2018-11-13_08:30:35.91004 failed to start a new unicorn master
2018-11-13_08:30:36.01299 starting new unicorn master
2018-11-13_08:31:55.80923 master failed to start, check stderr log for details
2018-11-13_08:31:57.10317 failed to start a new unicorn master
2018-11-13_08:31:57.20874 starting new unicorn master
2018-11-13_08:33:19.78558 master failed to start, check stderr log for details
2018-11-13_08:33:21.22905 failed to start a new unicorn master
2018-11-13_08:33:21.29079 starting new unicorn master

==> /var/log/gitlab/postgres-exporter/current <==
2018-11-13_08:22:14.56267 time="2018-11-13T16:22:14+08:00" level=info msg="Established new database connection." source="postgres_exporter.go:995"
2018-11-13_08:22:14.59324 time="2018-11-13T16:22:14+08:00" level=info msg="Error while closing non-pinging DB connection: <nil>" source="postgres_exporter.go:1001"
2018-11-13_08:22:14.59326 time="2018-11-13T16:22:14+08:00" level=info msg="Error opening connection to database (user=gitlab-psql%20host=/var/opt/gitlab/postgresql%20database=postgres%20sslmode=allow): dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: connect: no such file or directory" source="postgres_exporter.go:1030"
2018-11-13_08:22:14.59326 time="2018-11-13T16:22:14+08:00" level=info msg="Starting Server: localhost:9187" source="postgres_exporter.go:1137"
2018-11-13_08:22:29.96889 time="2018-11-13T16:22:29+08:00" level=info msg="Established new database connection." source="postgres_exporter.go:995"
2018-11-13_08:22:30.11867 time="2018-11-13T16:22:30+08:00" level=info msg="Semantic Version Changed: 0.0.0 -> 9.6.8" source="postgres_exporter.go:925"

==> /var/log/gitlab/prometheus/current <==
2018-11-13_08:22:17.68113 level=info ts=2018-11-13T08:22:17.670312141Z caller=compact.go:398 component=tsdb msg="write block" mint=1542060000000 maxt=1542067200000 ulid=01CW62KZ7HSP6TKRMKA70033PD
2018-11-13_08:22:17.69236 level=info ts=2018-11-13T08:22:17.683637004Z caller=head.go:446 component=tsdb msg="head GC completed" duration=1.488016ms
2018-11-13_08:22:17.78913 level=info ts=2018-11-13T08:22:17.77884655Z caller=compact.go:398 component=tsdb msg="write block" mint=1542067200000 maxt=1542074400000 ulid=01CW62KZB0QH1CNX9FYKG7SN2B
2018-11-13_08:22:17.80040 level=info ts=2018-11-13T08:22:17.79243572Z caller=head.go:446 component=tsdb msg="head GC completed" duration=1.409014ms
2018-11-13_08:22:17.88312 level=info ts=2018-11-13T08:22:17.872524627Z caller=compact.go:398 component=tsdb msg="write block" mint=1542074400000 maxt=1542081600000 ulid=01CW62KZEBHCRMKCGK5X8ZFSFR
2018-11-13_08:22:17.89541 level=info ts=2018-11-13T08:22:17.889136419Z caller=head.go:446 component=tsdb msg="head GC completed" duration=1.492571ms
2018-11-13_08:22:17.97913 level=info ts=2018-11-13T08:22:17.968839894Z caller=compact.go:398 component=tsdb msg="write block" mint=1542081600000 maxt=1542088800000 ulid=01CW62KZHC4AJ2FMRFYGKVANSX
2018-11-13_08:22:17.99143 level=info ts=2018-11-13T08:22:17.989074475Z caller=head.go:446 component=tsdb msg="head GC completed" duration=1.802067ms
2018-11-13_08:22:18.27314 level=info ts=2018-11-13T08:22:18.262186941Z caller=compact.go:352 component=tsdb msg="compact blocks" count=3 mint=1542024000000 maxt=1542045600000 ulid=01CW62KZMS4D83W9N0GFXR69FS sources="[01CW62KXV1QXNS9ATVYNZAHR91 01CW62KY9S09VEA0RY5QV23GPK 01CW62KYHBR7C875S3KNQ8FNDN]"
2018-11-13_08:22:18.47132 level=info ts=2018-11-13T08:22:18.461118256Z caller=compact.go:352 component=tsdb msg="compact blocks" count=3 mint=1542045600000 maxt=1542067200000 ulid=01CW62KZXYDSE27P6GNEPMETZ4 sources="[01CW62KYSMNDDTEJ7S6GMMSTF5 01CW62KZ06R6HCDTDGP3KZWR2J 01CW62KZ7HSP6TKRMKA70033PD]"

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-11-13_08:30:50.57165 time="2018-11-13T16:30:50+08:00" level=error msg=error correlation-id=yxwOpvwUGY4 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/favicon.ico
2018-11-13_08:30:50.57167 gitlab.ifeegoo.com @ - - [2018/11/13:16:30:50 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.001
2018-11-13_08:30:52.72495 time="2018-11-13T16:30:52+08:00" level=error msg=error correlation-id=HxWcAMXrRE6 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/
2018-11-13_08:30:52.72677 gitlab.ifeegoo.com @ - - [2018/11/13:16:30:52 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.048
2018-11-13_08:30:53.17844 time="2018-11-13T16:30:53+08:00" level=error msg=error correlation-id=mUtmxxAigk2 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/favicon.ico
2018-11-13_08:30:53.17847 gitlab.ifeegoo.com @ - - [2018/11/13:16:30:53 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.002
2018-11-13_08:31:23.65612 time="2018-11-13T16:31:23+08:00" level=error msg=error correlation-id=BSMZ5CuoFc4 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/
2018-11-13_08:31:23.66695 gitlab.ifeegoo.com @ - - [2018/11/13:16:31:23 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.814
2018-11-13_08:31:24.41023 time="2018-11-13T16:31:24+08:00" level=error msg=error correlation-id=6JxCG4cAHE3 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/favicon.ico
2018-11-13_08:31:24.41029 gitlab.ifeegoo.com @ - - [2018/11/13:16:31:24 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.001

==> /var/log/gitlab/logrotate/current <==

==> /var/log/gitlab/postgresql/current <==
2018-11-12_12:35:03.58822 LOG:  received smart shutdown request
2018-11-12_12:35:03.58822 received TERM from runit, sending INT instead to force quit connections
2018-11-12_12:35:03.58822 LOG:  received fast shutdown request
2018-11-12_12:35:03.58822 received TERM from runit, sending INT instead to force quit connections
2018-11-12_12:35:05.79841 LOG:  shutting down
2018-11-12_12:35:05.96881 LOG:  database system is shut down
2018-11-13_08:22:15.76475 LOG:  database system was shut down at 2018-11-12 12:35:05 GMT
2018-11-13_08:22:16.09868 LOG:  MultiXact member wraparound protections are now enabled
2018-11-13_08:22:16.10336 LOG:  database system is ready to accept connections
2018-11-13_08:22:16.12288 LOG:  autovacuum launcher started

==> /var/log/gitlab/node-exporter/current <==
2018-11-13_08:22:14.55855 time="2018-11-13T16:22:14+08:00" level=info msg=" - sockstat" source="node_exporter.go:97"
2018-11-13_08:22:14.55855 time="2018-11-13T16:22:14+08:00" level=info msg=" - stat" source="node_exporter.go:97"
2018-11-13_08:22:14.55855 time="2018-11-13T16:22:14+08:00" level=info msg=" - textfile" source="node_exporter.go:97"
2018-11-13_08:22:14.55856 time="2018-11-13T16:22:14+08:00" level=info msg=" - time" source="node_exporter.go:97"
2018-11-13_08:22:14.55856 time="2018-11-13T16:22:14+08:00" level=info msg=" - uname" source="node_exporter.go:97"
2018-11-13_08:22:14.55856 time="2018-11-13T16:22:14+08:00" level=info msg=" - vmstat" source="node_exporter.go:97"
2018-11-13_08:22:14.55856 time="2018-11-13T16:22:14+08:00" level=info msg=" - wifi" source="node_exporter.go:97"
2018-11-13_08:22:14.55857 time="2018-11-13T16:22:14+08:00" level=info msg=" - xfs" source="node_exporter.go:97"
2018-11-13_08:22:14.55857 time="2018-11-13T16:22:14+08:00" level=info msg=" - zfs" source="node_exporter.go:97"
2018-11-13_08:22:14.55857 time="2018-11-13T16:22:14+08:00" level=info msg="Listening on localhost:9100" source="node_exporter.go:111"

==> /var/log/gitlab/nginx/access.log <==

==> /var/log/gitlab/nginx/error.log <==

==> /var/log/gitlab/nginx/gitlab_error.log <==

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.105.216.67 - - [13/Nov/2018:16:30:45 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:46 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:48 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:48 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:50 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:50 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:52 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:30:53 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:31:23 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
172.105.216.67 - - [13/Nov/2018:16:31:24 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

==> /var/log/gitlab/nginx/current <==

==> /var/log/gitlab/gitlab-shell/gitlab-shell.log <==

==> /var/log/gitlab/redis-exporter/current <==
2018-11-13_08:22:14.55864 time="2018-11-13T16:22:14+08:00" level=info msg="Redis Metrics Exporter 0.20.2    build date: 2018-11-04T23:54:17+00:00    sha1: 694ec659c0944f104ad7e820a30ba74a1bb4fe1c    Go: go1.10.3" 
2018-11-13_08:22:14.55871 time="2018-11-13T16:22:14+08:00" level=info msg="Providing metrics at localhost:9121/metrics" 
2018-11-13_08:22:14.55871 time="2018-11-13T16:22:14+08:00" level=info msg="Connecting to redis hosts: []string{\"unix:///var/opt/gitlab/redis/redis.socket\"}" 
2018-11-13_08:22:14.55871 time="2018-11-13T16:22:14+08:00" level=info msg="Using alias: []string{\"\"}" 

==> /var/log/gitlab/gitaly/current <==
2018-11-13_08:22:14.91917 time="2018-11-13T08:22:14Z" level=warning msg="git path not configured. Using default path resolution" resolvedPath=/opt/gitlab/embedded/bin/git
2018-11-13_08:22:18.96303 time="2018-11-13T08:22:18Z" level=info msg="listening on unix socket" address=/var/opt/gitlab/gitaly/gitaly.socket
2018-11-13_08:22:18.96305 time="2018-11-13T08:22:18Z" level=info msg="Starting prometheus listener" address="localhost:9236"
2018-11-13_08:22:19.00136 time="2018-11-13T08:22:19Z" level=info msg="starting RSS monitor" supervisor.name=gitaly-ruby.0 supervisor.rss_threshold=209715200
2018-11-13_08:22:19.00137 time="2018-11-13T08:22:19Z" level=info msg="starting RSS monitor" supervisor.name=gitaly-ruby.1 supervisor.rss_threshold=209715200
2018-11-13_08:22:19.00138 time="2018-11-13T08:22:19Z" level=info msg="finished tempdir cleaner walk" storage=default time_ms=37
2018-11-13_08:22:19.00138 time="2018-11-13T08:22:19Z" level=warning msg=spawned supervisor.args="[bundle exec bin/ruby-cd /var/opt/gitlab/gitaly /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 1220 /tmp/gitaly-ruby811892894/socket.0]" supervisor.name=gitaly-ruby.0 supervisor.pid=1305
2018-11-13_08:22:19.02382 time="2018-11-13T08:22:19Z" level=warning msg=spawned supervisor.args="[bundle exec bin/ruby-cd /var/opt/gitlab/gitaly /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 1220 /tmp/gitaly-ruby811892894/socket.1]" supervisor.name=gitaly-ruby.1 supervisor.pid=1307
2018-11-13_08:22:21.40995 time="2018-11-13T08:22:21Z" level=info msg="PID 1307 BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitaly-ruby/Gemfile" supervisor.args="[bundle exec bin/ruby-cd /var/opt/gitlab/gitaly /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 1220 /tmp/gitaly-ruby811892894/socket.1]" supervisor.name=gitaly-ruby.1
2018-11-13_08:22:21.40997 time="2018-11-13T08:22:21Z" level=info msg="PID 1305 BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitaly-ruby/Gemfile" supervisor.args="[bundle exec bin/ruby-cd /var/opt/gitlab/gitaly /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 1220 /tmp/gitaly-ruby811892894/socket.0]" supervisor.name=gitaly-ruby.0

==> /var/log/gitlab/redis/current <==
2018-11-13_08:22:14.78267   `-._    `-._`-.__.-'_.-'    _.-'                                   
2018-11-13_08:22:14.78267       `-._    `-.__.-'    _.-'                                       
2018-11-13_08:22:14.78268           `-._        _.-'                                           
2018-11-13_08:22:14.78269               `-.__.-'                                               
2018-11-13_08:22:14.78269 
2018-11-13_08:22:14.78269 1275:M 13 Nov 16:22:14.771 # Server started, Redis version 3.2.12
2018-11-13_08:22:14.78270 1275:M 13 Nov 16:22:14.771 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
2018-11-13_08:22:14.78270 1275:M 13 Nov 16:22:14.771 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
2018-11-13_08:22:14.78271 1275:M 13 Nov 16:22:14.776 * DB loaded from disk: 0.005 seconds
2018-11-13_08:22:14.78271 1275:M 13 Nov 16:22:14.776 * The server is now ready to accept connections at /var/opt/gitlab/redis/redis.socket

==> /var/log/gitlab/sidekiq/current <==

==> /var/log/gitlab/gitlab-rails/production.log <==

==> /var/log/gitlab/gitlab-rails/application.log <==
# Logfile created on 2018-11-12 20:28:36 +0800 by logger.rb/56815
November 12, 2018 20:28: User "Administrator" (admin@example.com) was created

==> /var/log/gitlab/gitlab-rails/api_json.log <==
# Logfile created on 2018-11-12 20:28:07 +0800 by logger.rb/56815

==> /var/log/gitlab/gitlab-rails/grpc.log <==
# Logfile created on 2018-11-12 20:28:07 +0800 by logger.rb/56815

==> /var/log/gitlab/gitlab-rails/sidekiq.log <==

==> /var/log/gitlab/gitlab-rails/production_json.log <==
# Logfile created on 2018-11-12 20:28:07 +0800 by logger.rb/56815

==> /var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-2018-11-12-20-27-42.log <==
== Seed from /opt/gitlab/embedded/service/gitlab-rails/db/fixtures/production/001_admin.rb
Administrator account created:

login:    root
password: You'll be prompted to create one on your first visit.


== Seed from /opt/gitlab/embedded/service/gitlab-rails/db/fixtures/production/010_settings.rb

== Seed from /opt/gitlab/embedded/service/gitlab-rails/db/fixtures/production/999_common_metrics.rb

==> /var/log/gitlab/alertmanager/current <==
2018-11-12_12:34:48.37537 level=info ts=2018-11-12T12:34:48.277076637Z caller=cluster.go:579 component=cluster msg="gossip not settled but continuing anyway" polls=0 elapsed=1m2.422143738s
2018-11-12_12:35:03.50659 level=info ts=2018-11-12T12:35:03.261135852Z caller=main.go:424 msg="Received SIGTERM, exiting gracefully..."
2018-11-13_08:22:14.55828 level=info ts=2018-11-13T08:22:12.055466381Z caller=main.go:174 msg="Starting Alertmanager" version="(version=0.15.1, branch=master, revision=694ec659c0944f104ad7e820a30ba74a1bb4fe1c)"
2018-11-13_08:22:14.58853 level=info ts=2018-11-13T08:22:12.055589912Z caller=main.go:175 build_context="(go=go1.10.3, user=GitLab-Omnibus, date=2018-11-04T23:54:17+00:00)"
2018-11-13_08:22:14.58855 level=info ts=2018-11-13T08:22:13.611916957Z caller=cluster.go:155 component=cluster msg="setting advertise address explicitly" addr=10.135.129.173 port=9094
2018-11-13_08:22:14.58855 level=info ts=2018-11-13T08:22:14.138018094Z caller=main.go:320 msg="Loading configuration file" file=/var/opt/gitlab/alertmanager/alertmanager.yml
2018-11-13_08:22:14.58856 level=info ts=2018-11-13T08:22:14.139995942Z caller=cluster.go:570 component=cluster msg="Waiting for gossip to settle..." interval=10m0s
2018-11-13_08:22:14.58856 level=info ts=2018-11-13T08:22:14.377131813Z caller=main.go:396 msg=Listening address=localhost:9093
2018-11-13_08:23:48.53571 level=info ts=2018-11-13T08:23:45.691007654Z caller=cluster.go:579 component=cluster msg="gossip not settled but continuing anyway" polls=0 elapsed=1m12.05062069s

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:34:38.95736 127.0.0.1 - - [13/Nov/2018:16:34:38 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:34:38.95738 - -> /process
2018-11-13_08:34:45.11711 127.0.0.1 - - [13/Nov/2018:16:34:44 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:34:45.11713 - -> /database
2018-11-13_08:34:47.86809 127.0.0.1 - - [13/Nov/2018:16:34:47 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:34:47.86812 - -> /sidekiq

==> /var/log/gitlab/redis/current <==
2018-11-13_08:34:52.41489 1275:M 13 Nov 16:34:52.408 * 10 changes in 300 seconds. Saving...
2018-11-13_08:34:52.41764 1275:M 13 Nov 16:34:52.415 * Background saving started by pid 2894
2018-11-13_08:34:52.46544 2894:C 13 Nov 16:34:52.464 * DB saved on disk
2018-11-13_08:34:52.46545 2894:C 13 Nov 16:34:52.465 * RDB: 6 MB of memory used by copy-on-write
2018-11-13_08:34:52.51550 1275:M 13 Nov 16:34:52.515 * Background saving terminated with success

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:35:12.40674 127.0.0.1 - - [13/Nov/2018:16:34:55 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:35:12.70460 - -> /process
2018-11-13_08:35:12.95320 127.0.0.1 - - [13/Nov/2018:16:35:12 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:35:12.95322 - -> /sidekiq
2018-11-13_08:35:13.06945 127.0.0.1 - - [13/Nov/2018:16:35:12 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:35:13.06947 - -> /process
2018-11-13_08:35:13.14873 127.0.0.1 - - [13/Nov/2018:16:35:12 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:35:13.14876 - -> /database

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:35:12.34425 master failed to start, check stderr log for details

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-11-13_08:35:12.90926 time="2018-11-13T16:35:12+08:00" level=error msg=error correlation-id=MYaVTVvgur error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/
2018-11-13_08:35:12.92470 gitlab.ifeegoo.com @ - - [2018/11/13:16:35:12 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.223

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.105.216.67 - - [13/Nov/2018:16:35:12 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:35:13.72978 failed to start a new unicorn master
2018-11-13_08:35:13.76716 starting new unicorn master

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-11-13_08:35:13.58031 time="2018-11-13T16:35:13+08:00" level=error msg=error correlation-id=p7lr4n63uv9 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/favicon.ico
2018-11-13_08:35:13.58033 gitlab.ifeegoo.com @ - - [2018/11/13:16:35:13 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.001

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.105.216.67 - - [13/Nov/2018:16:35:13 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:35:14.88273 127.0.0.1 - - [13/Nov/2018:16:35:14 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:35:14.88275 - -> /database

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
I, [2018-11-13T16:35:16.644337 #2957]  INFO -- : Refreshing Gem list

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:35:17.69912 127.0.0.1 - - [13/Nov/2018:16:35:17 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:35:17.69914 - -> /sidekiq
2018-11-13_08:35:23.97909 127.0.0.1 - - [13/Nov/2018:16:35:23 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:35:23.97910 - -> /process
2018-11-13_08:35:29.99807 127.0.0.1 - - [13/Nov/2018:16:35:29 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:35:29.99809 - -> /database
2018-11-13_08:35:32.94456 127.0.0.1 - - [13/Nov/2018:16:35:32 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:35:33.11172 - -> /sidekiq
2018-11-13_08:36:28.80681 127.0.0.1 - - [13/Nov/2018:16:36:28 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:36:28.81127 - -> /sidekiq
2018-11-13_08:36:28.84816 127.0.0.1 - - [13/Nov/2018:16:36:28 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:36:28.84819 - -> /process
2018-11-13_08:36:29.66209 127.0.0.1 - - [13/Nov/2018:16:36:29 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:36:29.66210 - -> /process
2018-11-13_08:36:29.66750 127.0.0.1 - - [13/Nov/2018:16:36:29 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:36:29.66752 - -> /sidekiq
2018-11-13_08:36:29.78473 127.0.0.1 - - [13/Nov/2018:16:36:29 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:36:29.78475 - -> /database
2018-11-13_08:36:29.92272 127.0.0.1 - - [13/Nov/2018:16:36:29 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:36:29.92274 - -> /database
2018-11-13_08:36:32.69873 127.0.0.1 - - [13/Nov/2018:16:36:32 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:36:32.69877 - -> /sidekiq
2018-11-13_08:36:38.87456 127.0.0.1 - - [13/Nov/2018:16:36:38 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:36:38.87457 - -> /process
2018-11-13_08:36:45.03813 127.0.0.1 - - [13/Nov/2018:16:36:44 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:36:45.03814 - -> /database
2018-11-13_08:36:47.84079 127.0.0.1 - - [13/Nov/2018:16:36:47 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:36:47.84174 - -> /sidekiq

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:36:51.60874 master failed to start, check stderr log for details
2018-11-13_08:36:52.71886 failed to start a new unicorn master
2018-11-13_08:36:52.76907 starting new unicorn master

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:36:53.91853 127.0.0.1 - - [13/Nov/2018:16:36:53 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:36:53.92361 - -> /process

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
I, [2018-11-13T16:36:55.440616 #3112]  INFO -- : Refreshing Gem list

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:36:59.99606 127.0.0.1 - - [13/Nov/2018:16:36:59 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:36:59.99609 - -> /database
2018-11-13_08:37:02.68342 127.0.0.1 - - [13/Nov/2018:16:37:02 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:37:02.68343 - -> /sidekiq
2018-11-13_08:37:09.54949 127.0.0.1 - - [13/Nov/2018:16:37:08 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:37:09.54951 - -> /process
2018-11-13_08:37:23.98205 127.0.0.1 - - [13/Nov/2018:16:37:23 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:37:23.98681 - -> /sidekiq
2018-11-13_08:37:24.09972 127.0.0.1 - - [13/Nov/2018:16:37:14 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:37:24.09974 - -> /database
2018-11-13_08:37:24.14482 127.0.0.1 - - [13/Nov/2018:16:37:24 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:37:24.14483 - -> /process

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-11-13_08:37:23.89821 time="2018-11-13T16:37:23+08:00" level=error msg=error correlation-id=rmNqhLcuL6 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/
2018-11-13_08:37:23.90421 gitlab.ifeegoo.com @ - - [2018/11/13:16:37:23 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.143

==> /var/log/gitlab/postgresql/current <==
2018-11-13_08:37:23.89944 LOG:  could not send data to client: Broken pipe
2018-11-13_08:37:23.90787 FATAL:  connection to client lost

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.105.216.67 - - [13/Nov/2018:16:37:23 +0800] "GET / HTTP/1.1" 502 2940 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-11-13_08:37:25.46372 time="2018-11-13T16:37:25+08:00" level=error msg=error correlation-id=1n7l29DKTV1 error="badgateway: failed after 0s: dial unix /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket: connect: no such file or directory" method=GET uri=/favicon.ico
2018-11-13_08:37:25.46375 gitlab.ifeegoo.com @ - - [2018/11/13:16:37:25 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" 0.001

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.105.216.67 - - [13/Nov/2018:16:37:25 +0800] "GET /favicon.ico HTTP/1.1" 502 2940 "http://gitlab.ifeegoo.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:37:29.89704 127.0.0.1 - - [13/Nov/2018:16:37:29 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:37:29.89705 - -> /database
2018-11-13_08:37:32.70032 127.0.0.1 - - [13/Nov/2018:16:37:32 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:37:32.70033 - -> /sidekiq
2018-11-13_08:37:38.95096 127.0.0.1 - - [13/Nov/2018:16:37:38 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:37:38.95098 - -> /process

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:38:02.84688 master failed to start, check stderr log for details

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:38:03.40998 127.0.0.1 - - [13/Nov/2018:16:38:02 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:38:03.41813 - -> /sidekiq
2018-11-13_08:38:03.48202 127.0.0.1 - - [13/Nov/2018:16:38:03 CST] "GET /sidekiq HTTP/1.1" 200 26
2018-11-13_08:38:03.48204 - -> /sidekiq
2018-11-13_08:38:03.54679 127.0.0.1 - - [13/Nov/2018:16:37:44 CST] "GET /database HTTP/1.1" 200 0
2018-11-13_08:38:03.54681 - -> /database
2018-11-13_08:38:03.56253 127.0.0.1 - - [13/Nov/2018:16:38:03 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:38:03.56254 - -> /process
2018-11-13_08:38:03.63873 127.0.0.1 - - [13/Nov/2018:16:38:03 CST] "GET /database HTTP/1.1" 200 94727
2018-11-13_08:38:03.63877 - -> /database

==> /var/log/gitlab/unicorn/current <==
2018-11-13_08:38:04.18003 failed to start a new unicorn master
2018-11-13_08:38:04.33869 starting new unicorn master

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
I, [2018-11-13T16:38:08.087394 #3259]  INFO -- : Refreshing Gem list

==> /var/log/gitlab/gitlab-monitor/current <==
2018-11-13_08:38:08.92743 127.0.0.1 - - [13/Nov/2018:16:38:08 CST] "GET /process HTTP/1.1" 200 104
2018-11-13_08:38:08.92745 - -> /process

通过查资料,部分人说这个是由于内存不足,可以通过创建虚拟内存来解决问题。通过官方关于 GitLab 内存这块的说明,也要求了最低配置:至少需要 8G 的 RAM + swap 内存。我们首先通过 free -m 命令来查看是否已经创建 Swap 分区,默认的服务器是没有创建的。

# free -m
              total        used        free      shared  buff/cache   available
Mem:            991         668          68          29         254         137
Swap:             0           0           0

针对 CentOS 7.x 的 Swap 分区大小的建议,可以参考官方文档

recommended-system-swap-space-for-centos-7

由于我的服务器只有 1G RAM,所以我尝试分配一个 8G Swap 空间:

# dd if=/dev/zero  of=/var/swapfile  bs=1024  count=8192k
8388608+0 records in
8388608+0 records out
8589934592 bytes (8.6 GB) copied, 90.3551 s, 95.1 MB/s

转换 Swap 分区:

# mkswap /var/swapfile  
Setting up swapspace version 1, size = 8388604 KiB
no label, UUID=72fbdf39-cd3b-4aa3-a15d-ea7d553372eb

挂载并激活分区:

# swapon /var/swapfile
swapon: /var/swapfile: insecure permissions 0644, 0600 suggested.
# chmod -R 0600 /var/swapfile

设置开机自动挂载该分区:

echo "/var/swapfile   swap  swap  defaults  0  0" >>  /etc/fstab

查看 Swap 是否被使用:

# free -m
              total        used        free      shared  buff/cache   available
Mem:            991         846          64           3          81          26
Swap:          8191         504        7687

我们更新下 GitLab 配置和重启 GitLab 服务。

// 更新 GitLab 配置
# gitlab-ctl reconfigure
// 重启 GitLab 服务
# gitlab-ctl restart

GitLab 有一个可能是 Bug 的问题,初次加载页面的时候,会出现 502,可能过几分钟之后,才会出现正常的响应,这个情况网上很多人反馈有这样的问题。

3.浏览主机和登录

首次访问的时候,你将会被重定向到密码重置页面。提供初始管理员账号的密码,然后会被重定向回登录的页面,使用默认账号用户名 root 进行登录。更多参见:安装和配置详细说明文档

centos-7-gitlab-installation-first-loading

输入密码之后,可能会有以下错误:

centos-7-gitlab-installation-password-setting

我们先尝试通过终端的形式,设置管理员密码:

# cd /opt/gitlab/bin
# sudo gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       11.4.5-ee (bf6db46)
 GitLab Shell: 8.3.3
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> u.password='gitlab1313'
=> "gitlab1313"
irb(main):003:0> u.password_confirmation='gitlab1313'
=> "gitlab1313"
irb(main):004:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: a2544b8c-c065-4860-92bd-878c95c32c6b) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true

当你通过以上设置的密码跳过上面一步之后,又提示你要验证邮件,如果你的邮件系统没有配置好的话,你就接收不到这封邮件了。实际操作过程中,也不太需要邮件的验证,管理员直接分配账号即可。具体的移除邮件验证,网上有相关的资料,由于我的测试服务器性能太差,大部分时间访问都是 502,根本无法进行测试确认,大家自己尝试下!

由于我当前个人的测试服务器性能比较低:单核 1G 内存,虽然我采用了 Swap 扩充虚拟内存,但是跑 GitLab 还是很吃力,响应很慢,而且页面访问大部分都是 502,官方也说明了针对于 100 个用户左右,双核 8G RAM 是最基本的要求。正常使用的时候,公司可以购买性能更强劲的服务器专门用于代码管理、CI/CD 这块。或者公司内网用一台服务器来搭建局域网代码管理系统,如果想要外网访问的话,可以通过一些内网穿透工具,例如花生壳等来实现外网的访问。能用钱解决的问题,都不是问题,目前 GitLab 的功能是最强大的,能够结合 CI/CD 工具配合使用,能够极大的提高生产效率!

Note:以上安装 GitLab 的步骤是直接安装的 GitLab 最新针对 CentOS 版本,当你需要进行数据迁移的时候,一定要注意最好安装相同的版本,否则数据迁移过程可能有问题!

由于个人测试服务器性能太差,无法继续进行相关步骤推进,后续有更好的操作环境,再进一步推进!未完待续、不断更新!

打赏
本博客所有文章如无特别注明均为原创。复制或转载请以超链接形式注明转自ifeegoo 的个人博客,原文地址《CentOS 7 上 GitLab 的安装、备份、迁移及恢复
上一篇: « 下一篇: »
暂无相关文章

> 添加新评论

Copyright © ifeegoo 的个人博客 Time is limited, less is more! / 粤ICP备15109713号-1 / Theme by Hang & Ben / WordPress / 知识共享许可协议