Gitlab安装及使用

来源:互联网 发布:java字符串是什么意思 编辑:程序博客网 时间:2024/04/30 09:34

1、下载及安装

在gitlab下载页面选择要安装gitlab的操作系统(我用的Centos)。

按照页面提示执行如下命令:

curl -O https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpmyum install openssh-serveryum install postfixyum install cronieservice postfix startchkconfig postfix onrpm -i gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm

2、配置及启动

  • 先检查一下用户文件及进程的限制,如果配置得太少,启动会报错的。可以在/etc/security/limits.conf下修改。

ulimit -a

gitlab-ctl reconfigure

  • 执行完上面的命令后,会抛出如下异常:

[2014-12-25T15:05:33+08:00] ERROR: Exception handlers complete[2014-12-25T15:05:33+08:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.outChef Client failed. 91 resources updated in 28.540054505 seconds[2014-12-25T15:05:33+08:00] ERROR: Chef::Exceptions::MultipleFailures[2014-12-25T15:05:33+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

       别着急,打开/etc/gitlab/gitlab.rb文件,在external_url和ip之间加等号“=”,最好把域名改成ip(如果域名能访问的话可以不用改)。改完以后再重新执行如下命令,:

gitlab-ctl reconfigurelokkit -s http -s ssh

3、使用gitlab

       在浏览器中输入上面修改的ip或域名即可以访问gitlab了。用户名密码是:

Username: rootPassword: 5iveL!fe 

        如果要查看gitlab启动了哪些服务器,可以执行gitlab-ctrl status查看。gitlab使用了如下服务。

[root@dldt078 ~]# gitlab-ctl statusrun: logrotate: (pid 6319) 547s; run: log: (pid 1128) 1282175srun: nginx: (pid 1140) 1282175s; run: log: (pid 1130) 1282175srun: postgresql: (pid 1146) 1282175s; run: log: (pid 1129) 1282175srun: redis: (pid 1138) 1282175s; run: log: (pid 1127) 1282175srun: sidekiq: (pid 1141) 1282175s; run: log: (pid 1131) 1282175srun: unicorn: (pid 1137) 1282175s; run: log: (pid 1126) 1282175s

       当然如果查看更多的gitlab控制命令,直接执行gitlab-ctrl,所有的控制命令都会显示。


       另外,在建立新的仓库后,其提示信息会含有127.0.0.1或者域名(在其它服务器上不能访问)可以在/var/opt/gitlab/gitlab-rails/etc/gitlab.yml文件的GitLab settings一栏修改host为ip或域名。然后执行下面命令就可以了。

gitlab-ctl restart

0 0