更换yum源
为了加快速度,首先可以更换yum
的源
1 | [root@iZ94tq694y3Z ghost]#touch /etc/yum.repos.d/gitlab_gitlab-ce.repo |
替换内容为:
1 | [gitlab-ce] |
安装
用root用户安装:
1 | yum install curl openssh-server openssh-clients postfix cronie |
由于自己的阿里云服务器太渣渣了,所以在这里一直卡主了。看了一下阿里云的服务监控。内存已经爆满了,不得不去花钱升级了一下配置。现在是1CPU
and 2GB
内存。
继续执行,还是报错了。
1 | Running handlers: |
查看内存
1 | [root@iZ94tq694y3Z ghost]# free -m |
解决Cannot allocate memory - fork
问题。
1 | [root@iZ94tq694y3Z swapfile]# mkdir /swapfile |
再重新执行gitlab-ctl reconfigure
成功
1 | Running handlers: |
继续配置:gitlab-rails console production
1 | [root@iZ94tq694y3Z swapfile]# gitlab-rails console production |
配置域名
所有gitlab的配置都在/etc/gitlab/gitlab.rb
了里面。我这里只修改了其中的几项:
1 | web_server['external_users'] = ['root'] #支持的用户 |
配置nginx:
1 | [root@iZ94tq694y3Z conf.d]# cat gitlab.cyblogs.com.conf |
GitLab备份和恢复
1 | 可以将此命令写入crontab,以实现定时备份 |
Gitlab完全卸载
1 | 停止gitlab |
GitLab常用命令
1 | gitlab-ctl start # 启动所有 gitlab 组件; |
验证
浏览器输入:http://gitlab.cyblogs.com/users/sign_in
还有很多的配置还未配置,有待慢慢研究~
参考地址:
- http://blog.gqylpy.com/gqy/25446/
- https://docs.gitlab.com/omnibus/settings/nginx.html
- https://gitlab.com/gitlab-org/gitlab-workhorse/issues/26
如果大家喜欢我的文章,可以关注个人订阅号。欢迎随时留言、交流。