这几天折腾搭建git服务器,选择了比较流行的gitlab,一开始就直奔一键安装脚本去了,连gitlab主页都没去看看。用的gitlab-installer,centos6.5,各种错误,各种依赖关系,还有各种无法连接,两天了都没成功。无奈手动配置,没有接触过ruby on rails,照着网上的文档抄,忍受着龟速的epel源,花了几个小时,终于配置成功。把一个项目托管上去,终于松口气,想着下班回去在配一遍,总结下过程。然而,下班回来一搜gitlab,随手打开gitlab主页,我决定暂时放弃这个想法。
因为我发现,居!然!有!官!方!的!rpm!安!装!包!
omnibus方式部署gitlab
Download the Omnibus package and install everything curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.6.2_omnibus.5.3.0.ci.1-1.el6.x86_64.rpm sudo yum install openssh-server sudo yum install postfix sudo yum install cronie sudo service postfix start sudo chkconfig postfix on sudo rpm -i gitlab-7.6.2_omnibus.5.3.0.ci.1-1.el6.x86_64.rpm Configure and start GitLab sudo gitlab-ctl reconfigure sudo lokkit -s http -s ssh Browse to the hostname and login Username: root Password: 5iveL!fe
步骤很简单,主要就是下载速度太慢,好在有个美国的vps,先下载到vps上,然后从vps下载,速度稍好,顺便用百度网盘离线下载了一份。
配置开放用户注册
默认是不允许注册的,如果需要开放注册,可以编辑 /etc/gitlab/gitlab.rb,查找signup_enabled ,值改为true,并取消注释,之后重新配置gitlab。
sudo gitlab-ctl reconfigure
遇到的问题
内存不足
512M的虚拟机,打开gitlab页面巨卡,简直无法忍受,查看内存使用情况:
[root@localhost ~]# free -m total used free shared buffers cached Mem: 482 476 6 0 0 13 -/+ buffers/cache: 462 20 Swap: 1023 260 763
查看gitlab官网的硬件需求。
Memory
You need at least 2GB of addressable memory (RAM + swap) to install and use GitLab! With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage.
- 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly advise against this amount of memory. See the unicorn worker section below for more advise.
- 1GB RAM + 1GB swap supports up to 100 users
- 2GB RAM is the recommended memory size and supports up to 500 users
- 4GB RAM supports up to 2,000 users
- 8GB RAM supports up to 5,000 users
- 16GB RAM supports up to 10,000 users
- 32GB RAM supports up to 20,000 users
- 64GB RAM supports up to 40,000 users
Notice: The 25 workers of Sidekiq will show up as separate processes in your process overview (such as top or htop) but they share the same RAM allocation since Sidekiq is a multithreaded application.
把虚拟机内存调到1G,果然好了,页面打开很流畅。
[root@localhost gitlab]# free -m total used free shared buffers cached Mem: 988 906 82 0 23 114 -/+ buffers/cache: 768 220 Swap: 1023 0 1023
但是之前手动配置的也是512的虚拟机,打开一样很流畅,看来手动配置还是有意义的。
参考资料
[1]. gitlab下载页. https://about.gitlab.com/downloads/ [2]. gitlab硬件需求. http://doc.gitlab.com/ce/install/requirements.html
502怎么解决?
/bin/sh 被 gitlab-7.6.2_omnibus.5.3.0.ci.1-1.el6.x86_64 所需要
没有gitlab-ctl命令,怎么破?
没遇到过,重装试下吧
想起了之前安装 ngx_lua_waf 各种问题折腾了一下午,结果发现自带有一件安装脚本。。。
这样会让你在大神的路上越走越顺的
今天也在阿里云的VPS上装gitlab,那个rpm的网址都ping不通,最后还是先挂代理下载到自己的电脑上然后再上传到VPS上……你应该把百度网盘的共享链接发出来 23333
aws的,被墙了吧,美国vps下载aws上的文件速度飞快