• 隐藏侧边栏
  • 展开分类目录
  • 关注微信公众号
  • 我的GitHub
  • QQ:1753970025
Chen Jiehua

GitLab搭建 

目录

之前搭建了简单的Git Server,而最近服务器上的数据重新整理了一下,便打算重新搭建一个私有git服务器来管理自己的代码,GitLab还是很不错的选择。

免费的GitLab选择Community Edition,也就是CE版本啦。

操作系统

支持:

Ubuntu, Debian, CentOS, Red Hat Enterprise Linux, Scientific Linux, Oracle Linux

不支持:

OS X, Arch Linux, Fedora, Gentoo, FreeBSD

Windows的直接绕道吧,或者装个虚拟机。

硬件配置

CPU:

以下是摘自官方的说明文档:

1 core works supports up to 100 users but the application can be a bit slower due to having all workers and background jobs running on the same core
2 cores is the recommended number of cores and supports up to 500 users
4 cores supports up to 2,000 users
8 cores supports up to 5,000 users
16 cores supports up to 10,000 users
32 cores supports up to 20,000 users
64 cores supports up to 40,000 users
More users? Run it on multiple application servers

内存:

需要至少2GB的内存(RAM+SWAP),否则服务器可能出现500现象

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 but it will be slow
2GB RAM is the recommended memory size and supports up to 100 users
4GB RAM supports up to 1,000 users
8GB RAM supports up to 2,000 users
16GB RAM supports up to 4,000 users
32GB RAM supports up to 8,000 users
64GB RAM supports up to 16,000 users
128GB RAM supports up to 32,000 users
More users? Run it on multiple application servers

Unicorn Workers:

CPU cores + 1 = unicorn workers,一般情况下设置为2或者3就足够了使用了

需要注意的是,如果unicorn workers只有1,那么将导致git只能通过ssh协议进行工作,因为使用http协议时,分别需要各一个worker来接收和发送数据。

 

GitLab安装

注:需要postfix邮件服务器;安装apt-get install gitlab-ce时可能因gitlab资源被墙,导致无法下载安装。。。这样的话,就只能先挂代理下载deb包后再传到服务器上去安装

$sudo apt-get install curl openssh-server ca-certificates postfix
$curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
$sudo apt-get install gitlab-ce
$sudo gitlab-ctl reconfigure

登陆gitlab,用户名:root,密码:5iveL!fe

 

参考资料:
https://about.gitlab.com/
 http://doc.gitlab.com/ce/install/requirements.html
 https://about.gitlab.com/downloads/

码字很辛苦,转载请注明来自ChenJiehua《GitLab搭建》

评论