`

gilab安装

 
阅读更多

1、配置yum源

vim /etc/yum.repos.d/gitlab-ce.repo

复制以下内容:
 
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1


2、更新本地yum缓存

sudo yum makecache

[root@GEPPRDAP2 ~]# yum makecache
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
file:///media/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/repodata/repomd.xml"
Trying other mirror.
gitlab-ce                                                                                                                                       | 2.9 kB  00:00:00    
(1/3): gitlab-ce/primary_db                                                                                                                     | 2.4 MB  00:00:03    
(2/3): gitlab-ce/other_db                                                                                                                       |  24 kB  00:00:03    
(3/3): gitlab-ce/filelists_db                                                                                                                   | 198 MB  00:03:19    
Metadata Cache Created



3、安装gitlab社区版本
yum install gitlab-ce
[root@GEPPRDAP2 ~]# yum install gitlab-ce
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
file:///media/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/repodata/repomd.xml"
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package gitlab-ce.x86_64 0:11.4.5-ce.0.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                                Arch                                Version                                       Repository                              Size
=======================================================================================================================================================================
Installing:
 gitlab-ce                              x86_64                              11.4.5-ce.0.el7                               gitlab-ce                              435 M

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

Total download size: 435 M
Installed size: 435 M
Is this ok [y/d/N]: y
Downloading packages:
gitlab-ce-11.4.5-ce.0.el7.x86_64.rpm                                                                                                            | 435 MB  00:16:37    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gitlab-ce-11.4.5-ce.0.el7.x86_64                                                                                                                    1/1
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

  Verifying  : gitlab-ce-11.4.5-ce.0.el7.x86_64                                                                                                                    1/1

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

Complete!




4、GitLab常用命令

sudo gitlab-ctl start    # 启动所有 gitlab 组件;
sudo gitlab-ctl stop        # 停止所有 gitlab 组件;
sudo gitlab-ctl restart        # 重启所有 gitlab 组件;
sudo gitlab-ctl status        # 查看服务状态;
sudo gitlab-ctl reconfigure        # 启动服务;
sudo vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
sudo gitlab-ctl tail        # 查看日志


1、在浏览器的地址栏中输入ECS服务器的公网IP即可登录GitLab的界面,第一次登录使用的用户名和密码为 root 和 5iveL!fe。

 

注意:

安装完gitlab后需要启动gitlab, 但是通过gitlab-ctl start 启动后发现服务没有启动, 通过查看安装成功的日志发现“

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

 

需要配置external_url信息,然后使用 gitlab-ctl reconfigure 来执行重新配置生效

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics