设为首页 收藏本站
查看: 3638|回复: 0

[经验分享] gitlab 之 rpm安装方式

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-11-1 16:03:54 | 显示全部楼层 |阅读模式
GitLab的两种安装方法:
  • 编译安装

    • 优点:可定制性强。数据库既可以选择MySQL,也可以选择PostgreSQL;服务器既可以选择Apache,也可以选择Nginx。
    • 缺点:国外的源不稳定,被墙时,依赖软件包难以下载。配置流程繁琐、复杂,容易出现各种各样的问题。依赖关系多,不容易管理,卸载GitLab相对麻烦。

  • 通过rpm包安装

    • 优点:安装过程简单,安装速度快。采用rpm包安装方式,安装的软件包便于管理。
    • 缺点:数据库默认采用PostgreSQL,服务器默认采用Nginx,不容易定制

一.选择系统版本
       进入Gitlab官网选择自己服务器系统(此处我的版本是centos7)
         http://www.shcsinfo.com/china/gitdownload.html
    QQ截图20161101160341.png
spacer.jpg
spacer.jpg


二.环境准备

sudo yum install curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalld其中防火墙要是没装就不用执行
sudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalld
三.下载RPM包

这里由于网络影响因素,我们就不按照文档上说的步骤走了,在下面有个清华的yum源


For configuration and troubleshooting options please see the Omnibus GitLab documentation
If you are located in China, try using https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

直接进入https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

CentOS/RHEL

新建 /etc/yum.repos.d/gitlab-ce.repo,内容为

你的CentOS/RHEL版本:                  CentOS 6                 CentOS 7                 RHEL 6                 RHEL 7        

[gitlab-ce]name=gitlab-cebaseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7repo_gpgcheck=0gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key

再执行

sudo yum makecachesudo yum install gitlab-ce
这里需要注意的是,在时如果报错

大致就是yum源的问题,就把/etc/yum.repos.d/CentOS-Base.repo 改个名字
如:mv CentOS-Base.repo 00
这样再执行就OK了,

执行完
sudo yum makecachesudo yum install gitlab-ce再执行下
sudo gitlab-ctl reconfigure就可以访问Gitlab了
http://192.168.92.2


开启gitlab的自动启动

systemctl enable gitlab-runsvdir.service
systemctl start gitlab-runsvdir.service
gitlab-cmd start


汉化:
需要下载汉化包,我们这里直接到去git一个。如果没安装git的请自行yum或apt-get 一个git。
比如我们现在到/usr/local/src,执行如下命令去git clone包:
       git clone https://gitlab.com/larryli/gitlab.git
其中如果在clone中报了如下的错:


[iyunv@localhost /]# git clone https://gitlab.com/larryli/gitlab.git
正克隆到 'gitlab'...
remote: Counting objects: 261883, done.
remote: Compressing objects: 100% (54254/54254), done.
error: RPC failed; result=18, HTTP code = 20013.00 KiB/s   
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack failed

是curl的postBuffer 默认值较小的原因,配置下个这个值,就不会出现该错误了.

在git目录下

git config --list
git config --global http.postBuffer 24288000
git config --list

再执行,就成功了

[iyunv@localhost src]# git clone https://github.com/larryli/gitlabhq.git
正克隆到 'gitlabhq'...
remote: Counting objects: 261624, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 261624 (delta 1), reused 0 (delta 0), pack-reused 261601
接收对象中: 100% (261624/261624), 139.66 MiB | 34.00 KiB/s, done.
处理 delta 中: 100% (193704/193704), done.


新建新仓库目录

mkdir -p /mnt/application/gitlab/git-data


  修改配置文件 sudo vi /etc/gitlab/gitlab.rb
搜索:git_data_dir 修改成:git_data_dir "新目录"
如: git_data_dir "/mnt/application/gitlab/git-data"
保存
重新生成gitlab sudo gitlab-ctl reconfigure




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-294220-1-1.html 上篇帖子: SmartGit 8.1 preview 2 发布,Git 客户端 下篇帖子: gitlab数据迁移故障总结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表