GitLab CE安装
安装比较简单,rpm直接在不同平台安装
https://about.gitlab.com/installation/ 直接下载源包地址
https://about.gitlab.com/downloads/archives/
安装
#yum install curl openssh-server openssh-clients postfix cronie
#service postfix start
#chkconfig postfix on
#lokkit -s http -s ssh
#rpm -i gitlab-ce-XXX.rpm
GitLab加载配置与启动
#gitlab-ctl reconfigure
#gitlab-ctl start/restart
GitLab日志查看
#gitlab-ctl tail nginx
#gitlab-ctl tail unicorn
GitLab CE 备份与恢复
备份
gitlab-rake gitlab:backup:create
可设置自动备份任务
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:creat
更改默认路径,可以在 /etc/gitlab/gitlab.rb 文件的 gitlab_rails['backup_path'] 项中进行设置,默认为 /var/opt/gitlab/backups。
恢复
# 停止需要连接数据库的服务
#gitlab-ctl stop unicorn
#gitlab-ctl stop sidekiq
# 恢复备份的数据,重写数据库内容
# GitLab 8.15 版本以前所用的时间戳格式为 EPOCH (1393513186)
#gitlab-rake gitlab:backup:restore BACKUP=1459620009
# 或# GitLab 8.15 版本以后所用的时间戳格式为 EPOCH_YYYY_MM_DD (1491415349_2017_04_06)
# gitlab-rake gitlab:backup:restore BACKUP=1491415349_2017_04_06
# 启动 GitLabsudo gitlab-ctl start
# 检查 GitLab 是否正常运行
#gitlab-rake gitlab:check SANITIZE=true
GitLab CE迁移与升级
迁移可参考备份与恢复,需要注意的是:版本号一定要一致
升级
跨版本升级在这里不过多介绍,如大版本9,升级过程下载相关安装包进行安装,自动会完成升级
GitLab CE 使用小节
1、项目地址为localhost
#vi /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: localhost
port: 80
https: false
2、merge 、chekout 出现以下错误:
GitLab: The project you were looking for could not be found.
此类错误多出现在git-data挂载软链接导致
如我的挂载 /var/opt/gitlab -> /data/gitlab, 修改参照以下
# /etc/gitlab/gitlab.rb
......
git_data_dirs({ "default" => { "path" => "", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } })
......
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com