赞
踩
Gitlab是一款项目管理,多人协同工作的管理工具,可以极大提高项目编码的开发。而且分支管理清晰,对于整体项目的清晰开发具有极大的帮助。
1.环境:
阿里云:Centos7.4
2.下载
(1)位置
CentOS7下载网址
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
CentOS6下载网址
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/
(2)使用wget下载11.0.6版本
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.0.6-ce.0.el7.x86_64.rpm
3.安装
(1)添加依赖
- //10.x以后开始依赖policycoreutils-python
- yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
(2)设置postfix开机自启,并启动,postfix支持gitlab发信功能
- systemctl start postfix
- systemctl enable postfix
(3)安装gitlab,进入下载目录
- [root@hadoop02 software]# rpm -ivh gitlab-ce-11.0.6-ce.0.el7.x86_64.rpm
- warning: gitlab-ce-11.0.6-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
- Preparing... ################################# [100%]
- Updating / installing...
- 1:gitlab-ce-11.0.6-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
注意可能会报错:
- [root@hadoop softwares]# rpm -ivh gitlab-ce-11.0.6-ce.0.el7.x86_64.rpm
- warning: gitlab-ce-11.0.6-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
- error: Failed dependencies:
- policycoreutils-python is needed by gitlab-ce-11.0.6-ce.0.el7.x86_64
原因:纯净Linux缺少依赖,所以安装:
yum install policycoreutils-python
4.配置/etc/gitlab/gitlab.rb
- vim /etc/gitlab/gitlab.rb
- 修改,注意不需要添加端口
- external_url 'http://ip'
5.重置并启动GitLab
(1)重置配置,并安装数据库,初始化信息,时间较长【需要运行一段时间】
- gitlab-ctl reconfigure
- 结果:
- ...
- action touch (skipped due to only_if)
- * service[postgres-exporter] action nothing (skipped due to action :nothing)
- * template[/var/opt/gitlab/postgres-exporter/queries.yaml] action create (up to date)
- Recipe: gitlab::deprecate-skip-auto-migrations
- * file[/etc/gitlab/skip-auto-reconfigure] action create (skipped due to only_if)
- * ruby_block[skip-auto-migrations deprecation] action run (skipped due to only_if)
-
- Running handlers:
- Running handlers complete
- Chef Client finished, 2/553 resources updated in 01 minutes 39 seconds
- gitlab Reconfigured!
(2)启动
- gitlab-ctl restart
- 结果
- [root@hadoop ~]# gitlab-ctl restart
- /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:684: warning: Insecure world writable dir /opt/modules in PATH, mode 040777
- ok: run: alertmanager: (pid 22871) 0s
- ok: run: gitaly: (pid 22878) 1s
- ok: run: gitlab-monitor: (pid 22890) 0s
- ok: run: gitlab-workhorse: (pid 22893) 0s
- ok: run: logrotate: (pid 22901) 0s
- ok: run: nginx: (pid 22907) 0s
- ok: run: node-exporter: (pid 22913) 0s
- ok: run: postgres-exporter: (pid 22917) 0s
- ok: run: postgresql: (pid 22926) 0s
- ok: run: prometheus: (pid 22929) 0s
- ok: run: redis: (pid 22939) 0s
- ok: run: redis-exporter: (pid 22943) 0s
- ok: run: sidekiq: (pid 22950) 0s
- ok: run: unicorn: (pid 23002) 0s
6.访问 GitLab页面
(1)访问
http://ip
(2)确认root用户密码
确认密码,输入密码
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。