rpm安装gitlab

2022-01-13 775点热度 0人点赞 0条评论

下载rpm包

rpm安装包下载urlhttps://packages.gitlab.com/gitlab/gitlab-ce

下载的rpm包名如:gitlab-ce-14.6.2-ce.0.el7.x86_64.rpm

rpm安装

上传到服务器上之后使用root用户或者sudo命令运行如下命令:

sudo rpm -ivh gitlab-ce-14.6.2-ce.0.el7.x86_64.rpm
warning: gitlab-ce-14.6.2-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-14.6.2-ce.0.el7        ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.



     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=14-6

配置gitlab

编辑/etc/gitlab/gitlab.rb进行配置,修改的配置项如下:

external_url 'http://192.168.2.6:3000'
git_data_dirs({ "default" => { "path" => "/opt/data/gitlab" } })
user['username'] = "gitlab"
user['group'] = "gitlab"

git_data_dirs代表修改gitlab的默认文件存放位置为/opt/data/gitlab

修改完成之后运行以下命令:

sudo gitlab-ctl reconfigure

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

root密码存储位置上面已经说出,用浏览器登录进web页面即可修改root密码。

常见问题

默认不启动gitlab,启动的时候报错:
gitlab-ctl start 启动时候报错,runsv not running
使用如下命令启动:

sudo systemctl start gitlab-runsvdir.service
sudo gitlab-ctl start

王显锋

激情工作,快乐生活!

文章评论